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

Re: @before is called for every @Test

Expand Messages
  • simao_mata
    Hi, I m testing database insertions and updates, I think it s acceptable to use repeated behavior for several tests. @beforeclass solved my problem, thank you
    Message 1 of 3 , Dec 6, 2007
    View Source
    • 0 Attachment
      Hi,

      I'm testing database insertions and updates, I think it's acceptable
      to use repeated behavior for several tests.

      @beforeclass solved my problem, thank you very much for your help

      Best regards,
      Simao Mata


      --- In junit@yahoogroups.com, "Buddha Buck" <blaisepascal@...> wrote:
      >
      > On Dec 6, 2007 2:10 PM, simao_mata <simaomm@...> wrote:
      > > Hi,
      > >
      > > I'm having a problem using a test suite with several test cases.
      > >
      > > One of the TestCases has a @Before method, and multiple @Test methods.
      > >
      > > The problem is that the @Before method is called before every single
      > > @Test.
      >
      > That is it's documented behavior, and what I, at least, want and expect.
      >
      > >
      > > How can I solve this?
      >
      > Rewrite your tests so that they are more independent?
      >
      > If you really need to do setup before an entire class, there is the
      > @BeforeClass and @AfterClass annotation.
      >
      > >
      > > Here is the TestSuite I'm using:
      > > http://paste.uni.cc/17736
      > >
      > > And the TestCase I'm referring to:
      > > http://paste.uni.cc/17737
      > >
      > > Thank you for your help,
      > >
      > > Simao Mata
      > >
      > >
      > >
      > >
      > >
      > >
      > > Yahoo! Groups Links
      > >
      > >
      > >
      > >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.