directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r504863 - /directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/SchemaServiceITest.java
Date Thu, 08 Feb 2007 11:39:16 GMT
Author: elecharny
Date: Thu Feb  8 03:39:16 2007
New Revision: 504863

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

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

Modified: directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/SchemaServiceITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/SchemaServiceITest.java?view=diff&rev=504863&r1=504862&r2=504863
==============================================================================
--- directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/SchemaServiceITest.java
(original)
+++ directory/apacheds/trunk/core-unit/src/test/java/org/apache/directory/server/core/schema/SchemaServiceITest.java
Thu Feb  8 03:39:16 2007
@@ -469,4 +469,42 @@
         // We should have no entry in the result
         assertEquals( 0, subSchemaEntry.size() );
     }
+    
+    /**
+     * 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" ) );
+    }
+
 }



Mime
View raw message