You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lecharny <el...@gmail.com> on 2007/09/25 23:54:41 UTC

Using JUnit 4 in tests

Hi !

I have done some experiment in trunks with JUnit4. The results are
impressive ! For SearchTest, I went from 40 seconds down to 4 seconds.

The basic idea is to setup the server only once per class, instead of
set up and shutdown the server for each test.

The price to pay is not free though : the data must be organized in a
way that the initial import of entry covers all the test. These data
will be imported before each tests, we can also think about deleting
them after each test.

Here are the three classes implemented as a example.

directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/FastDelITest.java
directory/apacheds/trunk/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerFastTest.java
directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/FastSearchTest.java

Just tell me if you need any more explanations.

I would like to switch the most costly unit tests using this technic
as quickly as possible, to reduce the global regrssion tests cost
(more than 20 minutes on my laptop). I really think we can go down to
4 or 5 minutes.
The targets are core-unit and server-unit.

Thanks !

PS: currently, fast and slow tests are overlapping. I will wait a bit
before commenting slow tests.

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

Re: Using JUnit 4 in tests

Posted by Emmanuel Lecharny <el...@gmail.com>.
Too late, I already deployed the tests in the train when we were back to Köln :]

On 9/26/07, Chris Custine <cc...@apache.org> wrote:
> Can you commit this yesterday?  Last Friday would be even better....
> Thanks.  :-D
>
> Chris
>
>
> On 9/25/07, Emmanuel Lecharny < elecharny@gmail.com> wrote:
> > Hi !
> >
> > I have done some experiment in trunks with JUnit4. The results are
> > impressive ! For SearchTest, I went from 40 seconds down to 4 seconds.
> >
> > The basic idea is to setup the server only once per class, instead of
> > set up and shutdown the server for each test.
> >
> > The price to pay is not free though : the data must be organized in a
> > way that the initial import of entry covers all the test. These data
> > will be imported before each tests, we can also think about deleting
> > them after each test.
> >
> > Here are the three classes implemented as a example.
> >
> >
> directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/FastDelITest.java
> >
> directory/apacheds/trunk/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerFastTest.java
> >
> directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/FastSearchTest.java
> >
> > Just tell me if you need any more explanations.
> >
> > I would like to switch the most costly unit tests using this technic
> > as quickly as possible, to reduce the global regrssion tests cost
> > (more than 20 minutes on my laptop). I really think we can go down to
> > 4 or 5 minutes.
> > The targets are core-unit and server-unit.
> >
> > Thanks !
> >
> > PS: currently, fast and slow tests are overlapping. I will wait a bit
> > before commenting slow tests.
> >
> > --
> > Regards,
> > Cordialement,
> > Emmanuel Lécharny
> > www.iktek.com
> >
>
>


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

Re: Using JUnit 4 in tests

Posted by Chris Custine <cc...@apache.org>.
Can you commit this yesterday?  Last Friday would be even better....
Thanks.  :-D

Chris

On 9/25/07, Emmanuel Lecharny <el...@gmail.com> wrote:
>
> Hi !
>
> I have done some experiment in trunks with JUnit4. The results are
> impressive ! For SearchTest, I went from 40 seconds down to 4 seconds.
>
> The basic idea is to setup the server only once per class, instead of
> set up and shutdown the server for each test.
>
> The price to pay is not free though : the data must be organized in a
> way that the initial import of entry covers all the test. These data
> will be imported before each tests, we can also think about deleting
> them after each test.
>
> Here are the three classes implemented as a example.
>
>
> directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/FastDelITest.java
>
> directory/apacheds/trunk/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerFastTest.java
>
> directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/FastSearchTest.java
>
> Just tell me if you need any more explanations.
>
> I would like to switch the most costly unit tests using this technic
> as quickly as possible, to reduce the global regrssion tests cost
> (more than 20 minutes on my laptop). I really think we can go down to
> 4 or 5 minutes.
> The targets are core-unit and server-unit.
>
> Thanks !
>
> PS: currently, fast and slow tests are overlapping. I will wait a bit
> before commenting slow tests.
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
>