You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by no...@apache.org on 2010/03/16 22:31:56 UTC
svn commit: r923997 -
/james/imap/trunk/deployment/src/test/java/org/apache/james/imap/functional/jcr/JCRHostSystem.java
Author: norman
Date: Tue Mar 16 21:31:56 2010
New Revision: 923997
URL: http://svn.apache.org/viewvc?rev=923997&view=rev
Log:
Fixes for jcr tests(IMAP-93)
Modified:
james/imap/trunk/deployment/src/test/java/org/apache/james/imap/functional/jcr/JCRHostSystem.java
Modified: james/imap/trunk/deployment/src/test/java/org/apache/james/imap/functional/jcr/JCRHostSystem.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/deployment/src/test/java/org/apache/james/imap/functional/jcr/JCRHostSystem.java?rev=923997&r1=923996&r2=923997&view=diff
==============================================================================
--- james/imap/trunk/deployment/src/test/java/org/apache/james/imap/functional/jcr/JCRHostSystem.java (original)
+++ james/imap/trunk/deployment/src/test/java/org/apache/james/imap/functional/jcr/JCRHostSystem.java Tue Mar 16 21:31:56 2010
@@ -44,23 +44,21 @@ public class JCRHostSystem extends ImapH
private static final String JACKRABBIT_HOME = "deployment/target/jackrabbit";
public static final String META_DATA_DIRECTORY = "target/user-meta-data";
- private static TransientRepository repository;
+ private TransientRepository repository;
private javax.jcr.Session session;
public JCRHostSystem() throws Exception {
- if (repository == null) {
- File home = new File(JACKRABBIT_HOME);
- if (home.exists()) {
- FileUtils.deleteDirectory(home);
- }
-
- RepositoryConfig config = RepositoryConfig.create(new InputSource(this.getClass().getClassLoader().getResourceAsStream("test-repository.xml")), JACKRABBIT_HOME);
- repository = new TransientRepository(config);
- session = repository.login();
+ File home = new File(JACKRABBIT_HOME);
+ if (home.exists()) {
+ FileUtils.deleteDirectory(home);
}
-
+
+ RepositoryConfig config = RepositoryConfig.create(new InputSource(this.getClass().getClassLoader().getResourceAsStream("test-repository.xml")), JACKRABBIT_HOME);
+ repository = new TransientRepository(config);
+ session = repository.login();
+
userManager = new InMemoryUserManager();
@@ -85,14 +83,7 @@ public class JCRHostSystem extends ImapH
public void resetData() throws Exception {
resetUserMetaData();
- /*
- if (session != null && session.isLive()) {
- session.logout();
- }
- */
- repository.shutdown();
-
- //FileUtils.deleteDirectory(new File(JACKRABBIT_HOME));
+
}
public void resetUserMetaData() throws Exception {
@@ -107,6 +98,8 @@ public class JCRHostSystem extends ImapH
@Override
public void afterTests() throws Exception {
session.logout();
+ repository.shutdown();
+ repository = null;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org