Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 49001 invoked from network); 9 Oct 2005 12:20:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Oct 2005 12:20:05 -0000 Received: (qmail 63292 invoked by uid 500); 9 Oct 2005 12:20:05 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 63268 invoked by uid 500); 9 Oct 2005 12:20:05 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 63257 invoked by uid 99); 9 Oct 2005 12:20:05 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Oct 2005 05:20:05 -0700 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 09 Oct 2005 05:20:08 -0700 Received: (qmail 48707 invoked by uid 65534); 9 Oct 2005 12:19:44 -0000 Message-ID: <20051009121944.48706.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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 ) ) ) ; }