directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r771374 - /directory/apacheds/trunk/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java
Date Mon, 04 May 2009 17:36:55 GMT
Author: elecharny
Date: Mon May  4 17:36:55 2009
New Revision: 771374

URL: http://svn.apache.org/viewvc?rev=771374&view=rev
Log:
Fixed a failing test on windows by checking that a /tmp directory exist on the machine before
launching the test

Modified:
    directory/apacheds/trunk/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java

Modified: directory/apacheds/trunk/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java?rev=771374&r1=771373&r2=771374&view=diff
==============================================================================
--- directory/apacheds/trunk/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java
(original)
+++ directory/apacheds/trunk/server-xml/src/test/java/org/apache/directory/server/SpringServerTest.java
Mon May  4 17:36:55 2009
@@ -171,30 +171,38 @@
      */
     @Test
     public void testSpringServerJdbmPartition() throws Exception {
-        ClassLoader classLoader = this.getClass().getClassLoader();
-        URL configURL = classLoader.getResource( "serverJdbmPartition.xml" );
-
-        File configF = new File( configURL.toURI() );
-        ApplicationContext factory = new FileSystemXmlApplicationContext( configF.toURI().toURL().toString()
);
-        ApacheDS apacheDS = ( ApacheDS ) factory.getBean( "apacheDS" );
-        File workingDirFile = new File( configF.getParentFile(), "work" );
-        apacheDS.getDirectoryService().setWorkingDirectory( workingDirFile );
-        
-        // Now, launch the server, and check that the ObjectClass index has been created
in OS' tmp directory
-        apacheDS.startup();
-        
-        File tmpOCdb = new File( getTmpDir(), "objectClass.db" );
-        assertTrue( tmpOCdb.exists() );
-
-        File tmpOClg = new File( getTmpDir(), "objectClass.lg" );
-        assertTrue( tmpOClg.exists() );
-        
-        // Shutdown and cleanup
-        apacheDS.shutdown();
-        
-        // Clean the /tmp/objectClass.* files
-        tmpOCdb.delete();
-        tmpOClg.delete();
+    	// NOTE : This test will only work on systems which have a /tmp temp dir
+    	if ( "/tmp".equals( getTmpDir() ) )
+    	{
+	        ClassLoader classLoader = this.getClass().getClassLoader();
+	        URL configURL = classLoader.getResource( "serverJdbmPartition.xml" );
+	
+	        File configF = new File( configURL.toURI() );
+	        ApplicationContext factory = new FileSystemXmlApplicationContext( configF.toURI().toURL().toString()
);
+	        ApacheDS apacheDS = ( ApacheDS ) factory.getBean( "apacheDS" );
+	        File workingDirFile = new File( configF.getParentFile(), "work" );
+	        apacheDS.getDirectoryService().setWorkingDirectory( workingDirFile );
+	        
+	        // Now, launch the server, and check that the ObjectClass index has been created
in OS' tmp directory
+	        apacheDS.startup();
+	        
+	        File tmpOCdb = new File( getTmpDir(), "objectClass.db" );
+	        assertTrue( tmpOCdb.exists() );
+	
+	        File tmpOClg = new File( getTmpDir(), "objectClass.lg" );
+	        assertTrue( tmpOClg.exists() );
+	        
+	        // Shutdown and cleanup
+	        apacheDS.shutdown();
+	        
+	        // Clean the /tmp/objectClass.* files
+	        tmpOCdb.delete();
+	        tmpOClg.delete();
+    	}
+    	else
+    	{
+    		assertTrue( true );
+    	}
     }
     
     /**



Mime
View raw message