incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1148443 - in /incubator/lcf/trunk/framework/core/src: main/java/org/apache/manifoldcf/core/system/ test/java/org/apache/manifoldcf/core/tests/
Date Tue, 19 Jul 2011 16:52:43 GMT
Author: kwright
Date: Tue Jul 19 16:52:42 2011
New Revision: 1148443

URL: http://svn.apache.org/viewvc?rev=1148443&view=rev
Log:
Allow tests to be run in the same JVM to keep Maven happy.

Modified:
    incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/system/ManifoldCF.java
    incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/Base.java
    incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/BaseHSQLDB.java
    incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/BasePostgresql.java

Modified: incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/system/ManifoldCF.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/system/ManifoldCF.java?rev=1148443&r1=1148442&r2=1148443&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/system/ManifoldCF.java
(original)
+++ incubator/lcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/system/ManifoldCF.java
Tue Jul 19 16:52:42 2011
@@ -125,6 +125,29 @@ public class ManifoldCF
   /** File to look for to block access to UI during database maintenance */
   public static final String maintenanceFileSignalProperty = "org.apache.manifoldcf.database.maintenanceflag";
 
+  /** Reset environment.
+  */
+  public static void resetEnvironment()
+    throws ManifoldCFException
+  {
+    synchronized (initializeFlagLock)
+    {
+      if (!isInitialized)
+        return;
+      // Clean up the system doing the same thing the shutdown thread would have if the process
was killed
+      cleanUpSystem();
+      masterDatabaseName = null;
+      masterDatabaseUsername = null;
+      masterDatabasePassword = null;
+      localConfiguration = null;
+      localProperties = null;
+      propertyFilelastMod = -1L;
+      propertyFilePath = null;
+      isInitialized = false;
+      alreadyClosed = false;
+    }
+  }
+  
   /** Initialize environment.
   */
   public static void initializeEnvironment()

Modified: incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/Base.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/Base.java?rev=1148443&r1=1148442&r2=1148443&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/Base.java
(original)
+++ incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/Base.java
Tue Jul 19 16:52:42 2011
@@ -137,6 +137,8 @@ public class Base
       logOutputFile.delete();
       configFile.delete();
       loggingFile.delete();
+      
+      ManifoldCF.resetEnvironment();
     }
   }
 

Modified: incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/BaseHSQLDB.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/BaseHSQLDB.java?rev=1148443&r1=1148442&r2=1148443&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/BaseHSQLDB.java
(original)
+++ incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/BaseHSQLDB.java
Tue Jul 19 16:52:42 2011
@@ -137,6 +137,8 @@ public class BaseHSQLDB
       logOutputFile.delete();
       configFile.delete();
       loggingFile.delete();
+      
+      ManifoldCF.resetEnvironment();
     }
   }
 

Modified: incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/BasePostgresql.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/BasePostgresql.java?rev=1148443&r1=1148442&r2=1148443&view=diff
==============================================================================
--- incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/BasePostgresql.java
(original)
+++ incubator/lcf/trunk/framework/core/src/test/java/org/apache/manifoldcf/core/tests/BasePostgresql.java
Tue Jul 19 16:52:42 2011
@@ -141,6 +141,8 @@ public class BasePostgresql
       logOutputFile.delete();
       configFile.delete();
       loggingFile.delete();
+      
+      ManifoldCF.resetEnvironment();
     }
   }
 



Mime
View raw message