You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cl...@apache.org on 2011/07/03 20:22:13 UTC

svn commit: r1142472 - in /felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo: handlers/dependency/ handlers/providedservice/ test/

Author: clement
Date: Sun Jul  3 18:22:13 2011
New Revision: 1142472

URL: http://svn.apache.org/viewvc?rev=1142472&view=rev
Log:
Refactored tests
Added tests about FELIX-3009

Added:
    felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/providedservice/
    felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/providedservice/ComponentTestWithAnotherSuperClass.java
    felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/providedservice/ComponentTestWithSuperClass.java
    felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandlerTest.java
    felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/test/
    felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/test/MockBundle.java
Modified:
    felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/dependency/SmartProxyTest.java

Modified: felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/dependency/SmartProxyTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/dependency/SmartProxyTest.java?rev=1142472&r1=1142471&r2=1142472&view=diff
==============================================================================
--- felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/dependency/SmartProxyTest.java (original)
+++ felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/dependency/SmartProxyTest.java Sun Jul  3 18:22:13 2011
@@ -1,11 +1,6 @@
 package org.apache.felix.ipojo.handlers.dependency;
 
 import java.awt.Window;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Dictionary;
-import java.util.Enumeration;
 import java.util.List;
 
 import javax.swing.Action;
@@ -15,192 +10,109 @@ import junit.framework.TestCase;
 
 import org.apache.felix.ipojo.ComponentFactory;
 import org.apache.felix.ipojo.InstanceManager;
+import org.apache.felix.ipojo.test.MockBundle;
 import org.apache.felix.ipojo.util.Logger;
 import org.mockito.Mockito;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.ServiceReference;
 
 public class SmartProxyTest extends TestCase {
 
-	public void setUp() {
-	}
+    public void setUp() {
+    }
 
 
-	/**
-	 * Check that we don't create smart proxies for concrete and abstract classes.
-	 */
-	public void testCannotProxyAbstractAndContreteClasses() {
-		Bundle bundle = new BundleImplementingLoading();
-
-		BundleContext context = (BundleContext) Mockito.mock(BundleContext.class);
-		Mockito.when(context.getProperty(DependencyHandler.PROXY_TYPE_PROPERTY)).thenReturn(null);
-		Mockito.when(context.getProperty(Logger.IPOJO_LOG_LEVEL_PROP)).thenReturn(null);
-		Mockito.when(context.getBundle()).thenReturn(bundle);
-
-		ComponentFactory factory = (ComponentFactory) Mockito.mock(ComponentFactory.class);
-		Mockito.when(factory.getBundleClassLoader()).thenReturn(Dependency.class.getClassLoader());
-
-		InstanceManager im = (InstanceManager) Mockito.mock(InstanceManager.class);
-		Mockito.when(im.getContext()).thenReturn(context);
-		Mockito.when(im.getFactory()).thenReturn(factory);
-
-		DependencyHandler handler = (DependencyHandler) Mockito.mock(DependencyHandler.class);
-		Mockito.when(handler.getInstanceManager()).thenReturn(im);
-		Logger logger = new Logger(context, "test", Logger.INFO);
-
-
-		Mockito.when(handler.getLogger()).thenReturn(logger);
-
-		// Try with java.List
-		Dependency dependency = new Dependency(handler, "a_field", Window.class, null, false, false, false,
-				true, "dep", context, Dependency.DYNAMIC_BINDING_POLICY, null, null);
-		dependency.start();
-
-		// No service
-		Assert.assertNull(dependency.onGet(new Object(), "a_field", null));
-
-		dependency.stop();
-
-		// Try with javax.swing.Action
-		dependency = new Dependency(handler, "a_field", Object.class, null, false, false, false,
-				true, "dep", context, Dependency.DYNAMIC_BINDING_POLICY, null, null);
-		dependency.start();
-		// OK
-		Assert.assertNull(dependency.onGet(new Object(), "a_field", null));
-	}
-
-	/**
-	 * Tests if we can proxies classes from java.* package.
-	 * Indeed, a recent JVM bug fix introduces a bug:
-	 * <code>
-	 * [ERROR] test : Cannot create the proxy object
-	 * java.lang.SecurityException: Prohibited package name: java.awt
-	 * </code>
-	 */
-	public void testProxiesOfJavaClasses() {
-		Bundle bundle = new BundleImplementingLoading();
-
-		BundleContext context = (BundleContext) Mockito.mock(BundleContext.class);
-		Mockito.when(context.getProperty(DependencyHandler.PROXY_TYPE_PROPERTY)).thenReturn(null);
-		Mockito.when(context.getProperty(Logger.IPOJO_LOG_LEVEL_PROP)).thenReturn(null);
-		Mockito.when(context.getBundle()).thenReturn(bundle);
-
-		ComponentFactory factory = (ComponentFactory) Mockito.mock(ComponentFactory.class);
-		Mockito.when(factory.getBundleClassLoader()).thenReturn(Dependency.class.getClassLoader());
-
-		InstanceManager im = (InstanceManager) Mockito.mock(InstanceManager.class);
-		Mockito.when(im.getContext()).thenReturn(context);
-		Mockito.when(im.getFactory()).thenReturn(factory);
-
-		DependencyHandler handler = (DependencyHandler) Mockito.mock(DependencyHandler.class);
-		Mockito.when(handler.getInstanceManager()).thenReturn(im);
-		Logger logger = new Logger(context, "test", Logger.INFO);
-
-
-		Mockito.when(handler.getLogger()).thenReturn(logger);
-
-		// Try with java.List
-		Dependency dependency = new Dependency(handler, "a_field", List.class, null, false, false, false,
-				true, "dep", context, Dependency.DYNAMIC_BINDING_POLICY, null, null);
-		dependency.start();
-
-		// OK
-		Assert.assertNotNull(dependency.onGet(new Object(), "a_field", null));
-		Assert.assertTrue(dependency.onGet(new Object(), "a_field", null) instanceof List);
-
-		dependency.stop();
-
-		// Try with javax.swing.Action
-		dependency = new Dependency(handler, "a_field", Action.class, null, false, false, false,
-				true, "dep", context, Dependency.DYNAMIC_BINDING_POLICY, null, null);
-		dependency.start();
-		// OK
-		Assert.assertNotNull(dependency.onGet(new Object(), "a_field", null));
-		Assert.assertTrue(dependency.onGet(new Object(), "a_field", null) instanceof Action);
-	}
-
-	private class BundleImplementingLoading implements Bundle {
-		public int getState() {
-			return 0;
-		}
-
-		public void start() throws BundleException {
-		}
-
-		public void stop() throws BundleException {
-		}
-
-		public void update() throws BundleException {
-		}
-
-		public void update(InputStream in) throws BundleException {
-		}
-
-		public void uninstall() throws BundleException {
-		}
-
-		public Dictionary getHeaders() {
-			return null;
-		}
-
-		public long getBundleId() {
-			return 0;
-		}
-
-		public String getLocation() {
-			return null;
-		}
-
-		public ServiceReference[] getRegisteredServices() {
-			return null;
-		}
-
-		public ServiceReference[] getServicesInUse() {
-			return null;
-		}
-
-		public boolean hasPermission(Object permission) {
-			return false;
-		}
-
-		public URL getResource(String name) {
-			return null;
-		}
-
-		public Dictionary getHeaders(String locale) {
-			return null;
-		}
-
-		public String getSymbolicName() {
-			return null;
-		}
-
-		public Class loadClass(String name) throws ClassNotFoundException {
-			return Dependency.class.getClassLoader().loadClass(name);
-		}
-
-		public Enumeration getResources(String name) throws IOException {
-			return null;
-		}
-
-		public Enumeration getEntryPaths(String path) {
-			return null;
-		}
-
-		public URL getEntry(String name) {
-			return null;
-		}
-
-		public long getLastModified() {
-			return 0;
-		}
-
-		public Enumeration findEntries(String path, String filePattern,
-				boolean recurse) {
-			return null;
-		}
-	}
+    /**
+     * Check that we don't create smart proxies for concrete and abstract classes.
+     */
+    public void testCannotProxyAbstractAndContreteClasses() {
+        Bundle bundle = new MockBundle(Dependency.class.getClassLoader());
+
+        BundleContext context = (BundleContext) Mockito.mock(BundleContext.class);
+        Mockito.when(context.getProperty(DependencyHandler.PROXY_TYPE_PROPERTY)).thenReturn(null);
+        Mockito.when(context.getProperty(Logger.IPOJO_LOG_LEVEL_PROP)).thenReturn(null);
+        Mockito.when(context.getBundle()).thenReturn(bundle);
+
+        ComponentFactory factory = (ComponentFactory) Mockito.mock(ComponentFactory.class);
+        Mockito.when(factory.getBundleClassLoader()).thenReturn(Dependency.class.getClassLoader());
+
+        InstanceManager im = (InstanceManager) Mockito.mock(InstanceManager.class);
+        Mockito.when(im.getContext()).thenReturn(context);
+        Mockito.when(im.getFactory()).thenReturn(factory);
+
+        DependencyHandler handler = (DependencyHandler) Mockito.mock(DependencyHandler.class);
+        Mockito.when(handler.getInstanceManager()).thenReturn(im);
+        Logger logger = new Logger(context, "test", Logger.INFO);
+
+
+        Mockito.when(handler.getLogger()).thenReturn(logger);
+
+        // Try with java.List
+        Dependency dependency = new Dependency(handler, "a_field", Window.class, null, false, false, false,
+                true, "dep", context, Dependency.DYNAMIC_BINDING_POLICY, null, null);
+        dependency.start();
+
+        // No service
+        Assert.assertNull(dependency.onGet(new Object(), "a_field", null));
+
+        dependency.stop();
+
+        // Try with javax.swing.Action
+        dependency = new Dependency(handler, "a_field", Object.class, null, false, false, false,
+                true, "dep", context, Dependency.DYNAMIC_BINDING_POLICY, null, null);
+        dependency.start();
+        // OK
+        Assert.assertNull(dependency.onGet(new Object(), "a_field", null));
+    }
+
+    /**
+     * Tests if we can proxies classes from java.* package.
+     * Indeed, a recent JVM bug fix introduces a bug:
+     * <code>
+     * [ERROR] test : Cannot create the proxy object
+     * java.lang.SecurityException: Prohibited package name: java.awt
+     * </code>
+     */
+    public void testProxiesOfJavaClasses() {
+        Bundle bundle = new MockBundle(Dependency.class.getClassLoader());
+
+        BundleContext context = (BundleContext) Mockito.mock(BundleContext.class);
+        Mockito.when(context.getProperty(DependencyHandler.PROXY_TYPE_PROPERTY)).thenReturn(null);
+        Mockito.when(context.getProperty(Logger.IPOJO_LOG_LEVEL_PROP)).thenReturn(null);
+        Mockito.when(context.getBundle()).thenReturn(bundle);
+
+        ComponentFactory factory = (ComponentFactory) Mockito.mock(ComponentFactory.class);
+        Mockito.when(factory.getBundleClassLoader()).thenReturn(Dependency.class.getClassLoader());
+
+        InstanceManager im = (InstanceManager) Mockito.mock(InstanceManager.class);
+        Mockito.when(im.getContext()).thenReturn(context);
+        Mockito.when(im.getFactory()).thenReturn(factory);
+
+        DependencyHandler handler = (DependencyHandler) Mockito.mock(DependencyHandler.class);
+        Mockito.when(handler.getInstanceManager()).thenReturn(im);
+        Logger logger = new Logger(context, "test", Logger.INFO);
+
+
+        Mockito.when(handler.getLogger()).thenReturn(logger);
+
+        // Try with java.List
+        Dependency dependency = new Dependency(handler, "a_field", List.class, null, false, false, false,
+                true, "dep", context, Dependency.DYNAMIC_BINDING_POLICY, null, null);
+        dependency.start();
+
+        // OK
+        Assert.assertNotNull(dependency.onGet(new Object(), "a_field", null));
+        Assert.assertTrue(dependency.onGet(new Object(), "a_field", null) instanceof List);
+
+        dependency.stop();
+
+        // Try with javax.swing.Action
+        dependency = new Dependency(handler, "a_field", Action.class, null, false, false, false,
+                true, "dep", context, Dependency.DYNAMIC_BINDING_POLICY, null, null);
+        dependency.start();
+        // OK
+        Assert.assertNotNull(dependency.onGet(new Object(), "a_field", null));
+        Assert.assertTrue(dependency.onGet(new Object(), "a_field", null) instanceof Action);
+    }
 
 }

Added: felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/providedservice/ComponentTestWithAnotherSuperClass.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/providedservice/ComponentTestWithAnotherSuperClass.java?rev=1142472&view=auto
==============================================================================
--- felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/providedservice/ComponentTestWithAnotherSuperClass.java (added)
+++ felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/providedservice/ComponentTestWithAnotherSuperClass.java Sun Jul  3 18:22:13 2011
@@ -0,0 +1,12 @@
+package org.apache.felix.ipojo.handlers.providedservice;
+
+import java.beans.MethodDescriptor;
+import java.lang.reflect.Method;
+
+public class ComponentTestWithAnotherSuperClass extends MethodDescriptor {
+
+    public ComponentTestWithAnotherSuperClass(Method method) {
+        super(method);
+    }
+
+}

Added: felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/providedservice/ComponentTestWithSuperClass.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/providedservice/ComponentTestWithSuperClass.java?rev=1142472&view=auto
==============================================================================
--- felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/providedservice/ComponentTestWithSuperClass.java (added)
+++ felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/providedservice/ComponentTestWithSuperClass.java Sun Jul  3 18:22:13 2011
@@ -0,0 +1,7 @@
+package org.apache.felix.ipojo.handlers.providedservice;
+
+import java.beans.SimpleBeanInfo;
+
+public class ComponentTestWithSuperClass extends SimpleBeanInfo {
+
+}

Added: felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandlerTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandlerTest.java?rev=1142472&view=auto
==============================================================================
--- felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandlerTest.java (added)
+++ felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/handlers/providedservice/ProvidedServiceHandlerTest.java Sun Jul  3 18:22:13 2011
@@ -0,0 +1,133 @@
+package org.apache.felix.ipojo.handlers.providedservice;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.apache.felix.ipojo.ComponentFactory;
+import org.apache.felix.ipojo.ConfigurationException;
+import org.apache.felix.ipojo.InstanceManager;
+import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
+import org.apache.felix.ipojo.handlers.dependency.DependencyHandler;
+import org.apache.felix.ipojo.metadata.Attribute;
+import org.apache.felix.ipojo.metadata.Element;
+import org.apache.felix.ipojo.parser.PojoMetadata;
+import org.apache.felix.ipojo.test.MockBundle;
+import org.apache.felix.ipojo.util.Logger;
+import org.mockito.Mockito;
+import org.osgi.framework.BundleContext;
+
+public class ProvidedServiceHandlerTest extends TestCase {
+
+    BundleContext context;
+    ComponentFactory factory;
+    InstanceManager im;
+    ComponentTypeDescription desc;
+    ProvidedServiceHandler handler;
+
+    public void setUp() {
+        context = (BundleContext) Mockito.mock(BundleContext.class);
+        Mockito.when(context.getProperty(DependencyHandler.PROXY_TYPE_PROPERTY)).thenReturn(null);
+        Mockito.when(context.getProperty(Logger.IPOJO_LOG_LEVEL_PROP)).thenReturn(null);
+        Mockito.when(context.getBundle()).thenReturn(new MockBundle(this.getClass().getClassLoader()));
+
+        factory = (ComponentFactory) Mockito.mock(ComponentFactory.class);
+        Mockito.when(factory.getBundleClassLoader()).thenReturn(ProvidedServiceHandler.class.getClassLoader());
+        Mockito.when(factory.getLogger()).thenReturn(new Logger(context, "TEST", Logger.INFO));
+
+        im = (InstanceManager) Mockito.mock(InstanceManager.class);
+        Mockito.when(im.getContext()).thenReturn(context);
+        Mockito.when(im.getFactory()).thenReturn(factory);
+
+        desc = (ComponentTypeDescription) Mockito.mock(ComponentTypeDescription.class);
+        Mockito.when(desc.getFactory()).thenReturn(factory);
+        Mockito.when(desc.getBundleContext()).thenReturn(context);
+
+        handler = new ProvidedServiceHandler();
+        handler.setFactory(factory);
+    }
+
+    public void testServiceDetectionNoInterface() throws ConfigurationException {
+        String classname = "org.apache.felix.ipojo.handlers.providedservice.ComponentTest";
+
+        Element metadata = new Element("component", "");
+        Element manipulation = new Element("manipulation", "");
+        metadata.addAttribute(new Attribute("classname", classname));
+        metadata.addElement(new Element("provides", ""));
+        metadata.addElement(manipulation);
+        manipulation.addAttribute(new Attribute("classname", classname));
+
+        Mockito.when(factory.getPojoMetadata()).thenReturn(new PojoMetadata(metadata));
+        Mockito.when(factory.getClassName()).thenReturn(classname);
+
+        handler.initializeComponentFactory(desc, metadata);
+
+        //Expected behavior: the implementation classname
+        Assert.assertEquals("{org.apache.felix.ipojo.handlers.providedservice.ComponentTest}",
+                metadata.getElements("provides")[0].getAttribute("specifications"));
+    }
+
+    public void testServiceDetectionSuperClass() throws ConfigurationException {
+        String classname = "org.apache.felix.ipojo.handlers.providedservice.ComponentTestWithSuperClass";
+
+        Element metadata = new Element("component", "");
+        Element manipulation = new Element("manipulation", "");
+        metadata.addAttribute(new Attribute("classname", classname));
+        Element provides = new Element("provides", "");
+        provides.addAttribute(new Attribute("specifications", "java.beans.SimpleBeanInfo"));
+        metadata.addElement(provides);
+        metadata.addElement(manipulation);
+        manipulation.addAttribute(new Attribute("classname", classname));
+        manipulation.addAttribute(new Attribute("super", "java.beans.SimpleBeanInfo"));
+        Mockito.when(factory.getPojoMetadata()).thenReturn(new PojoMetadata(metadata));
+        Mockito.when(factory.getClassName()).thenReturn(classname);
+
+        handler.initializeComponentFactory(desc, metadata);
+
+        System.out.println(metadata);
+
+    }
+
+    public void testServiceDetectionImplementationClass() throws ConfigurationException {
+        String classname = "org.apache.felix.ipojo.handlers.providedservice.ComponentTestWithSuperClass";
+
+        Element metadata = new Element("component", "");
+        Element manipulation = new Element("manipulation", "");
+        metadata.addAttribute(new Attribute("classname", classname));
+        Element provides = new Element("provides", "");
+        provides.addAttribute(new Attribute("specifications", classname));
+        metadata.addElement(provides);
+        metadata.addElement(manipulation);
+        manipulation.addAttribute(new Attribute("classname", classname));
+        manipulation.addAttribute(new Attribute("super", "java.beans.SimpleBeanInfo"));
+        Mockito.when(factory.getPojoMetadata()).thenReturn(new PojoMetadata(metadata));
+        Mockito.when(factory.getClassName()).thenReturn(classname);
+
+        handler.initializeComponentFactory(desc, metadata);
+
+        System.out.println(metadata);
+
+    }
+
+    public void testServiceDetectionSuperSuperClass() throws ConfigurationException {
+        String classname = "org.apache.felix.ipojo.handlers.providedservice.ComponentTestWithAnotherSuperClass";
+
+        Element metadata = new Element("component", "");
+        Element manipulation = new Element("manipulation", "");
+        metadata.addAttribute(new Attribute("classname", classname));
+        Element provides = new Element("provides", "");
+        provides.addAttribute(new Attribute("specifications", "java.beans.FeatureDescriptor"));
+        metadata.addElement(provides);
+        metadata.addElement(manipulation);
+        manipulation.addAttribute(new Attribute("classname", classname));
+        manipulation.addAttribute(new Attribute("super", "java.beans.MethodDescriptor"));
+
+        Mockito.when(factory.getPojoMetadata()).thenReturn(new PojoMetadata(metadata));
+        Mockito.when(factory.getClassName()).thenReturn(classname);
+
+        handler.initializeComponentFactory(desc, metadata);
+
+        System.out.println(metadata);
+
+    }
+
+}

Added: felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/test/MockBundle.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/test/MockBundle.java?rev=1142472&view=auto
==============================================================================
--- felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/test/MockBundle.java (added)
+++ felix/trunk/ipojo/core/src/test/java/org/apache/felix/ipojo/test/MockBundle.java Sun Jul  3 18:22:13 2011
@@ -0,0 +1,103 @@
+package org.apache.felix.ipojo.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Dictionary;
+import java.util.Enumeration;
+
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+import org.osgi.framework.ServiceReference;
+
+public class MockBundle implements Bundle {
+
+    private final ClassLoader m_classloader;
+
+    /**
+     * @param classloader the Classloader to load classes and resources.
+     */
+    public MockBundle(ClassLoader cl) {
+        m_classloader = cl;
+    }
+
+    public int getState() {
+        return 0;
+    }
+
+    public void start() throws BundleException {
+    }
+
+    public void stop() throws BundleException {
+    }
+
+    public void update() throws BundleException {
+    }
+
+    public void update(InputStream in) throws BundleException {
+    }
+
+    public void uninstall() throws BundleException {
+    }
+
+    public Dictionary getHeaders() {
+        return null;
+    }
+
+    public long getBundleId() {
+        return 1; // 0 is the system bundle
+    }
+
+    public String getLocation() {
+        return null;
+    }
+
+    public ServiceReference[] getRegisteredServices() {
+        return null;
+    }
+
+    public ServiceReference[] getServicesInUse() {
+        return null;
+    }
+
+    public boolean hasPermission(Object permission) {
+        return false;
+    }
+
+    public URL getResource(String name) {
+        return m_classloader.getResource(name);
+    }
+
+    public Dictionary getHeaders(String locale) {
+        return null;
+    }
+
+    public String getSymbolicName() {
+        return null;
+    }
+
+    public Class loadClass(String name) throws ClassNotFoundException {
+        return m_classloader.loadClass(name);
+    }
+
+    public Enumeration getResources(String name) throws IOException {
+        return m_classloader.getResources(name);
+    }
+
+    public Enumeration getEntryPaths(String path) {
+        return null;
+    }
+
+    public URL getEntry(String name) {
+        return null;
+    }
+
+    public long getLastModified() {
+        return 0;
+    }
+
+    public Enumeration findEntries(String path, String filePattern,
+            boolean recurse) {
+        return null;
+    }
+}
\ No newline at end of file