jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philemon Siclone <philemon_sicl...@yahoo.fr>
Subject RE: How to write "testsuite server-side fixtures"
Date Mon, 23 Aug 2004 18:07:45 GMT
 --- Vincent Massol <vmassol@pivolis.com> a écrit : 
> Hi Phil,
> 
> More precisely the setUp()/teardown() methods will be executed on the
> server
> side (which is what you want) but I now understand that you want this
> for a
> set of Cactus Test Cases and not just for one test case. Is that
> correct?

Yes it is ! Sorry if it wasn't very clear.

> 
> Then, why don't you create a MyServletTestCase class which has a
> default
> setUp()/teardown() and then have your tests extend MyServletTestCase,
> ensuring they call super.setUp()/super.tearDown()?
> 
> Another option is to create this common setup/teardown in a separate
> helper
> class and call them from your test classes.
> 
> Would that do it for you?
> 

Well, not really... because I do not only want these fixtures to be the
same code, I also want them to be executed only once before and after
each TestCase, like real testsuite-fixtures (and if I am right your
solutions get them executed once before and after each test method).

The only solution I came up with is quite ugly :
"
public class CactusSuite extends TestCase
{
    public static Test suite()
    {
        TestSuite suite = new TestSuite();
        suite.addTestSuite(TestSuiteSetUp.class);
        suite.addTestSuite(MyFirstTest.class);
        suite.addTestSuite(TestSuiteTearDown.class);
        return suite;
    }
}
"
Where MyFirstTest is my real ServletTestCase; and TestSuiteSetup and
TestSuiteTearDown are ServletTestCase that simulate fixtures.

Maybe if I have got time I'll dive into the sources and try to write a
true "ServerSideSuite".

Anyway, thanks a lot for your answers and for the cactus project,

Phil



> There is currently no notion of "server-side test suites".
> 
> Thanks
> -Vincent
> 
> > 
> > Regards,
> > 
> > Phil
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > >
> > > Thanks
> > > -Vincent
> > >
> > > > -----Original Message-----
> > > > From: Philemon Siclone [mailto:philemon_siclone@yahoo.fr]
> > > > Sent: mercredi 18 août 2004 14:54
> > > > To: cactus-user@jakarta.apache.org
> > > > Subject: How to write "testsuite server-side fixtures"
> > > >
> > > > Hi,
> > > >
> > > > The title says it all (almost). I'd like to execute some code
> on
> > > the
> > > > server-side before and after a set of (servlet)testcases is
> run. At
> > > the
> > > > moment I have written a (classic junit) testSuite containing
> the
> > > > servletTestCases, but the fixtures of this testSuite get
> executed
> > > on
> > > > the client-side (obviously).
> > > >
> > > > It seems like a quite simple need but I could not find any
> answer
> > > on
> > > > the cactus-website.
> > > >
> > > > Regards,
> > > > (and sorry for my bad english)
> > > >
> > > > Phil
> > > >
> > > > PS: I do not use cactus-ant tasks for tests-execution : my IDE
> does
> > > it.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Vous manquez d’espace pour stocker vos mails ?
> > > > Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
> > > > Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
> > > >
> > > > Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les
> > > nouveautés
> > > > pour dialoguer instantanément avec vos amis. A télécharger
> > > gratuitement
> > > > sur http://fr.messenger.yahoo.com
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> cactus-user-unsubscribe@jakarta.apache.org
> > > > For additional commands, e-mail:
> > > cactus-user-help@jakarta.apache.org
> > >
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> cactus-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> cactus-user-help@jakarta.apache.org
> > >
> > >
> > 
> > 
> > 
> > 
> > 
> > 
> > Vous manquez d’espace pour stocker vos mails ?
> > Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
> > Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
> > 
> > Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les
> nouveautés
> > pour dialoguer instantanément avec vos amis. A télécharger
> gratuitement
> > sur http://fr.messenger.yahoo.com
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> cactus-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org
> 
>  





	

	
		
Vous manquez d’espace pour stocker vos mails ? 
Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer
instantanément avec vos amis. A télécharger gratuitement sur http://fr.messenger.yahoo.com

Mime
View raw message