directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r437143 - /directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java
Date Sat, 26 Aug 2006 11:00:12 GMT
Author: elecharny
Date: Sat Aug 26 04:00:11 2006
New Revision: 437143

URL: http://svn.apache.org/viewvc?rev=437143&view=rev
Log:
Merged from 1.0 : check the default value of version if "version :" is not present

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=437143&r1=437142&r2=437143&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
Sat Aug 26 04:00:11 2006
@@ -148,6 +148,27 @@
     }
 
     /**
+     * Test the ldif parser with a file without a version. It should default to 1
+     * @throws NamingException
+     */
+    public void testLdifWithoutVersion() throws NamingException
+    {
+        String ldif = 
+            "#Comment 1\r" + 
+            "#\r" + 
+            " th\n" + 
+            " is is still a comment\n" + 
+            "\n" + 
+            "# end";
+
+        LdifReader reader = new LdifReader();
+        List entries = reader.parseLdif( ldif );
+
+        assertEquals( 0, entries.size() );
+        assertEquals( 1, reader.getVersion() );
+    }
+
+    /**
      * Spaces at the end of values should not be included into values.
      * 
      * @throws NamingException



Mime
View raw message