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

RE: [junit] method dependency

Expand Messages
  • Håkan Danielsson (ERA)
    I think I have read somewhere that this is not guaranteed, it is just a result of the current implementation. Is this really guaranteed? /Håkan
    Message 1 of 7 , Aug 1, 2001
    View Source
    • 0 Attachment
      I think I have read somewhere that this is not guaranteed, it is just a result of the current implementation. Is this really guaranteed?

      /Håkan

      > -----Original Message-----
      > From: rainsber@... [mailto:rainsber@...]
      > Sent: Monday, July 09, 2001 4:35 PM
      > To: junit@yahoogroups.com
      > Subject: Re: [junit] method dependency
      >
      >
      ...
      >
      > Failing that, override method suite() for the test and put
      > the tests in the
      > appropriate order.
      >
      > public class MyTestCase ... {
      > public static Test suite() {
      > TestSuite result = new TestSuite();
      > result.addTest(new MyTestCase("testA"));
      > result.addTest(new MyTestCase("testB"));
      > result.addTest(new MyTestCase("testC"));
      > ...
      > return result;
      > }
      > }
      >
      > This guarantees the order in which the tests are executed
      > within the suite.
      >
      > J. B. Rainsberger <rainsber@...>
      > Commerce Suite Accelerator: Rule Services, IBM Toronto Lab
      > 8200 Warden Av, Office A3-735 [A3/FNB/8200/MKM]
      > Markham ON L6G 1C7
      > 905 413-2501 (969-2501)
      >
      >
      > "Clemmons, Scott" <scott.clemmons@...> on
      > 07/09/2001 09:06:44
      >
      > Please respond to junit@yahoogroups.com
      >
      > To: JUnit <junit@yahoogroups.com>
      > cc:
      > Subject: [junit] method dependency
      >
      >
      >
      > Hi,
      >
      > In my class, I have methods A(),B(), C(), where A() must be
      > called before B
      > (), B() before C(). I have individual test cases for each
      > method. In order
      > to run the tests in the specified order, I must arrange the
      > actual methods
      > in the appropriate order. I know this is not a good thing, so how do I
      > avoid it? I really hate to lump them into one testcase.
      >
      > Thanks,
      >
      >
      > Scott
      > :-> Change is inevitable except from vending machines.
      >
      >
      > To unsubscribe from this group, send an email to:
      > junit-unsubscribe@yahoogroups.com
      >
      >
      > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
      >
      >
      >
      >
      >
      > To unsubscribe from
      > this group, send an email to:
      > junit-unsubscribe@yahoogroups.com
      >
      >
      > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
      >
      >
    • kentbeck@csi.com
      ... before B(), B() before C(). I have individual test cases for each method. In order to run the tests in the specified order, I must arrange the actual
      Message 2 of 7 , Aug 1, 2001
      View Source
      • 0 Attachment
        --- In junit@y..., "Clemmons, Scott" <scott.clemmons@f...> wrote:
        > Hi,
        >
        > In my class, I have methods A(),B(), C(), where A() must be called
        before B(), B() before C(). I have individual test cases for each
        method. In order to run the tests in the specified order, I must
        arrange the actual methods in the appropriate order. I know this is
        not a good thing, so how do I avoid it? I really hate to lump them
        into one testcase.

        Either lump them into one test case or break the dependency. If you
        just muddle through, you're missing a chance for a design insight.

        Kent
      Your message has been successfully submitted and would be delivered to recipients shortly.