directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r415103 - /directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/StoredProcedureTest.java
Date Sun, 18 Jun 2006 07:08:11 GMT
Author: ersiner
Date: Sun Jun 18 00:08:11 2006
New Revision: 415103

URL: http://svn.apache.org/viewvc?rev=415103&view=rev
Log:
Fixed integration test issues. All integration tests pass now.
The issue was due to not calling super.tearDown() in the test case. So the server was not
shutting down. And also this was causing other tests to fail.

Modified:
    directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/StoredProcedureTest.java

Modified: directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/StoredProcedureTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/StoredProcedureTest.java?rev=415103&r1=415102&r2=415103&view=diff
==============================================================================
--- directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/StoredProcedureTest.java
(original)
+++ directory/trunks/apacheds/server-unit/src/test/java/org/apache/directory/server/StoredProcedureTest.java
Sun Jun 18 00:08:11 2006
@@ -53,34 +53,43 @@
      */
     public void setUp() throws Exception
     {
-        Set handlers = new HashSet( super.configuration.getExtendedOperationHandlers() );
-        handlers.add( new StoredProcedureExtendedOperationHandler() );
-        super.configuration.setExtendedOperationHandlers( handlers );
-        
-        super.setUp();
+        try
+        {
+            Set handlers = new HashSet( super.configuration.getExtendedOperationHandlers()
);
+            handlers.add( new StoredProcedureExtendedOperationHandler() );
+            super.configuration.setExtendedOperationHandlers( handlers );
+            
+            super.setUp();
 
-        Hashtable env = new Hashtable();
-        env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
-        env.put( "java.naming.provider.url", "ldap://localhost:" + port + "/ou=system" );
-        env.put( "java.naming.security.principal", "uid=admin,ou=system" );
-        env.put( "java.naming.security.credentials", "secret" );
-        env.put( "java.naming.security.authentication", "simple" );
-        ctx = new InitialLdapContext( env, null );
+            Hashtable env = new Hashtable();
+            env.put( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
+            env.put( "java.naming.provider.url", "ldap://localhost:" + port + "/ou=system"
);
+            env.put( "java.naming.security.principal", "uid=admin,ou=system" );
+            env.put( "java.naming.security.credentials", "secret" );
+            env.put( "java.naming.security.authentication", "simple" );
+            ctx = new InitialLdapContext( env, null );
 
-        URL url = getClass().getResource( "HelloWorldProcedure.class" );
-        InputStream in = getClass().getResourceAsStream( "HelloWorldProcedure.class" );
-        File file = new File( url.getFile() );
-        int size = ( int ) file.length();
-        byte[] buf = new byte[size];
-        in.read( buf );
-        in.close();
-        
-        // set up
-        Attributes attributes = new BasicAttributes( "objectClass", "top", true );
-        attributes.get( "objectClass" ).add( "javaClass" );
-        attributes.put( "fullyQualifiedClassName", HelloWorldProcedure.class.getName() );
-        attributes.put( "byteCode", buf );
-        ctx.createSubcontext( "fullyQualifiedClassName=" + HelloWorldProcedure.class.getName(),
attributes );
+            URL url = getClass().getResource( "HelloWorldProcedure.class" );
+            InputStream in = getClass().getResourceAsStream( "HelloWorldProcedure.class"
);
+            File file = new File( url.getFile() );
+            int size = ( int ) file.length();
+            byte[] buf = new byte[size];
+            in.read( buf );
+            in.close();
+            
+            // set up
+            Attributes attributes = new BasicAttributes( "objectClass", "top", true );
+            attributes.get( "objectClass" ).add( "javaClass" );
+            attributes.put( "fullyQualifiedClassName", HelloWorldProcedure.class.getName()
);
+            attributes.put( "byteCode", buf );
+            ctx.createSubcontext( "fullyQualifiedClassName=" + HelloWorldProcedure.class.getName(),
attributes );
+        }
+        catch ( Exception e )
+        {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+            throw e;
+        }
     }
 
 
@@ -88,6 +97,8 @@
     {
         ctx.close();
         ctx = null;
+        
+        super.tearDown();
     }
     
 



Mime
View raw message