directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r504566 - /directory/apacheds/branches/1.0/core-unit/src/test/java/org/apache/directory/server/core/schema/SchemaServiceITest.java
Date Wed, 07 Feb 2007 14:41:37 GMT
Author: elecharny
Date: Wed Feb  7 06:41:36 2007
New Revision: 504566

URL: http://svn.apache.org/viewvc?view=rev&rev=504566
Log:
Test for DIRSERVER-844 has been added

Modified:
    directory/apacheds/branches/1.0/core-unit/src/test/java/org/apache/directory/server/core/schema/SchemaServiceITest.java

Modified: directory/apacheds/branches/1.0/core-unit/src/test/java/org/apache/directory/server/core/schema/SchemaServiceITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/1.0/core-unit/src/test/java/org/apache/directory/server/core/schema/SchemaServiceITest.java?view=diff&rev=504566&r1=504565&r2=504566
==============================================================================
--- directory/apacheds/branches/1.0/core-unit/src/test/java/org/apache/directory/server/core/schema/SchemaServiceITest.java
(original)
+++ directory/apacheds/branches/1.0/core-unit/src/test/java/org/apache/directory/server/core/schema/SchemaServiceITest.java
Wed Feb  7 06:41:36 2007
@@ -114,6 +114,43 @@
         assertTrue( ocs.contains( "inetOrgPerson" ) );
     }
 
+    /**
+     * Test for DIRSERVER-844: storing of base 64 encoded values into H-R attributes 
+     *
+     * @throws NamingException
+     */
+    public void testSearchSeeAlso() throws NamingException
+    {
+        SearchControls controls = new SearchControls();
+        controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
+        Map persons = new HashMap();
+        NamingEnumeration results = sysRoot.search( "", "(seeAlso=cn=Good One,ou=people,o=sevenSeas)",
controls );
+
+        while ( results.hasMore() )
+        {
+            SearchResult result = ( SearchResult ) results.next();
+            persons.put( result.getName(), result.getAttributes() );
+        }
+
+        // admin is extra
+        assertEquals( 1, persons.size() );
+
+        Attributes person = null;
+        Attribute ocs = null;
+
+        person = ( Attributes ) persons.get( "cn=person1,ou=system" );
+        assertNotNull( person );
+        ocs = person.get( "objectClass" );
+        assertEquals( 3, ocs.size() );
+        assertTrue( ocs.contains( "top" ) );
+        assertTrue( ocs.contains( "person" ) );
+        assertTrue( ocs.contains( "organizationalPerson" ) );
+        
+        Attribute seeAlso = person.get(  "seeAlso"  );
+        assertTrue( seeAlso.contains( "cn=Good One,ou=people,o=sevenSeas" ) );
+        assertTrue( seeAlso.contains( "cn=Bad E\u00e9k\u00e0,ou=people,o=sevenSeas" ) );
+    }
+
 
     public void testSearchForOrgPerson() throws NamingException
     {



Mime
View raw message