Examples of MockBundle


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

    protected void setUp() throws Exception {
        super.setUp();
        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
        URL warDir = classLoader.getResource("deployables/war1/");
        ClassLoader cl = new URLClassLoader(new URL[] {warDir});
        Bundle bundle = new MockBundle(cl, warDir.toString(), 0L);
        deployable = new WebDeployable(bundle);
        config = new WARConfiguration(deployable);

        ddBeanRoot = deployable.getDDBeanRoot();
        configRoot = (WebAppDConfigRoot) config.getDConfigBeanRoot(ddBeanRoot);
View Full Code Here

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

            in.close();
        }
    }

    private WebModule createDummyWebModule(EARContext rootContext) throws Exception {
        WebModule webModule = new WebModule(true, new AbstractName(new URI("test/test/1.0/car?J2EEApplication=null,j2eeType=WebModule,name=test.war")), "test.war", new Environment(), new DeployableBundle(new MockBundle(WebFragmentTest.class.getClassLoader(), "", 1L)), "",
                new WebApp(), null, "", "", "", null, null);
        webModule.setEarContext(new DummyEARContext());
        return webModule;
    }
View Full Code Here

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

    private ClassLoader classLoader;

    public void testWebClasspath() throws Exception {
        URL resource = classLoader.getResource("deployables/war1.war");
        ClassLoader cl = new URLClassLoader(new URL[] {resource});
        Bundle bundle = new MockBundle(cl, resource.toString(), 0L);
        WebDeployable deployable = new WebDeployable(bundle);
    }
View Full Code Here

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

         * this.corbaGBeanObjectName = corbaGBeanObjectName;
         * this.messageDestinations = messageDestinations;
         * }
         */
        public DummyEARContext() throws Exception {
            super(FileUtils.createTempDir(), null, new Environment(), ConfigurationModuleType.WAR, null, new DummyConfigurationManager(), new MockBundleContext(new MockBundle(
                    WebFragmentTest.class.getClassLoader(), "", 1L)), null, null, null, null, null, null);
        }
View Full Code Here

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

    private ClassLoader classLoader;

    public void testLoadClient() throws Exception {
        URL resource = classLoader.getResource("deployables/app-client1.jar");
        ClassLoader cl = new URLClassLoader(new URL[] {resource});
        Bundle bundle = new MockBundle(cl, resource.toString(), 0L);
        ClientDeployable deployable = new ClientDeployable(bundle);
        assertEquals(ModuleType.CAR, deployable.getType());
        Set entrySet = new HashSet(Collections.list(deployable.entries()));
        Set resultSet = new HashSet();
        resultSet.add("META-INF/");
View Full Code Here

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

        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

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

        new SecurityServiceImpl(this.getClass().getClassLoader(), serverInfo, GeronimoPolicyConfigurationFactory.class.getName(), GeronimoPolicy.class.getName(), null, null, null, null);
    }

    protected void setUp() throws Exception {
        super.setUp();
        bundle = new MockBundle(getClass().getClassLoader(), "test", 100);
        setUpSecurityService();

        ((SchemaTypeImpl) GerSecurityDocument.type).addSubstitutionGroupMember(org.apache.geronimo.xbeans.geronimo.security.GerSecurityDocument.type.getDocumentElementName());

        kernel = KernelFactory.newInstance(bundle.getBundleContext()).createKernel("test");
View Full Code Here

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

                "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", JAXWSUtils.DEFAULT_CATALOG_WEB);
        container.init();
        container.invoke(req, res);
        out.flush();

    }
View Full Code Here

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

                        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", JAXWSUtils.DEFAULT_CATALOG_WEB);
                container.init();
                container.invoke(req, res);
                System.out.println("Response "+out);
                out.flush();
View Full Code Here

Examples of org.apache.sling.adapter.mock.MockBundle

        assertTrue("AdapterFactoryDescriptors must be empty", am.getFactories().isEmpty());
        assertNull("AdapterFactory cache must be null", am.getFactoryCache());
    }

    public void testBindBeforeActivate() {
        Bundle bundle = new MockBundle(1L);
        MockServiceReference ref = new MockServiceReference(bundle);
        ref.setProperty(Constants.SERVICE_ID, 1L);
        ref.setProperty(AdapterFactory.ADAPTABLE_CLASSES, new String[]{ TestSlingAdaptable.class.getName() });
        ref.setProperty(AdapterFactory.ADAPTER_CLASSES, ITestAdapter.class.getName());
        am.bindAdapterFactory(ref);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.