directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r687505 - in /directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations: add/AddIT.java search/SearchIT.java
Date Wed, 20 Aug 2008 23:25:10 GMT
Author: elecharny
Date: Wed Aug 20 16:25:10 2008
New Revision: 687505

URL: http://svn.apache.org/viewvc?rev=687505&view=rev
Log:
o Moved a test from SearchITest to AddITest
o Modified the injected entries in SearchITest

Modified:
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java?rev=687505&r1=687504&r2=687505&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
Wed Aug 20 16:25:10 2008
@@ -670,4 +670,25 @@
 
         ctx.close();
     }
+
+
+    /**
+     * Test for DIRSERVER-1183.
+     * 
+     * @see https://issues.apache.org/jira/browse/DIRSERVER-1183
+     * @throws Exception
+     */
+    @Test
+    public void testDIRSERVER_1183() throws Exception
+    {
+        LdapContext ctx = ( LdapContext ) getWiredContext( ldapServer ).lookup( BASE );
+    	Attributes attrs = new AttributesImpl( "objectClass", "inetOrgPerson", true );
+    	attrs.get( "objectClass" ).add( "organizationalPerson" );
+    	attrs.get( "objectClass" ).add( "person" );
+    	attrs.put( "givenName", "Jim" );
+    	attrs.put( "sn", "Bean" );
+    	attrs.put( "cn", "\"Jim, Bean\"" );
+    	
+    	ctx.createSubcontext( "cn=\"Jim, Bean\"", attrs );
+    }
 }

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java?rev=687505&r1=687504&r2=687505&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java
Wed Aug 20 16:25:10 2008
@@ -144,8 +144,25 @@
     " NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2Nj/8AAEQgAAQABA\n" +
     " wEiAAIRAQMRAf/EABUAAQEAAAAAAAAAAAAAAAAAAAAF/8QAFBABAAAAAAAAAAAAAAAAAAAAAP/E\n" +
     " ABUBAQEAAAAAAAAAAAAAAAAAAAUG/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8\n" +
-    " AigC14//Z\n\n" 
+    " AigC14//Z\n\n" +
     
+    // Entry #5
+    "dn: cn=Janis Joplin,ou=system\n" +
+    "objectClass: person\n" +
+    "objectClass: organizationalPerson\n" +
+    "objectClass: inetOrgPerson\n" +
+    "objectClass: top\n" +
+    "objectClass: strongAuthenticationUser\n" +
+    "cn: Janis Joplin\n" +
+    "sn: Joplin\n" +
+    "userCertificate:: \n\n" +
+    
+    // Entry #6
+    "dn: cn=Kim Wilde,ou=system\n" +
+    "objectClass: person\n" +
+    "objectClass: top\n" +
+    "cn: Kim Wilde\n" +
+    "sn: Wilde\n\n"
     }
 )
 public class SearchIT 
@@ -664,24 +681,15 @@
     {
         LdapContext ctx = ( LdapContext ) getWiredContext( ldapServer ).lookup( BASE );
 
-        // Create entry
-        Attributes wilde = new AttributesImpl();
-        Attribute ocls = new AttributeImpl( "objectClass" );
-        ocls.add( "top" );
-        ocls.add( "person" );
-        wilde.put( ocls );
-        wilde.put( "cn", "Kim Wilde" );
-        wilde.put( "sn", "Wilde" );
-        String rdn = "cn=Kim Wilde";
-        ctx.createSubcontext( rdn, wilde );
-
         SearchControls ctls = new SearchControls();
         ctls.setSearchScope( SearchControls.OBJECT_SCOPE );
         ctls.setReturningAttributes( new String[]
             { "objectclass" } );
         String filter = "(objectclass=*)";
+        String rdn = "cn=Kim Wilde";
 
         NamingEnumeration<SearchResult> result = ctx.search( rdn, filter, ctls );
+        
         if ( result.hasMore() )
         {
             SearchResult entry = result.next();
@@ -1368,28 +1376,7 @@
 
         result.close();
     }
-    
-    
-    /**
-     * Test for DIRSERVER-1183.
-     * 
-     * @see https://issues.apache.org/jira/browse/DIRSERVER-1183
-     * @throws Exception
-     */
-    @Test
-    public void testDIRSERVER_1183() throws Exception
-    {
-        LdapContext ctx = ( LdapContext ) getWiredContext( ldapServer ).lookup( BASE );
-    	Attributes attrs = new AttributesImpl( "objectClass", "inetOrgPerson", true );
-    	attrs.get( "objectClass" ).add( "organizationalPerson" );
-    	attrs.get( "objectClass" ).add( "person" );
-    	attrs.put( "givenName", "Jim" );
-    	attrs.put( "sn", "Bean" );
-    	attrs.put( "cn", "\"Jim, Bean\"" );
-    	
-    	ctx.createSubcontext( "cn=\"Jim, Bean\"", attrs );
-    }
-    
+   
     
     /**
      * Test for DIRSERVER-1180 where search hangs when an invalid a substring 



Mime
View raw message