Package org.apache.geronimo.kernel.osgi

Examples of org.apache.geronimo.kernel.osgi.MockBundle


*/
public class Connector15DCBTest extends TestCase {
    private ClassLoader classLoader;

    public void testCreateDatabase() throws Exception {
        Bundle bundle = new MockBundle(classLoader, "", 0L);
        // Create and test the DDBeanRoot
        URL resource = classLoader.getResource("database.rar");
        assertNotNull(resource);
        ConnectorDeployable deployable = new ConnectorDeployable(bundle);
        assertEquals(ModuleType.RAR, deployable.getType());
View Full Code Here


    }

    public void testWriteWithNulls() throws Exception {
        InputStream in = classLoader.getResource("plan-with-nulls.xml").openStream();

        Bundle bundle = new MockBundle(classLoader, "", 0L);
        // Create and test the DDBeanRoot
        URL resource = classLoader.getResource("database.rar");
        assertNotNull(resource);
        ConnectorDeployable deployable = new ConnectorDeployable(bundle);
        assertEquals(ModuleType.RAR, deployable.getType());
View Full Code Here

    public void testCreateJMSResource() throws Exception {
        // Create and test the DDBeanRoot
        URL resource = classLoader.getResource("jms.rar");
        assertNotNull(resource);
        Bundle bundle = new MockBundle(classLoader, "", 0L);
        ConnectorDeployable deployable = new ConnectorDeployable(bundle);
        assertEquals(ModuleType.RAR, deployable.getType());
        Set entrySet = new HashSet(Collections.list(deployable.entries()));
        assertTrue(entrySet.contains("META-INF/ra.xml"));
        assertTrue(entrySet.contains("activemq-ra-3.2.1.jar"));
View Full Code Here

    public void testLoadJMSResources() throws Exception {
        InputStream in = classLoader.getResource("jms-plan.xml").openStream();
        // Create and test the DDBeanRoot
        URL resource = classLoader.getResource("jms.rar");
        assertNotNull(resource);
        Bundle bundle = new MockBundle(classLoader, "", 0L);
        ConnectorDeployable deployable = new ConnectorDeployable(bundle);
        assertEquals(ModuleType.RAR, deployable.getType());
        Set entrySet = new HashSet(Collections.list(deployable.entries()));
        assertTrue(entrySet.contains("META-INF/ra.xml"));
        assertTrue(entrySet.contains("activemq-ra-3.2.1.jar"));
View Full Code Here

        JaasLoginModuleUse loginModuleUse = new JaasLoginModuleUse(loginModule, null, LoginModuleControlFlag.REQUIRED);

        PrincipalInfo.PrincipalEditor principalEditor = new PrincipalInfo.PrincipalEditor();
        principalEditor.setAsText("metro,org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal");
        Bundle bundle = new MockBundle(cl, "", -1);
        ProxyLoginModule.init(new MockBundleContext(bundle));
        realm = new GenericSecurityRealm(domainName, loginModuleUse, true, true, serverInfo, bundle, null);
    }
View Full Code Here

                "127.0.0.1");
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        Axis2Response res = new Axis2Response("text/xml; charset=utf-8", "127.0.0.1", null, null, 8080, out);

        String endpointClassName = "org.apache.geronimo.axis2.testdata.simple.HelloWorld";
        Bundle mockBundle = new MockBundle(cl, null, 11L);
        POJOWebServiceContainer container = new POJOWebServiceContainer(portInfo, endpointClassName, mockBundle, null, new Axis2ModuleRegistry(mockBundle.getBundleContext()), AnnotationHolder.EMPTY, "/axis2", "TestWebModuleName");
        container.init();
        container.invoke(req, res);
        out.flush();

    }
View Full Code Here

                        new HashMap(),
                        "127.0.0.1");

                ByteArrayOutputStream out = new ByteArrayOutputStream();
                Axis2Response res = new Axis2Response("text/xml; charset=utf-8", "127.0.0.1", null, null, 8080, out);
                Bundle mockBundle = new MockBundle(cl, null, 11L);
                POJOWebServiceContainer container = new POJOWebServiceContainer(portInfo, endPointClassName, mockBundle, null, new Axis2ModuleRegistry(mockBundle.getBundleContext()),
                        AnnotationHolder.EMPTY, "/axis2","TestWebModuleName");
                container.init();
                container.invoke(req, res);
                System.out.println("Response "+out);
                out.flush();
View Full Code Here

        InputStream in = getClass().getResourceAsStream("/handlers.xml");
        assertTrue(in != null);
        HandlerChainsInfo handlerChains = toHandlerChains(in);
        assertEquals(3, handlerChains.handleChains.size());

        GeronimoHandlerResolver resolver = new GeronimoHandlerResolver(new MockBundle(getClass().getClassLoader(), null, 11L), getClass(), handlerChains, null);

        List<Handler> handlers = null;

        handlers = resolver.getHandlerChain(new TestPortInfo(null, null, null));
        assertEquals(3, handlers.size());
View Full Code Here

        InputStream in = getClass().getResourceAsStream("/handlers_service.xml");
        assertTrue(in != null);
        HandlerChainsInfo handlerChains = toHandlerChains(in);
        assertEquals(4, handlerChains.handleChains.size());

        GeronimoHandlerResolver resolver = new GeronimoHandlerResolver(new MockBundle(getClass().getClassLoader(), null, 11L), getClass(), handlerChains, null);

        List<Handler> handlers = null;

        handlers = resolver.getHandlerChain(new TestPortInfo(null, null, null));
        assertEquals(0, handlers.size());
View Full Code Here

        InputStream in = getClass().getResourceAsStream("/handlers_bindings.xml");
        assertTrue(in != null);
        HandlerChainsInfo handlerChains = toHandlerChains(in);
        assertEquals(4, handlerChains.handleChains.size());

        GeronimoHandlerResolver resolver = new GeronimoHandlerResolver(new MockBundle(getClass().getClassLoader(), null, 11L), getClass(), handlerChains, null);
        List<Handler> handlers = null;

        handlers = resolver.getHandlerChain(new TestPortInfo(null, null, null));
        assertEquals(0, handlers.size());
View Full Code Here

TOP

Related Classes of org.apache.geronimo.kernel.osgi.MockBundle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.