jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandru Popescu <the.mindstorm.mailingl...@gmail.com>
Subject Re: OutOfMemory while running tests
Date Mon, 06 Feb 2006 09:34:42 GMT
#: Marcel Reutegger changed the world a bit at a time by saying (astral date: 2/6/2006 10:48
AM) :#
> 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]
>> 
> 
> 

Considering the previous answer, can I conclude that I am not doing something wrong in my
tests 
ain't it?

After each call to RegistryHelper.unregisterRepository(ctx, repositoryName) I can see in the
console:

[log]
DEBUG: invalidated item cafebabe-cafe-babe-cafe-babecafebabe
DEBUG: invalidated item cafebabe-cafe-babe-cafe-babecafebabe
DEBUG: removing item cafebabe-cafe-babe-cafe-babecafebabe from cache
DEBUG: removing item cafebabe-cafe-babe-cafe-babecafebabe from cache
  INFO: Notification of EventListeners stopped.
  INFO: Notification of EventListeners stopped.
DEBUG: dispose IndexMerger
DEBUG: dispose IndexMerger
  INFO: IndexMerger terminated
  INFO: IndexMerger terminated
DEBUG: quit sent
DEBUG: quit sent
DEBUG: IndexMerger thread stopped
DEBUG: IndexMerger thread stopped
DEBUG: merge queue size: 0
DEBUG: merge queue size: 0
  INFO: Index closed: .\target\repository\workspaces\default/index
  INFO: Index closed: .\target\repository\workspaces\default/index
DEBUG: removing EventListener: org.apache.jackrabbit.core.SearchManager@610a39
DEBUG: removing EventListener: org.apache.jackrabbit.core.SearchManager@610a39
DEBUG: removing EventListener: org.apache.jackrabbit.core.lock.LockManagerImpl@112f348
DEBUG: removing EventListener: org.apache.jackrabbit.core.lock.LockManagerImpl@112f348
DEBUG: removing EventListener: org.apache.jackrabbit.core.RepositoryImpl@99d1df
DEBUG: removing EventListener: org.apache.jackrabbit.core.RepositoryImpl@99d1df
  INFO: Database '.\target\repository\workspaces\default/db' shutdown.
  INFO: Database '.\target\repository\workspaces\default/db' shutdown.
  INFO: Database './target/repository/version/db' shutdown.
  INFO: Database './target/repository/version/db' shutdown.
[/log]

so I would say that the close operation is correctly triggered and even better it works as
expected. 
Still, the exception occurs.

I would say that it looks like a problem on Derby releasing the resources, but I would like
to be 
sure that this has nothing to do with SimpleDbPersistenceManager.

Please advise.

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

Mime
View raw message