directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r437142 - /directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java
Date Sat, 26 Aug 2006 10:58:48 GMT
Author: elecharny
Date: Sat Aug 26 03:58:46 2006
New Revision: 437142

URL: http://svn.apache.org/viewvc?rev=437142&view=rev
Log:
Added a test to check that if "version:" tag is absent,
then the version still default to 1.

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

Modified: directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java
URL: http://svn.apache.org/viewvc/directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java?rev=437142&r1=437141&r2=437142&view=diff
==============================================================================
--- directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java
(original)
+++ directory/branches/shared/0.9.5/ldap/src/test/java/org/apache/directory/shared/ldap/ldif/LdifReaderTest.java
Sat Aug 26 03:58:46 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