directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1404149 - /directory/apacheds/trunk/service/src/test/java/org/apache/directory/server/UberJarMainTest.java
Date Wed, 31 Oct 2012 14:12:37 GMT
Author: kayyagari
Date: Wed Oct 31 14:12:37 2012
New Revision: 1404149

URL: http://svn.apache.org/viewvc?rev=1404149&view=rev
Log:
delete the work dir after running the test

Modified:
    directory/apacheds/trunk/service/src/test/java/org/apache/directory/server/UberJarMainTest.java

Modified: directory/apacheds/trunk/service/src/test/java/org/apache/directory/server/UberJarMainTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/service/src/test/java/org/apache/directory/server/UberJarMainTest.java?rev=1404149&r1=1404148&r2=1404149&view=diff
==============================================================================
--- directory/apacheds/trunk/service/src/test/java/org/apache/directory/server/UberJarMainTest.java
(original)
+++ directory/apacheds/trunk/service/src/test/java/org/apache/directory/server/UberJarMainTest.java
Wed Oct 31 14:12:37 2012
@@ -25,6 +25,7 @@ import static org.junit.Assert.fail;
 import java.io.File;
 import java.util.Calendar;
 
+import org.apache.commons.io.FileUtils;
 import org.apache.directory.ldap.client.api.LdapConnectionConfig;
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
 import org.apache.directory.server.constants.ServerDNConstants;
@@ -32,6 +33,8 @@ import org.apache.directory.server.core.
 import org.apache.directory.shared.ldap.codec.api.SchemaBinaryAttributeDetector;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.name.Dn;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Test;
 
 
@@ -45,6 +48,32 @@ public class UberJarMainTest
     /** Flag used by connection verification thread */
     private boolean verified = true;
 
+    private File instanceDirectory;
+    
+    @Before
+    public void create()
+    {
+        // Getting tmp directory
+        File tmpDirectory = new File( System.getProperty( "java.io.tmpdir" ) );
+
+        // Creating an instance directory
+        Calendar calendar = Calendar.getInstance();
+        instanceDirectory = new File( tmpDirectory, "ApacheDS-" + calendar.get( Calendar.YEAR
)
+            + calendar.get( Calendar.MONTH ) + calendar.get( Calendar.DATE ) + calendar.get(
Calendar.HOUR )
+            + calendar.get( Calendar.MINUTE ) + calendar.get( Calendar.SECOND ) );
+        instanceDirectory.mkdir();
+    }
+
+    
+    @After
+    public void delete() throws Exception
+    {
+        if( instanceDirectory != null )
+        {
+            FileUtils.deleteDirectory( instanceDirectory );
+        }
+    }
+
 
     /**
      * Tests the creation of a new ApacheDS Service instance.



Mime
View raw message