directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r345625 - 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 Sat, 19 Nov 2005 02:19:59 GMT
Author: akarasulu
Date: Fri Nov 18 18:19:50 2005
New Revision: 345625

URL: http://svn.apache.org/viewcvs?rev=345625&view=rev
Log:
merged tests because when each test is run it starts with a clean db

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=345625&r1=345624&r2=345625&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 18:19:50 2005
@@ -43,17 +43,16 @@
         "JsgACEgO2AASxAAAAAQAKAAAACgACAAAABQAIAAYAAQANAAAAAgAO";
 	private static final byte[] HELLOWORLD_CLASS_BYTES = Base64.decode( HELLOWORLD_CLASS_BASE64.toCharArray()
);
 	
-    public void testBinaryExtension() throws NamingException
+	
+    public void testLoadingClass() throws Exception
     {
         Attributes attributes = new BasicAttributes( "objectClass", "top", true );
         attributes.get( "objectClass" ).add( "javaClass" );
         attributes.put( "fqcn", "HelloWorld" );
         attributes.put( "byteCode", HELLOWORLD_CLASS_BYTES );
         sysRoot.createSubcontext( "fqcn=HelloWorld", attributes );
-    }
-    
-    public void testLoadClass() throws NamingException
-    {
+        assertNotNull( sysRoot.lookup( "fqcn=HelloWorld" ) );
+
         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=345625&r1=345624&r2=345625&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 18:19:50 2005
@@ -25,6 +25,7 @@
 
 import org.apache.ldap.common.filter.BranchNode;
 import org.apache.ldap.common.filter.LeafNode;
+import org.apache.ldap.common.filter.PresenceNode;
 import org.apache.ldap.common.filter.SimpleNode;
 import org.apache.ldap.common.name.LdapName;
 import org.apache.ldap.server.jndi.ServerLdapContext;
@@ -51,7 +52,7 @@
     }
 
     
-    public Class findClass( String name )
+    public Class findClass( String name ) throws ClassNotFoundException
     {
         byte[] b = null;
 
@@ -73,12 +74,16 @@
 			}
 			else
 			{
-				log.warn( "Class " + name + " not found in DIT." );
+				String msg = "Class " + name + " not found in DIT.";
+				log.warn( msg );
+				throw new ClassNotFoundException( msg );
 			}
 		} 
     	catch ( NamingException e ) 
     	{
-			log.error( "encountered JNDI failure while searching directory for class: " + name, e
);
+    		String msg = "encountered JNDI failure while searching directory for class: " + name;
+			log.error( msg, e );
+			throw new ClassNotFoundException( msg );
 		}
     	finally
     	{



Mime
View raw message