incubator-graffito-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandru Popescu <the.mindstorm.mailingl...@gmail.com>
Subject test changes
Date Mon, 06 Feb 2006 11:17:28 GMT
Hi!

I would like to kindly ask you to take a look at the attached zip. It suggests a new approach
for 
the tests.

The changes:

1/ each testcase that needs to run against a repository has a suite() method that wraps the

TestSuite inside a RepositoryLifecycleTestSetup

This allows running each test by its own and guarantees that the repository is correctly started

only once and closed afterwards.

2/ each package contains a AllTests class that has mainly 2 methods:

- suite() that wrappes inside a RepositoryLifecycleTestSetup a simple TestSuite: this is too
allow 
to run all tests inside a package. As above it guarantees that the repository is started only
once 
and closed afterwards

- simpleSuite(): returns a normal TestSuite(). This method is used by the main AllTests class
that 
provides the suite for the whole graffito jcr

3/ org.apache.portals.graffito.jcr.AllTests

creates the suite for all tests

It may look a little tedious and it requires a little more work to be done when creating tests.

However this has the advantage that you can run individual tests, package level tests and
the whole 
suite without worrying about the repository startup and close. It was implemented this way
because 
of the OutOfMemoryError problem I have reported to Jackrabbit ml (it looks like it is a problem
with 
Derby not releasing the resources). However, I still believe that creating a repository only
once 
before a suite is run and assuring that it is closed afterwards is the good and correct strategy.

What do you think?

./alex
--
.w( the_mindstorm )p.

ps: if you agree with these changes, than somebody that knows Maven should instruct it to
run only 
org.apache.portals.graffito.jcr.AllTests.

Mime
View raw message