#: Alexandru Popescu changed the world a bit at a time by saying (astral date: 
2/6/2006 11:34 AM) :#
#: 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: [EMAIL PROTECTED]
DEBUG: removing EventListener: [EMAIL PROTECTED]
DEBUG: removing EventListener: [EMAIL PROTECTED]
DEBUG: removing EventListener: [EMAIL PROTECTED]
DEBUG: removing EventListener: [EMAIL PROTECTED]
DEBUG: removing EventListener: [EMAIL PROTECTED]
  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.


It looks like there is an exception from Derby with state code: ERROR 08006
The following should help http://db.apache.org/derby/docs/10.1/ref/rrefexcept71493.html, but unfortunately the message is completely unusefull.

Do you have any ideas about how to write/organize the tests so that I can go on and not face this error again?

tia,

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

Reply via email to