Package org.apache.geronimo.kernel.osgi

Examples of org.apache.geronimo.kernel.osgi.MockBundleContext$MockServiceRegistration


    protected boolean needServerInfo = true;
    protected AbstractName loginConfiguration;
    protected boolean needLoginConfiguration = true;

    protected void setUp() throws Exception {
        bundleContext = new MockBundleContext(getClass().getClassLoader(), BASEDIR.getAbsolutePath(), null, null);

        kernel = KernelFactory.newInstance(bundleContext).createKernel("test.kernel");
        kernel.boot();

        GBeanData gbean;
View Full Code Here


        assertTrue("Audit file wasn't written to", auditlog.length() > 0);
    }

    protected void setUp() throws Exception {
//        super.setUp();
        bundleContext = new MockBundleContext(getClass().getClassLoader(), BASEDIR.getAbsolutePath(), null, null);
        kernel = KernelFactory.newInstance(bundleContext).createKernel("test.kernel");
        kernel.boot();

        GBeanData gbean;
View Full Code Here

        WebBeansFinder.clearInstances(getClass().getClassLoader());
        configurationBaseURL = cl.getResource("deployables/");
        //Setup default JSP Factory
        Class.forName("org.apache.jasper.compiler.JspRuntimeContext");
        URI locationURI = configurationBaseURL.toURI().resolve(relativeWebAppRoot);
        MockBundleContext bundleContext = new MockBundleContext(getClass().getClassLoader(), locationURI.toString(), new HashMap<Artifact, ConfigurationData>(), null);
        bundle = bundleContext.getBundle();
        ContextSource contextSource = new WebContextSource(Collections.<String, Object>emptyMap(),
                Collections.<String, Object>emptyMap(),
                transactionManager,
                null,
                cl,
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

                null,
                null);
        engine.doStart();

        ServerInfo serverInfo = new BasicServerInfo(".");
        MockBundleContext bundleContext = new MockBundleContext(getClass().getClassLoader(), "", new HashMap<Artifact, ConfigurationData>(), null);
        container = new TomcatContainer(cl,
                bundleContext,
            new File(BASEDIR, "target/var/catalina").toString(), null, null, null, engine, null, serverInfo, null, null);
        container.doStart();
View Full Code Here

        XmlCursor cursor = xmlObject.newCursor();
        cursor.toFirstContentToken();
        xmlObject = cursor.getObject();
        HashMap<String, Artifact> locations = new HashMap<String, Artifact>();
        locations.put(null, Artifact.create("test/foo/1.0/car"));
        BundleContext bundleContext = new MockBundleContext(getClass().getClassLoader(), "", new HashMap<Artifact, ConfigurationData>(), locations);
        DeploymentContext context = new DeploymentContext(new File("."), null, new Environment(Artifact.create("test/foo/1.0/car")), null, ConfigurationModuleType.SERVICE, new Jsr77Naming(), new MockConfigurationManager(), Collections.<Repository>emptySet(), bundleContext);
        context.initializeConfiguration();
        AbstractName parentName = new AbstractName(URI.create("test/foo/1.0/car?name=parent,j2eeType=foo"));
        builder.getReferences(xmlObject, context, parentName, bundleContext.getBundle());
        secBuilder.doStop();
    }
View Full Code Here

        GBeanData ctc = bootstrap.addGBean("ConnectionTrackingCoordinator", ConnectionTrackingCoordinatorGBean.class);
        ctcName = ctc.getAbstractName();
        ctc.setReferencePattern("TransactionManager", tmName);

        ConfigurationUtil.loadBootstrapConfiguration(kernel, bootstrap, new MockBundleContext(getClass().getClassLoader(), null, null, null));

        configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
        configStore = (ConfigurationStore) kernel.getGBean(configStoreName);
        configStore.install(bootstrap);

        defaultEnvironment.addDependency(baseId, ImportType.ALL);
        defaultEnvironment.setConfigId(webModuleArtifact);
        Collection<ModuleBuilderExtension> moduleBuilderExtensions = new ArrayList<ModuleBuilderExtension>();
        GeronimoSecurityBuilderImpl securityBuilder = new GeronimoSecurityBuilderImpl(null, null, null);
        MockBundleContext bundleContext = new MockBundleContext(getClass().getClassLoader(), "", null, null);
        PackageAdmin packageAdmin = new PackageAdmin() {

                @Override
                public ExportedPackage[] getExportedPackages(Bundle bundle) {
                    return new ExportedPackage[0];
                }

                @Override
                public ExportedPackage[] getExportedPackages(String s) {
                    return new ExportedPackage[0];
                }

                @Override
                public ExportedPackage getExportedPackage(String s) {
                    return null;
                }

                @Override
                public void refreshPackages(Bundle[] bundles) {
                }

                @Override
                public boolean resolveBundles(Bundle[] bundles) {
                    return false;
                }

                @Override
                public RequiredBundle[] getRequiredBundles(String s) {
                    return new RequiredBundle[0];
                }

                @Override
                public Bundle[] getBundles(String s, String s1) {
                    return new Bundle[0];
                }

                @Override
                public Bundle[] getFragments(Bundle bundle) {
                    return new Bundle[0];
                }

                @Override
                public Bundle[] getHosts(Bundle bundle) {
                    return new Bundle[0];
                }

                @Override
                public Bundle getBundle(Class aClass) {
                    return null;
                }

                @Override
                public int getBundleType(Bundle bundle) {
                    return 0;
                }
            };
        bundleContext.registerService(PackageAdmin.class.getName(), packageAdmin, null);
        builder = new JettyModuleBuilder(defaultEnvironment,
                new Integer(1800),
                new AbstractNameQuery(containerName),
                //new AbstractNameQuery(containerName),
                new WebAppInfo(),
View Full Code Here

    protected void setUp() throws Exception {
        Artifact artifact = new Artifact("foo", "bar", "1.0", "car");
        Map<String, Artifact> locations = new HashMap<String, Artifact>();
        locations.put(null, artifact);
        BundleContext bundleContext = new MockBundleContext(getClass().getClassLoader(), "", null, locations);
        Artifact id = new Artifact("test", "test", "", "car");
        module  = new ConnectorModule(false, new AbstractName(id, Collections.singletonMap("name", "test")), null, null, null, "foo", null, null, null, null, null);
        ConfigurationManager configurationManager = new MockConfigurationManager();
        EARContext earContext = new EARContext(new File("foo"),
            null,
View Full Code Here

    public void XtestProperties() throws Exception {
        Properties properties = new Properties();
        properties.put("mail.store.protocol", "testStore");
        properties.put("mail.transport.protocol", "testTransport");

        BundleContext bundleContext = new MockBundleContext(getClass().getClassLoader(), "", null, null);
        MailGBean mail = new MailGBean("test:name=mail", null, Boolean.TRUE, properties, null, null, null, null, null, null, null, bundleContext);
        mail.doStart();
        Object proxy = mail.$getResource();

        assertNotNull(proxy);
View Full Code Here

    public void XtestDefaultOverrides() throws Exception {
        Properties properties = new Properties();
        properties.put("mail.store.protocol", "POOKIE");
        properties.put("mail.transport.protocol", "BEAR");

        BundleContext bundleContext = new MockBundleContext(getClass().getClassLoader(), "", null, null);
        MailGBean mail = new MailGBean("test:name=mail", null, Boolean.TRUE, properties, null, "test", "test", null, null, null, null, bundleContext);
        mail.doStart();
        Object proxy = mail.$getResource();

        assertNotNull(proxy);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.kernel.osgi.MockBundleContext$MockServiceRegistration

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.