geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r1023013 - in /geronimo/server/trunk: framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/ framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/ framework/modules/geronimo-kernel/...
Date Fri, 15 Oct 2010 16:48:51 GMT
Author: rickmcguire
Date: Fri Oct 15 16:48:50 2010
New Revision: 1023013

URL: http://svn.apache.org/viewvc?rev=1023013&view=rev
Log:
reduce the number of directories left in the temp dir after a deploy

Modified:
    geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
    geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockConfigStore.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java

Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java?rev=1023013&r1=1023012&r2=1023013&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/Deployer.java
Fri Oct 15 16:48:50 2010
@@ -326,7 +326,7 @@ public class Deployer implements GBeanLi
             DeploymentContext context) throws DeploymentException, IOException, Throwable
{
         List<ConfigurationData> configurationDatas = new ArrayList<ConfigurationData>();
 
-        boolean configsCleanupRequired = false;
+        boolean configsCleanupRequired = true;
 
         // Set TCCL to the classloader for the configuration being deployed
         // so that any static blocks invoked during the loading of classes

Modified: geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java?rev=1023013&r1=1023012&r2=1023013&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-deployment/src/test/java/org/apache/geronimo/deployment/SingleFileHotDeployerTest.java
Fri Oct 15 16:48:50 2010
@@ -105,6 +105,11 @@ public class SingleFileHotDeployerTest e
         configurationManager = new MockConfigurationManager();
     }
 
+    protected void tearDown() throws Exception {
+        store.cleanup(); 
+        super.tearDown();
+    }
+
     private void touch(File file, long lastModified) throws IOException {
         file.createNewFile();
         file.setLastModified(lastModified);

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java?rev=1023013&r1=1023012&r2=1023013&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java
Fri Oct 15 16:48:50 2010
@@ -749,6 +749,7 @@ public class ConfigurationManagerTest ex
 
     protected void tearDown() throws Exception {
         kernel.shutdown();
+        ((MockConfigStore)configStore).cleanup(); 
         super.tearDown();
     }
 

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockConfigStore.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockConfigStore.java?rev=1023013&r1=1023012&r2=1023013&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockConfigStore.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/test/java/org/apache/geronimo/kernel/mock/MockConfigStore.java
Fri Oct 15 16:48:50 2010
@@ -20,9 +20,11 @@ import java.io.File;
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
+import java.util.List; 
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
@@ -48,6 +50,8 @@ public class MockConfigStore
 
     protected final Map<Artifact, File> locations = new HashMap<Artifact, File>();
     private Map<Artifact, ConfigurationData> configs = new HashMap<Artifact, ConfigurationData>();
+    private List<File> createdLocations = new ArrayList<File>(); 
+    
 
     public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException
{
         configs.put(configurationData.getId(), configurationData);
@@ -76,6 +80,7 @@ public class MockConfigStore
         try {
             File file = createTempDir();
             locations.put(configId, file);
+            createdLocations.add(file); 
             return file;
         } catch (IOException e) {
             return null;
@@ -96,9 +101,20 @@ public class MockConfigStore
         }
         locations.put(configId, file);
     }
+    
+    /**
+     * Attempt to cleanup and temp directories associated with 
+     * this Mock config store. 
+     */
+    public void cleanup() {
+        for (File file: createdLocations) {
+            FileUtils.recursiveDelete(file);
+        }
+        createdLocations.clear(); 
+    }
 
     private static File createTempDir() throws IOException {
-        File tempDir = File.createTempFile("geronimo-deploymentUtil", ".tmpdir");
+        File tempDir = File.createTempFile("mock-geronimo-deploymentUtil", ".tmpdir");
         tempDir.delete();
         tempDir.mkdirs();
         return tempDir;

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?rev=1023013&r1=1023012&r2=1023013&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
Fri Oct 15 16:48:50 2010
@@ -726,6 +726,7 @@ public class ConnectorModuleBuilderTest 
 
     protected void tearDown() throws Exception {
         kernel.shutdown();
+        ((MockConfigStore)configurationStore).cleanup(); 
         super.tearDown();
     }
 

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java?rev=1023013&r1=1023012&r2=1023013&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java
Fri Oct 15 16:48:50 2010
@@ -100,6 +100,11 @@ public class MessageDestinationTest exte
         baseName = naming.createRootName(configuration.getId(), "testRoot", NameFactory.RESOURCE_ADAPTER_MODULE);
     }
 
+    protected void tearDown() throws Exception {
+        configStore.cleanup(); 
+        super.tearDown();
+    }
+
     private static final String SPECDD1 = "<web-app xmlns=\"http://java.sun.com/xml/ns/j2ee\">"
+
             "<message-destination><message-destination-name>d1</message-destination-name></message-destination>"
+
             "<message-destination><message-destination-name>d2</message-destination-name></message-destination>"
+

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java?rev=1023013&r1=1023012&r2=1023013&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java
Fri Oct 15 16:48:50 2010
@@ -145,6 +145,11 @@ public abstract class EARConfigBuilderTe
         defaultParentId.addDependency(new Artifact("org.apache.geronimo.tests", "test", "1",
"car"), ImportType.ALL);
     }
 
+    protected void tearDown() throws Exception {
+        configStore.cleanup(); 
+        super.tearDown();
+    }
+
     public void testBuildConfiguration() throws Exception {
         ConfigurationData configurationData = null;
         DeploymentContext context = null;



Mime
View raw message