You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2007/12/04 21:42:08 UTC
svn commit: r601078 - in /directory/apacheds/branches/bigbang:
core-integ/src/test/java/org/apache/directory/server/core/
core-integ/src/test/java/org/apache/directory/server/core/jndi/
core-unit/src/test/java/org/apache/directory/server/core/jndi/
Author: akarasulu
Date: Tue Dec 4 12:42:08 2007
New Revision: 601078
URL: http://svn.apache.org/viewvc?rev=601078&view=rev
Log:
converted another test to use with new framework
Added:
directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/ListAsAdminIT.java
- copied, changed from r600818, directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/ListAsAdminITest.java
Removed:
directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/ListAsAdminITest.java
Modified:
directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/StockCoreISuite.java
Modified: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/StockCoreISuite.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/StockCoreISuite.java?rev=601078&r1=601077&r2=601078&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/StockCoreISuite.java (original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/StockCoreISuite.java Tue Dec 4 12:42:08 2007
@@ -52,6 +52,7 @@
DIRSERVER759IT.class,
DIRSERVER783IT.class,
DIRSERVER791IT.class,
+ ListAsAdminIT.class,
ExtensibleObjectIT.class,
PartitionConfigurationIT.class // Leaves the server in a bad state (partition removal is incomplete)
} )
Copied: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/ListAsAdminIT.java (from r600818, directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/ListAsAdminITest.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/ListAsAdminIT.java?p2=directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/ListAsAdminIT.java&p1=directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/ListAsAdminITest.java&r1=600818&r2=601078&rev=601078&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/ListAsAdminITest.java (original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/ListAsAdminIT.java Tue Dec 4 12:42:08 2007
@@ -20,13 +20,19 @@
package org.apache.directory.server.core.jndi;
-import java.util.HashSet;
+import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.integ.CiRunner;
+import static org.apache.directory.server.core.integ.IntegrationUtils.*;
+import org.apache.directory.shared.ldap.ldif.Entry;
+import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+import org.junit.runner.RunWith;
import javax.naming.NameClassPair;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
-
-import org.apache.directory.server.core.unit.AbstractAdminTestCase;
+import javax.naming.ldap.LdapContext;
+import java.util.HashSet;
/**
@@ -37,39 +43,43 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public class ListAsAdminITest extends AbstractAdminTestCase
+@RunWith ( CiRunner.class )
+public class ListAsAdminIT
{
+ public static DirectoryService service;
+
+
+ @Test
public void testListSystemAsAdmin() throws NamingException
{
+ LdapContext sysRoot = getSystemContext( service );
HashSet<String> set = new HashSet<String>();
-
NamingEnumeration list = sysRoot.list( "" );
while ( list.hasMore() )
{
NameClassPair ncp = ( NameClassPair ) list.next();
-
set.add( ncp.getName() );
}
assertTrue( set.contains( "uid=admin,ou=system" ) );
-
assertTrue( set.contains( "ou=users,ou=system" ) );
-
assertTrue( set.contains( "ou=groups,ou=system" ) );
}
+ @Test
public void testListUsersAsAdmin() throws NamingException
{
+ LdapContext sysRoot = getSystemContext( service );
HashSet<String> set = new HashSet<String>();
+ Entry akarasulu = getUserAddLdif();
+ getRootContext( service ).createSubcontext( akarasulu.getDn(), akarasulu.getAttributes() );
NamingEnumeration list = sysRoot.list( "ou=users" );
-
while ( list.hasMore() )
{
NameClassPair ncp = ( NameClassPair ) list.next();
-
set.add( ncp.getName() );
}