You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2011/10/20 23:55:42 UTC

svn commit: r1187078 - /openejb/trunk/openejb/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java

Author: rmannibucau
Date: Thu Oct 20 21:55:41 2011
New Revision: 1187078

URL: http://svn.apache.org/viewvc?rev=1187078&view=rev
Log:
trying to delete the files created for TCKs

Modified:
    openejb/trunk/openejb/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java

Modified: openejb/trunk/openejb/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java?rev=1187078&r1=1187077&r2=1187078&view=diff
==============================================================================
--- openejb/trunk/openejb/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java (original)
+++ openejb/trunk/openejb/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java Thu Oct 20 21:55:41 2011
@@ -30,7 +30,6 @@ import javax.naming.InitialContext;
 import org.apache.openejb.assembler.Deployer;
 import org.apache.openejb.assembler.classic.AppInfo;
 import org.apache.openejb.client.RemoteInitialContextFactory;
-import org.apache.openejb.config.Deploy;
 import org.apache.openejb.config.RemoteServer;
 import org.apache.openejb.config.ValidationException;
 import org.apache.openejb.loader.Options;
@@ -47,6 +46,7 @@ public class ContainersImplTomEE impleme
     private static final String tmpDir = System.getProperty("java.io.tmpdir");
     private Exception exception;
     private AppInfo appInfo;
+    private File currentFile = null;
 
     private Deployer lookup() {
         final Options options = new Options(System.getProperties());
@@ -76,14 +76,14 @@ public class ContainersImplTomEE impleme
 
         System.out.println("Deploying " + archive + " with name " + name);
 
-        File fileName = getFile(name);
-        System.out.println(fileName);
-        writeToFile(fileName, archive);
+        currentFile = getFile(name);
+        System.out.println(currentFile);
+        writeToFile(currentFile, archive);
         try {
             if (deployer == null) {
                 deployer = lookup();
             }
-            appInfo = deployer.deploy(fileName.getAbsolutePath());
+            appInfo = deployer.deploy(currentFile.getAbsolutePath());
         } catch (Exception ex) {
             Exception e = ex;
             if (e.getCause() instanceof ValidationException) {
@@ -153,6 +153,12 @@ public class ContainersImplTomEE impleme
             e.printStackTrace();
             throw new RuntimeException(e);
         }
+
+        if (currentFile != null && currentFile.exists()) {
+            if (!currentFile.delete()) {
+                currentFile.deleteOnExit();
+            }
+        }
     }
     @Override
     public void setup() throws IOException {