directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r345584 - in /directory/sandbox/ersiner/apacheds-with-storedprocs: core-unit/src/test/java/org/apache/ldap/server/storedprocs/JNDIClassLoaderTest.java core/src/main/java/org/apache/ldap/server/storedprocs/JNDIClassLoader.java
Date Fri, 18 Nov 2005 22:15:49 GMT
Author: ersiner
Date: Fri Nov 18 14:15:37 2005
New Revision: 345584

URL: http://svn.apache.org/viewcvs?rev=345584&view=rev
Log:
Minor fixes after Alex's refactoring.

Modified:
    directory/sandbox/ersiner/apacheds-with-storedprocs/core-unit/src/test/java/org/apache/ldap/server/storedprocs/JNDIClassLoaderTest.java
    directory/sandbox/ersiner/apacheds-with-storedprocs/core/src/main/java/org/apache/ldap/server/storedprocs/JNDIClassLoader.java

Modified: directory/sandbox/ersiner/apacheds-with-storedprocs/core-unit/src/test/java/org/apache/ldap/server/storedprocs/JNDIClassLoaderTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/ersiner/apacheds-with-storedprocs/core-unit/src/test/java/org/apache/ldap/server/storedprocs/JNDIClassLoaderTest.java?rev=345584&r1=345583&r2=345584&view=diff
==============================================================================
--- directory/sandbox/ersiner/apacheds-with-storedprocs/core-unit/src/test/java/org/apache/ldap/server/storedprocs/JNDIClassLoaderTest.java
(original)
+++ directory/sandbox/ersiner/apacheds-with-storedprocs/core-unit/src/test/java/org/apache/ldap/server/storedprocs/JNDIClassLoaderTest.java
Fri Nov 18 14:15:37 2005
@@ -21,6 +21,7 @@
 import javax.naming.directory.BasicAttributes;
 
 import org.apache.ldap.common.util.Base64;
+import org.apache.ldap.server.jndi.ServerLdapContext;
 import org.apache.ldap.server.unit.AbstractAdminTestCase;
 
 
@@ -49,5 +50,12 @@
         attributes.put( "fqcn", "HelloWorld" );
         attributes.put( "byteCode", HELLOWORLD_CLASS_BYTES );
         sysRoot.createSubcontext( "fqcn=HelloWorld", attributes );
+    }
+    
+    public void testLoadClass() throws NamingException
+    {
+        JNDIClassLoader loader = new JNDIClassLoader( ( ServerLdapContext ) ( sysRoot.lookup(
"" ) ) );
+        Class clazz = loader.findClass( "HelloWorld" );
+        assertEquals( clazz.getName(), "HelloWorld" );
     }
 }

Modified: directory/sandbox/ersiner/apacheds-with-storedprocs/core/src/main/java/org/apache/ldap/server/storedprocs/JNDIClassLoader.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/ersiner/apacheds-with-storedprocs/core/src/main/java/org/apache/ldap/server/storedprocs/JNDIClassLoader.java?rev=345584&r1=345583&r2=345584&view=diff
==============================================================================
--- directory/sandbox/ersiner/apacheds-with-storedprocs/core/src/main/java/org/apache/ldap/server/storedprocs/JNDIClassLoader.java
(original)
+++ directory/sandbox/ersiner/apacheds-with-storedprocs/core/src/main/java/org/apache/ldap/server/storedprocs/JNDIClassLoader.java
Fri Nov 18 14:15:37 2005
@@ -45,7 +45,7 @@
     private ServerLdapContext ctx;
 
     
-    public JNDIClassLoader( ServerLdapContext ctx, String dn )
+    public JNDIClassLoader( ServerLdapContext ctx )
     {
         this.ctx = ctx;
     }
@@ -56,7 +56,7 @@
         byte[] b = null;
 
     	BranchNode filter = new BranchNode( BranchNode.AND );
-    	filter.addNode( new SimpleNode( "fqcn", "HelloWorld", LeafNode.EQUALITY ) );
+    	filter.addNode( new SimpleNode( "fqcn", name, LeafNode.EQUALITY ) );
     	filter.addNode( new SimpleNode( "objectClass", "javaClass", LeafNode.EQUALITY ) );
     	SearchControls controls = new SearchControls();
     	controls.setSearchScope( SearchControls.SUBTREE_SCOPE );



Mime
View raw message