directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r601115 - 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/
Date Tue, 04 Dec 2007 22:19:27 GMT
Author: akarasulu
Date: Tue Dec  4 14:19:26 2007
New Revision: 601115

URL: http://svn.apache.org/viewvc?rev=601115&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/UniqueMemberIT.java
      - copied, changed from r601108, directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberITest.java
Removed:
    directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberITest.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=601115&r1=601114&r2=601115&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 14:19:26 2007
@@ -59,6 +59,7 @@
         RFC2713IT.class,
         RootDSEIT.class,
         SearchContextIT.class,
+        UniqueMemberIT.class,
         PartitionConfigurationIT.class  // Leaves the server in a bad state (partition removal
is incomplete)
         } )
 @Scope ( ServiceScope.TESTSUITE )

Copied: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberIT.java
(from r601108, directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberITest.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberIT.java?p2=directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberIT.java&p1=directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberITest.java&r1=601108&r2=601115&rev=601115&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberITest.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/UniqueMemberIT.java
Tue Dec  4 14:19:26 2007
@@ -20,22 +20,27 @@
 package org.apache.directory.server.core.jndi;
 
 
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.directory.server.core.unit.AbstractAdminTestCase;
+import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.integ.CiRunner;
+import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
 import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
+import org.apache.directory.shared.ldap.message.AliasDerefMode;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
-import org.apache.directory.shared.ldap.message.AliasDerefMode;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
-import javax.naming.directory.Attributes;
 import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
+import javax.naming.ldap.LdapContext;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
 
 
 /**
@@ -45,19 +50,22 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class UniqueMemberITest extends AbstractAdminTestCase
+@RunWith ( CiRunner.class )
+public class UniqueMemberIT
 {
-    protected void setUp() throws Exception
-    {
-        super.setUp();
-    }
+    public static DirectoryService service;
 
     
     /**
      * Test a valid entry
+     *
+     * @throws Exception on error
      */
+    @Test
     public void testValidUniqueMember() throws Exception
     {
+        LdapContext sysRoot = getSystemContext( service );
+
         Attributes attrs = new AttributesImpl( true );
         Attribute oc = new AttributeImpl( "ObjectClass", "top" );
         oc.add( "groupOfUniqueNames" );
@@ -115,16 +123,21 @@
             if ( attr.getID().equalsIgnoreCase( "uniqueMember" ) )
             {
                 assertEquals( "cn=kevin spacey, dc=example, dc=org", attr.get() );
-                continue;
             }
         }
     }
 
+
     /**
      * Test a valid entry, with an optional UID
+     *
+     * @throws Exception on error
      */
+    @Test
     public void testValidUniqueMemberWithOptionnalUID() throws Exception
     {
+        LdapContext sysRoot = getSystemContext( service );
+
         Attributes attrs = new AttributesImpl( true );
         Attribute oc = new AttributeImpl( "ObjectClass", "top" );
         oc.add( "groupOfUniqueNames" );
@@ -182,16 +195,21 @@
             if ( attr.getID().equalsIgnoreCase( "uniqueMember" ) )
             {
                 assertEquals( "cn=kevin spacey 2, dc=example, dc=org#'010101'B", attr.get()
);
-                continue;
             }
         }
     }
 
+
     /**
      * Test a valid entry, with an optional UID
+     *
+     * @throws Exception on error
      */
+    @Test
     public void testInvalidUniqueMemberBadDN() throws Exception
     {
+        LdapContext sysRoot = getSystemContext( service );
+
         Attributes attrs = new AttributesImpl( true );
         Attribute oc = new AttributeImpl( "ObjectClass", "top" );
         oc.add( "groupOfUniqueNames" );
@@ -215,11 +233,17 @@
         }
     }
 
+
     /**
      * Test a valid entry, with an optional UID
+     *
+     * @throws Exception on error
      */
+    @Test
     public void testInvalidUniqueMemberBadUID() throws Exception
     {
+        LdapContext sysRoot = getSystemContext( service );
+
         Attributes attrs = new AttributesImpl( true );
         Attribute oc = new AttributeImpl( "ObjectClass", "top" );
         oc.add( "groupOfUniqueNames" );
@@ -243,8 +267,12 @@
         }
     }
     
+
+    @Test
     public void testSearchUniqueMemberFilter() throws NamingException
     {
+        LdapContext sysRoot = getSystemContext( service );
+
         Attributes attrs = new AttributesImpl( true );
         Attribute oc = new AttributeImpl( "ObjectClass", "top" );
         oc.add( "groupOfUniqueNames" );
@@ -291,8 +319,12 @@
         assertNotNull( attrs.get( "uniqueMember" ) );
     }
 
+
+    @Test
     public void testSearchUniqueMemberFilterWithSpaces() throws NamingException
     {
+        LdapContext sysRoot = getSystemContext( service );
+
         Attributes attrs = new AttributesImpl( true );
         Attribute oc = new AttributeImpl( "ObjectClass", "top" );
         oc.add( "groupOfUniqueNames" );
@@ -339,8 +371,12 @@
         assertNotNull( attrs.get( "uniqueMember" ) );
     }
 
+
+    @Test
     public void testSearchUniqueMemberFilterWithBadDN() throws NamingException
     {
+        LdapContext sysRoot = getSystemContext( service );
+
         Attributes attrs = new AttributesImpl( true );
         Attribute oc = new AttributeImpl( "ObjectClass", "top" );
         oc.add( "groupOfUniqueNames" );
@@ -374,8 +410,12 @@
         assertFalse( list.hasMore() );
     }
 
+
+    @Test
     public void testSearchUniqueMemberFilterWithUID() throws NamingException
     {
+        LdapContext sysRoot = getSystemContext( service );
+
         Attributes attrs = new AttributesImpl( true );
         Attribute oc = new AttributeImpl( "ObjectClass", "top" );
         oc.add( "groupOfUniqueNames" );



Mime
View raw message