Loading ...
Sorry, an error occurred while loading the content.

Re: @Rule TestName not available in @Before methods...

Expand Messages
  • sslavic@yahoo.com
    This still doesn t seem to be supported (see https://github.com/KentBeck/junit/issues/229 ). Maybe solution would be to introduce @BeforeRule and have them
    Message 1 of 5 , Jul 1, 2011
    View Source
    • 0 Attachment
      This still doesn't seem to be supported (see https://github.com/KentBeck/junit/issues/229 ). Maybe solution would be to introduce @BeforeRule and have them executed before @Before.

      Regards,
      Stevo.

      --- In junit@yahoogroups.com, "kentb" <kentb@...> wrote:
      >
      > This is the second report I've seen today that wished that @Rules were
      > executed before @Before. I know we had a good reason for the ordering we
      > used. I'll have to see if I can remember what it was. If it makes more sense
      > to push rules earlier, we will.
      >
      > Kent
      >
      > _____
      >
      > From: junit@yahoogroups.com [mailto:junit@yahoogroups.com] On Behalf Of
      > Barry Kaplan
      > Sent: Friday, August 28, 2009 5:08 PM
      > To: junit@yahoogroups.com
      > Subject: [junit] @Rule TestName not available in @Before methods...
      >
      >
      >
      >
      >
      > This is a shame, the framework indeed knows the test method for which
      > @Before
      > is executing.
      >
      > I haven't looked at the new rules impl yet, does anybody know if its even
      > possible that TestName could be initialized before @Before methods?
      > --
      > View this message in context: http://www.nabble
      > <http://www.nabble.com/%40Rule-TestName-not-available-in-%40Before-methods..
      > .-tp25198691p25198691.html>
      > com/%40Rule-TestName-not-available-in-%40Before-methods...-tp25198691p251986
      > 91.html
      > Sent from the JUnit - User mailing list archive at Nabble.com.
      >
      >
      >
      >
      >
      >
      > [Non-text portions of this message have been removed]
      >
    • David Saff
      Stevo, Barry s original use case benefited from refactoring to a @Rule. Do you have a different use case in which this isn t the right thing to do? David Saff
      Message 2 of 5 , Jul 1, 2011
      View Source
      • 0 Attachment
        Stevo,

        Barry's original use case benefited from refactoring to a @Rule. Do
        you have a different use case in which this isn't the right thing to
        do?

        David Saff

        On Fri, Jul 1, 2011 at 5:27 AM, <sslavic@...> wrote:
        > This still doesn't seem to be supported (see https://github.com/KentBeck/junit/issues/229 ). Maybe solution would be to introduce @BeforeRule and have them executed before @Before.
        >
        > Regards,
        > Stevo.
        >
        > --- In junit@yahoogroups.com, "kentb" <kentb@...> wrote:
        >>
        >> This is the second report I've seen today that wished that @Rules were
        >> executed before @Before. I know we had a good reason for the ordering we
        >> used. I'll have to see if I can remember what it was. If it makes more sense
        >> to push rules earlier, we will.
        >>
        >> Kent
        >>
        >>   _____
        >>
        >> From: junit@yahoogroups.com [mailto:junit@yahoogroups.com] On Behalf Of
        >> Barry Kaplan
        >> Sent: Friday, August 28, 2009 5:08 PM
        >> To: junit@yahoogroups.com
        >> Subject: [junit] @Rule TestName not available in @Before methods...
        >>
        >>
        >>
        >>
        >>
        >> This is a shame, the framework indeed knows the test method for which
        >> @Before
        >> is executing.
        >>
        >> I haven't looked at the new rules impl yet, does anybody know if its even
        >> possible that TestName could be initialized before @Before methods?
        >> --
        >> View this message in context: http://www.nabble
        >> <http://www.nabble.com/%40Rule-TestName-not-available-in-%40Before-methods..
        >> .-tp25198691p25198691.html>
        >> com/%40Rule-TestName-not-available-in-%40Before-methods...-tp25198691p251986
        >> 91.html
        >> Sent from the JUnit - User mailing list archive at Nabble.com.
        >>
        >>
        >>
        >>
        >>
        >>
        >> [Non-text portions of this message have been removed]
        >>
        >
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.