directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r601088 - 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 21:24:35 GMT
Author: akarasulu
Date: Tue Dec  4 13:24:35 2007
New Revision: 601088

URL: http://svn.apache.org/viewvc?rev=601088&view=rev
Log:
converted two more tests to the new framework

Added:
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/RFC2713IT.java
      - copied, changed from r600818, directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/RFC2713ITest.java
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java
      - copied, changed from r600818, directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/RootDSEITest.java
Removed:
    directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/RFC2713ITest.java
    directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/RootDSEITest.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=601088&r1=601087&r2=601088&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 13:24:35 2007
@@ -56,6 +56,8 @@
         ObjStateFactoryIT.class,
         ExtensibleObjectIT.class,
         ModifyContextIT.class,
+        RFC2713IT.class,
+        RootDSEIT.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/RFC2713IT.java
(from r600818, directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/RFC2713ITest.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/RFC2713IT.java?p2=directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/RFC2713IT.java&p1=directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/RFC2713ITest.java&r1=600818&r2=601088&rev=601088&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/RFC2713ITest.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/RFC2713IT.java
Tue Dec  4 13:24:35 2007
@@ -20,12 +20,17 @@
 package org.apache.directory.server.core.jndi;
 
 
-import java.util.ArrayList;
+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 static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
-
-import org.apache.directory.server.core.unit.AbstractAdminTestCase;
+import javax.naming.ldap.LdapContext;
+import java.util.ArrayList;
 
 
 /**
@@ -35,17 +40,23 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class RFC2713ITest extends AbstractAdminTestCase
+@RunWith ( CiRunner.class )
+public class RFC2713IT
 {
+    public static DirectoryService service;
+    
+
+    @Test
     @SuppressWarnings("unchecked")
-    public void testSerialization() throws Exception
+    public void testSerializatin() throws Exception
     {
+        LdapContext sysRoot = getSystemContext( service );
+
         ArrayList<String> colors = new ArrayList<String>();
         colors.add( "red" );
         colors.add( "white" );
         colors.add( "blue" );
         sysRoot.bind( "cn=colors", colors );
-        colors = null;
 
         Object obj = sysRoot.lookup( "cn=colors" );
         assertTrue( obj instanceof ArrayList );

Copied: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java
(from r600818, directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/RootDSEITest.java)
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java?p2=directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java&p1=directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/RootDSEITest.java&r1=600818&r2=601088&rev=601088&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/jndi/RootDSEITest.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/jndi/RootDSEIT.java
Tue Dec  4 13:24:35 2007
@@ -20,14 +20,14 @@
 package org.apache.directory.server.core.jndi;
 
 
-import junit.framework.TestCase;
-import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.integ.CiRunner;
 import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
 
 import javax.naming.Context;
 import javax.naming.InitialContext;
@@ -35,7 +35,6 @@
 import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
 import java.io.File;
-import java.io.IOException;
 import java.util.Hashtable;
 
 
@@ -45,51 +44,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class RootDSEITest extends TestCase
+@RunWith ( CiRunner.class )
+public class RootDSEIT
 {
-    private static final Logger LOG = LoggerFactory.getLogger( RootDSEITest.class );
-    /** flag whether to delete database files for each test or not */
-    protected boolean doDelete = true;
-
-
-    /**
-     * Get's the initial context factory for the provider's ou=system context
-     * root.
-     *
-     * @see junit.framework.TestCase#setUp()
-     */
-    protected void setUp() throws Exception
-    {
-        super.setUp();
-
-        doDelete( new File( "target" + File.separator + "eve" ) );
-    }
-
-
-    /**
-     * Deletes the servers working directory.
-     *
-     * @param wkdir the working directory to delete
-     * @throws java.io.IOException if there are failures while deleting.
-     */
-    protected void doDelete( File wkdir ) throws IOException
-    {
-        if ( doDelete )
-        {
-            if ( wkdir.exists() )
-            {
-                try
-                {
-                    FileUtils.deleteDirectory( wkdir );
-                }
-                catch ( IOException e )
-                {
-                    LOG.error( "Failed to delete the working directory: {}" + wkdir, e );
-                    throw e;
-                }
-            }
-        }
-    }
+    public static DirectoryService service;
 
 
     /**
@@ -98,12 +56,9 @@
      *
      * @throws NamingException if there are any problems
      */
+    @Test
     public void testGetInitialContext() throws NamingException
     {
-        DirectoryService service = new DefaultDirectoryService();
-        service.setShutdownHookEnabled( false );
-        service.setWorkingDirectory( new File( "target" + File.separator + "server" ) );
-
         Hashtable<String,Object> env = new Hashtable<String,Object>();
         env.put( DirectoryService.JNDI_KEY, service );
         env.put( Context.PROVIDER_URL, "" );
@@ -114,7 +69,6 @@
 
         InitialContext initCtx = new InitialContext( env );
         assertNotNull( initCtx );
-        service.shutdown();
     }
 
 
@@ -124,13 +78,9 @@
      *
      * @throws NamingException if there are any problems
      */
+    @Test
     public void testGetInitialContextLookupAttributes() throws NamingException
     {
-        DirectoryService service = new DefaultDirectoryService();
-        service.setShutdownHookEnabled( false );
-        service.setWorkingDirectory( new File( "target" + File.separator + "server" ) );
-        service.startup();
-
         Hashtable<String,Object> env = new Hashtable<String,Object>();
         env.put( DirectoryService.JNDI_KEY, service );
         env.put( Context.PROVIDER_URL, "" );
@@ -147,7 +97,6 @@
 
         // Added some objectClass attributes to the rootDSE
         assertEquals( 1, attributes.size() );
-        service.shutdown();
     }
 
 
@@ -156,13 +105,9 @@
      *
      * @throws NamingException if there are any problems
      */
+    @Test
     public void testGetInitialContextLookupAttributesByName() throws NamingException
     {
-        DirectoryService service = new DefaultDirectoryService();
-        service.setShutdownHookEnabled( false );
-        service.setWorkingDirectory( new File( "target" + File.separator + "server" ) );
-        service.startup();
-
         Hashtable<String,Object> env = new Hashtable<String,Object>();
         env.put( DirectoryService.JNDI_KEY, service );
         env.put( Context.PROVIDER_URL, "" );
@@ -180,7 +125,6 @@
         assertEquals( 2, attributes.size() );
         assertEquals( "Apache Software Foundation", attributes.get( "vendorName" ).get()
);
         assertTrue( attributes.get( "namingContexts" ).contains( "ou=system" ) );
-        service.shutdown();
     }
 
 
@@ -189,13 +133,9 @@
      *
      * @throws NamingException if there are any problems
      */
+    @Test
     public void testDelete() throws NamingException
     {
-        DirectoryService service = new DefaultDirectoryService();
-        service.setShutdownHookEnabled( false );
-        service.setWorkingDirectory( new File( "target" + File.separator + "server" ) );
-        service.startup();
-
         Hashtable<String,Object> env = new Hashtable<String,Object>();
         env.put( DirectoryService.JNDI_KEY, service );
         env.put( Context.PROVIDER_URL, "" );
@@ -220,7 +160,6 @@
         }
 
         assertNotNull( notNull );
-        service.shutdown();
     }
 
 
@@ -229,13 +168,9 @@
      *
      * @throws NamingException if there are any problems
      */
+    @Test
     public void testRename() throws NamingException
     {
-        DirectoryService service = new DefaultDirectoryService();
-        service.setShutdownHookEnabled( false );
-        service.setWorkingDirectory( new File( "target" + File.separator + "server" ) );
-        service.startup();
-
         Hashtable<String,Object> env = new Hashtable<String,Object>();
         env.put( DirectoryService.JNDI_KEY, service );
         env.put( Context.PROVIDER_URL, "" );
@@ -260,7 +195,6 @@
         }
 
         assertNotNull( notNull );
-        service.shutdown();
     }
 
 
@@ -269,13 +203,9 @@
      *
      * @throws NamingException if there are any problems
      */
+    @Test
     public void testModify() throws NamingException
     {
-        DirectoryService service = new DefaultDirectoryService();
-        service.setShutdownHookEnabled( false );
-        service.setWorkingDirectory( new File( "target" + File.separator + "server" ) );
-        service.startup();
-
         Hashtable<String,Object> env = new Hashtable<String,Object>();
         env.put( DirectoryService.JNDI_KEY, service );
         env.put( Context.PROVIDER_URL, "" );
@@ -300,7 +230,6 @@
         }
 
         assertNotNull( notNull );
-        service.shutdown();
     }
 
 
@@ -309,13 +238,9 @@
      *
      * @throws NamingException if there are any problems
      */
+    @Test
     public void testModify2() throws NamingException
     {
-        DirectoryService service = new DefaultDirectoryService();
-        service.setShutdownHookEnabled( false );
-        service.setWorkingDirectory( new File( "target" + File.separator + "server" ) );
-        service.startup();
-
         Hashtable<String,Object> env = new Hashtable<String,Object>();
         env.put( DirectoryService.JNDI_KEY, service );
         env.put( Context.PROVIDER_URL, "" );
@@ -345,6 +270,5 @@
         }
 
         assertNotNull( notNull );
-        service.shutdown();
     }
 }



Mime
View raw message