directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1344310 - /directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserTest.java
Date Wed, 30 May 2012 15:30:47 GMT
Author: elecharny
Date: Wed May 30 15:30:46 2012
New Revision: 1344310

URL: http://svn.apache.org/viewvc?rev=1344310&view=rev
Log:
Modified the test for completness

Modified:
    directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserTest.java

Modified: directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserTest.java?rev=1344310&r1=1344309&r2=1344310&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserTest.java
(original)
+++ directory/shared/trunk/ldap/model/src/test/java/org/apache/directory/shared/ldap/model/name/DnParserTest.java
Wed May 30 15:30:46 2012
@@ -618,10 +618,45 @@ public class DnParserTest
     @Test
     public final void testDIRAPI88()
     {
-        assertTrue( Dn.isValid( "workforceID=2#28" ) );
-        assertTrue( Dn.isValid( "workforceID=2# + a=b" ) );
-        assertTrue( Dn.isValid( "workforceID=2#2Z" ) );
-        assertTrue( Dn.isValid( "workforceID=2#2" ) );
-        assertTrue( Dn.isValid( "workforceID=2#ZZ" ) );
+        String[] values = new String[]
+            {
+                "200511230101#38SA",
+                "2#28",
+                "2#2Z",
+                "2#2",
+                "2#ZZ"
+            };
+        
+        for ( String value : values )
+        {
+            try
+            {
+                String dnStr = "workforceID=" + value;
+                assertTrue( Dn.isValid( dnStr ) );
+                
+                Dn dn = new Dn( dnStr );
+                Rdn rdn = dn.getRdn();
+                assertEquals( value, rdn.getValue().getString() );
+            }
+            catch ( Exception e )
+            {
+                fail();
+            }
+        }
+        
+        try
+        {
+            String dnStr = "workforceID=2# + a=b";
+            assertTrue( Dn.isValid( dnStr ) );
+            
+            Dn dn = new Dn( dnStr );
+            Rdn rdn = dn.getRdn();
+            assertEquals( "2#", rdn.getValue().getString() );
+        }
+        catch ( Exception e )
+        {
+            fail();
+        }
     }
+
 }



Mime
View raw message