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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to