directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1414743 - /directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupIT.java
Date Wed, 28 Nov 2012 15:04:46 GMT
Author: elecharny
Date: Wed Nov 28 15:04:45 2012
New Revision: 1414743

URL: http://svn.apache.org/viewvc?rev=1414743&view=rev
Log:
Added a test

Modified:
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupIT.java

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupIT.java?rev=1414743&r1=1414742&r2=1414743&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/lookup/LookupIT.java
Wed Nov 28 15:04:45 2012
@@ -22,6 +22,7 @@ package org.apache.directory.server.oper
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
 import org.apache.directory.junit.tools.MultiThreadedMultiInvoker;
@@ -31,7 +32,9 @@ import org.apache.directory.server.annot
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.integ.ServerIntegrationUtils;
+import org.apache.directory.shared.ldap.model.cursor.EntryCursor;
 import org.apache.directory.shared.ldap.model.entry.Entry;
+import org.apache.directory.shared.ldap.model.message.SearchScope;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -51,12 +54,13 @@ public class LookupIT extends AbstractLd
     public MultiThreadedMultiInvoker i = new MultiThreadedMultiInvoker( MultiThreadedMultiInvoker.NOT_THREADSAFE
);
 
     /**
-     * Evaluate the lookup operation when using a inherited Attribute
+     * Fetch an existing entry
      */
     @Test
-    public void testLookupPerfAPI() throws Exception
+    public void testLookupExistingEntryAPI() throws Exception
     {
         LdapConnection connection = ServerIntegrationUtils.getAdminConnection( getLdapServer()
);
+        connection.setTimeOut( 0L );
 
         Entry entry = connection.lookup( "uid=admin,ou=system", "name" );
         assertNotNull( entry );
@@ -68,4 +72,18 @@ public class LookupIT extends AbstractLd
 
         connection.close();
     }
+
+    /**
+     * Fetch a non existing entry
+     */
+    @Test
+    public void testLookupNonExistingEntryAPI() throws Exception
+    {
+        LdapConnection connection = ServerIntegrationUtils.getAdminConnection( getLdapServer()
);
+
+        Entry entry = connection.lookup( "uid=absent,ou=system", "name" );
+        assertNull( entry );
+
+        connection.close();
+    }
 }



Mime
View raw message