avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: Excalibur Junit
Date Tue, 21 Aug 2001 20:42:22 GMT
giacomo wrote:
> 
> On Tue, 21 Aug 2001, Berin Loritsch wrote:
> 
> > Peter Donald wrote:
> > >
> > > On Tue, 21 Aug 2001 22:58, Berin Loritsch wrote:
> > > > Changing the "fork" attribute to false causes the RMI Context tests to
> > > > fail. This is due to the fact that it is trying to bind to a port that
is
> > > > already open.
> > >
> > > Hmm .. I thought I wrote it properly ;/ Oh well I will try to fix that so we
> > > can do it in JVM.
> >
> > The biggest conceptual change is that setUp() and tearDown() is called around
> > EACH test*() method.  Testlet had one initialize() and one dispose() that was
> > called for the life of the testlet class.  JUnit calls setUp() and tearDown()
> > for each test method.
> >
> > There is a way to do once only initialization/teardown, but it is a little
> > convoluted--and should be done within our AvalonTestCase.
> 
> I'm +1 for a one time initialize/dispose procedure. I haven't looked
> into the code of the TestCase class but can we overrite some methods to
> achieve it using a isInitialized variable or so?

>From the JUnit FAQ:
----------------------------------------------------------------
Wrap the top level suite in a subclass of TestSetup.
Here is a sample AllTests.suite() method: 

    public static Test suite() { 
      TestSuite suite= new TestSuite(); 
      ...add your tests and suites here... 
      TestSetup wrapper= new TestSetup(suite) { 
       public void setUp() { 
        oneTimeSetUp(); 
       } 
      }; 
      return wrapper; 
    }
----------------------------------------------------------------

(http://junit.sourceforge.net/doc/faq/faq.htm#How do I run setup code only once)

---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org


Mime
View raw message