Author: rmannibucau
Date: Sat Aug 30 18:51:20 2014
New Revision: 1621517

URL: http://svn.apache.org/r1621517
Log:
ensure we cleanup deployments.xml to not create any side effect on other tests

Modified:
    
tomee/tomee/trunk/container/openejb-core/src/test/java/org/apache/openejb/assembler/DeployerEjbTest.java

Modified: 
tomee/tomee/trunk/container/openejb-core/src/test/java/org/apache/openejb/assembler/DeployerEjbTest.java
URL: 
http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/test/java/org/apache/openejb/assembler/DeployerEjbTest.java?rev=1621517&r1=1621516&r2=1621517&view=diff
==============================================================================
--- 
tomee/tomee/trunk/container/openejb-core/src/test/java/org/apache/openejb/assembler/DeployerEjbTest.java
 (original)
+++ 
tomee/tomee/trunk/container/openejb-core/src/test/java/org/apache/openejb/assembler/DeployerEjbTest.java
 Sat Aug 30 18:51:20 2014
@@ -83,17 +83,22 @@ public class DeployerEjbTest {
 
     @Before
     public void before() throws Exception {
+        removeDeployments();
+        System.setProperty(OPENEJB_DEPLOYER_SAVE_DEPLOYMENTS, 
Boolean.TRUE.toString());
+    }
+
+    private void removeDeployments() throws IOException {
         final File deployments = new 
File(SystemInstance.get().getBase().getDirectory("conf", false), 
"deployments.xml");
         if (deployments.exists()) {
             Files.delete(deployments);
         }
-        System.setProperty(OPENEJB_DEPLOYER_SAVE_DEPLOYMENTS, 
Boolean.TRUE.toString());
     }
 
     @After
     public void after() throws Exception {
         System.setProperty(OPENEJB_DEPLOYER_SAVE_DEPLOYMENTS, 
Boolean.FALSE.toString());
         OpenEJB.destroy();
+        removeDeployments();
     }
 
     private Deployer getDeployer() throws NamingException {


Reply via email to