jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: OutOfMemory while running tests
Date Mon, 06 Feb 2006 08:48:06 GMT
Please check if the repository is really stopped after each test case. 
What exactly happens in your utility method 
RepositoryUtil.unRegisterRepository?

Using the jackrabbit default log4j settings you should also see log 
messages about repository start and stop in the jcr.log file.

regards
  marcel

Alexandru Popescu wrote:
> Hi!
> 
> I have a set of tests (more or less unit tests). Considering that I want 
> to be able to run some of them individually or all of them I have each 
> TestCase returning a RepositoryLifecycleTestSetup (that is 
> registering/unregistering the test repository).
> 
> [code]
> public class MyTestClass extends TestCase {
>     public static Test suite() {
>         return new RepositoryLifecycleTestSetup(new 
> TestSuite(MyTestClass.class));
>     }
> 
>     [...]
> }
> [/code]
> 
> [code]
> package org.apache.portals.graffito.jcr;
> 
> import org.apache.portals.graffito.jcr.repository.RepositoryUtil;
> 
> import junit.extensions.TestSetup;
> import junit.framework.Test;
> 
> 
> /**
>  * This class/interface
>  */
> public class RepositoryLifecycleTestSetup extends TestSetup {
>     public RepositoryLifecycleTestSetup(Test test) {
>         super(test);
>     }
> 
>     /**
>      * @see junit.extensions.TestSetup#setUp()
>      */
>     protected void setUp() throws Exception {
>         super.setUp();
>         RepositoryUtil.registerRepository("repositoryTest",
>                 "./src/test-config/repository-derby.xml", 
> "./target/repository");
>     }
> 
>     /**
>      * @see junit.extensions.TestSetup#tearDown()
>      */
>     protected void tearDown() throws Exception {
>         RepositoryUtil.unRegisterRepository("repositoryTest");
>         super.tearDown();
>     }
> 
> 
> }
> [/code]
> 


Mime
View raw message