You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2009/08/13 09:33:08 UTC

svn commit: r803800 - /directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java

Author: elecharny
Date: Thu Aug 13 07:33:08 2009
New Revision: 803800

URL: http://svn.apache.org/viewvc?rev=803800&view=rev
Log:
Added a test for getRdn( int )

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

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java?rev=803800&r1=803799&r2=803800&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/name/LdapDNTest.java Thu Aug 13 07:33:08 2009
@@ -2003,10 +2003,7 @@
 
 
     /**
-     * Class to test for get
-     *
-     * @throws Exception
-     *             anything goes wrong
+     * Test the get( int ) method
      */
     @Test
     public void testGet() throws Exception
@@ -2020,6 +2017,19 @@
 
 
     /**
+     * Test the getRdn( int ) method
+     */
+    @Test
+    public void testGetRdn() throws Exception
+    {
+        LdapDN name = new LdapDN( "cn=HomeDir,cn=John,ou=Marketing,ou=East" );
+        assertEquals( "cn=HomeDir", name.getRdn( 3 ).getUpName() );
+        assertEquals( "cn=John", name.getRdn( 2 ).getUpName() );
+        assertEquals( "ou=Marketing", name.getRdn( 1 ).getUpName() );
+        assertEquals( "ou=East", name.getRdn( 0 ).getUpName() );
+    }
+
+    /**
      * Class to test for getSuffix
      *
      * @throws Exception