directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r418588 - /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java
Date Sun, 02 Jul 2006 12:52:27 GMT
Author: elecharny
Date: Sun Jul  2 05:52:27 2006
New Revision: 418588

URL: http://svn.apache.org/viewvc?rev=418588&view=rev
Log:
Temporary files are now written in a directory which does not depend on the underlying OS

Modified:
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java

Modified: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java?rev=418588&r1=418587&r2=418588&view=diff
==============================================================================
--- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java
(original)
+++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java
Sun Jul  2 05:52:27 2006
@@ -28,9 +28,12 @@
 {
     private byte[] data;
 
+    private static File HJENSEN_JPEG_FILE = null;
+    private static File FIONA_JPEG_FILE = null;
+
     private File createFile( String name, byte[] data ) throws IOException
     {
-        File jpeg = new File( "/tmp/" + name );
+        File jpeg = File.createTempFile( name, "jpg" );
 
         jpeg.createNewFile();
 
@@ -60,8 +63,8 @@
             data[i] = (byte) i;
         }
 
-        createFile( "hjensen.jpg", data );
-        createFile( "fiona.jpg", data );
+        HJENSEN_JPEG_FILE = createFile( "hjensen", data );
+        FIONA_JPEG_FILE = createFile( "fiona", data );
     }
 
     public void testLdifNull() throws NamingException
@@ -911,7 +914,7 @@
             "sn: Jensen\n" + 
             "uid: hjensen\n" + 
             "telephonenumber: +1 408 555 1212\n" + 
-            "jpegphoto:< file:///tmp/hjensen.jpg";
+            "jpegphoto:< file:" + HJENSEN_JPEG_FILE.getAbsolutePath() + "\n";
 
         LdifReader reader = new LdifReader();
         List entries = reader.parseLdif( ldif );
@@ -976,7 +979,7 @@
             "sn: Jensen\n" + 
             "uid: hjensen\n" + 
             "telephonenumber: +1 408 555 1212\n" + 
-            "jpegphoto:< file:///tmp/hjensen.jpg";
+            "jpegphoto:< file:" + HJENSEN_JPEG_FILE.getAbsolutePath() + "\n";
 
         LdifReader reader = new LdifReader();
         reader.setSizeLimit( 128 );
@@ -1007,7 +1010,7 @@
             "sn: Jensen\n" +
             "uid: fiona\n" +
             "telephonenumber: +1 408 555 1212\n" +
-            "jpegphoto:< file:///tmp/fiona.jpg\n" +
+            "jpegphoto:< file:"  + FIONA_JPEG_FILE.getAbsolutePath() + "\n" +
             "\n" +
             // Second entry modification : DELETE
             "# Delete an existing entry\n" +



Mime
View raw message