directory-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=415104&view=rev
Log:
Removed unnecessary code and ws cleanup.

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=415104&r1=415103&r2=415104&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:11:23 2006
@@ -47,49 +47,37 @@
 {
     private LdapContext ctx = null;
 
-
-    /**
-     * Create an entry for a person.
-     */
+    
     public void setUp() throws Exception
     {
-        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 );
+        Set handlers = new HashSet( super.configuration.getExtendedOperationHandlers() );
+        handlers.add( new StoredProcedureExtendedOperationHandler() );
+        super.configuration.setExtendedOperationHandlers( handlers );
+        
+        super.setUp();
 
-            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;
-        }
+        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 );
     }
 
 
@@ -110,6 +98,7 @@
         StoredProcedureResponse resp = ( StoredProcedureResponse ) ctx.extendedOperation(
req );
         assertNotNull( resp );
     }
+    
 
     public void testExecuteProcedureWithParameters() throws NamingException, IOException
     {



Mime
View raw message