directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r307412 - /directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/LdapNameTest.java
Date Sun, 09 Oct 2005 12:19:43 GMT
Author: elecharny
Date: Sun Oct  9 05:19:39 2005
New Revision: 307412

URL: http://svn.apache.org/viewcvs?rev=307412&view=rev
Log:
Added two tests

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

Modified: directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/LdapNameTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/LdapNameTest.java?rev=307412&r1=307411&r2=307412&view=diff
==============================================================================
--- directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/LdapNameTest.java
(original)
+++ directory/shared/ldap/trunk/common/src/test/org/apache/ldap/common/name/LdapNameTest.java
Sun Oct  9 05:19:39 2005
@@ -561,6 +561,7 @@
     {
         Name l_name = 
             m_parser.parse( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ) ;
+        
         assertEquals( "cn=HomeDir,cn=John,ou=Marketing,ou=East", 
             l_name.getPrefix( 0 ).toString() ) ;
         assertEquals( "cn=John,ou=Marketing,ou=East", 
@@ -573,6 +574,21 @@
             l_name.getPrefix( 4 ).toString() ) ;
     }
 
+    /**
+     * Class to test for getPrefix
+     * @throws Exception anything goes wrong
+     */
+    public void testGetPrefixModified()
+        throws Exception
+    {
+        Name l_name = 
+            m_parser.parse( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ) ;
+        
+        Name prefix = l_name.getPrefix( 1 );
+        
+        assertEquals( "ou=East", prefix );
+    }
+
 
     /**
      * Class to test for startsWith
@@ -696,6 +712,19 @@
         Name l_name0 = 
             m_parser.parse( "cn=HomeDir,cn=John,ou=Marketing,ou=East" ) ;
         assertTrue( l_name0.equals( l_name.addAll( l_name0 ) ) ) ;
+    }
+
+    /**
+     * Class to test for Name addAll(Name)
+     * @throws Exception when anything goes wrong
+     */
+    public void testAddAllNameExisting0()
+        throws Exception 
+    {
+        Name name1 = new LdapName( "ou=Marketing,ou=East" );
+        Name name2 = new LdapName( "cn=HomeDir,cn=John" );
+        Name nameAdded = new LdapName( "cn=HomeDir,cn=John, ou=Marketing,ou=East" );
+        assertTrue( nameAdded.equals( name1.addAll( name2 ) ) ) ;
     }
 
 



Mime
View raw message