Examples of MockBundleContext


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

        // On windows, this does not begin with a "/", so don't chop off the drive letter
        String baseLocation = dir.getAbsolutePath();
        if (baseLocation.startsWith("/")) {
            baseLocation = baseLocation.substring(1);
        }
        bundleContext = new MockBundleContext(getClass().getClassLoader(), BASEDIR.getAbsolutePath(), null, Collections.singletonMap(baseLocation, NEW_ID));
        ((MockBundleContext)bundleContext).setConfigurationManager(new MockConfigurationManager());
        bundleContext.registerService(DependencyManager.class.getName(), new MockDependencyManager(bundleContext, Collections.<Repository> emptyList(), null), new Hashtable());
        File someFile = new File(dir, "someFile");
        someFile.createNewFile();
View Full Code Here

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

    protected void setUp() throws Exception {
        super.setUp();
        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

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

    private WebServiceBuilder webServiceBuilder = null;
    private Environment defaultEnvironment = new Environment();
    private TomcatModuleBuilder builder;

    protected void setUp() throws Exception {
        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 TomcatModuleBuilder(defaultEnvironment,
                tomcatContainerObjectName,
                new WebAppInfo(),
                null,
                Collections.singleton(webServiceBuilder),
View Full Code Here

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

    }

    protected void setUp() throws Exception {
        super.setUp();
        J2eeContext j2eeContext = new J2eeContextImpl("test.domain", "geronimo.server", "testapp", NameFactory.RESOURCE_ADAPTER_MODULE, "testmodule", TARGET_NAME, NameFactory.JMS_RESOURCE);
        BundleContext bundleContext = new MockBundleContext(getClass().getClassLoader(), "", null, null);
        kernel = KernelFactory.newInstance(bundleContext).createKernel(j2eeContext.getJ2eeDomainName());
        kernel.boot();

        GBeanData aow = buildGBeanData("name", TARGET_NAME, AdminObjectWrapperGBean.class);
        selfName = aow.getAbstractName();
View Full Code Here

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

        assertSame(cm, cm2);
    }

    protected void setUp() throws Exception {
        super.setUp();
        BundleContext bundleContext = new MockBundleContext(getClass().getClassLoader(), "", null, null);
        kernel = KernelFactory.newInstance(bundleContext).createKernel(KERNEL_NAME);
        kernel.boot();
        ClassLoader cl = MockConnectionTrackingCoordinator.class.getClassLoader();

        GBeanData ctc = buildGBeanData("name", "ConnectionTrackingCoordinator", MockConnectionTrackingCoordinator.class);
View Full Code Here

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

    private boolean runExternalWSTest;

    protected void setUp() throws Exception {
        super.setUp();
        Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
        bundleContext = new MockBundleContext(getClass().getClassLoader(), "", null, null);
        tmpbasedir = File.createTempFile("car", "tmp");
        tmpbasedir.delete();
        tmpbasedir.mkdirs();
        environment.setConfigId(configID);
        Jsr77Naming naming = new Jsr77Naming();
View Full Code Here

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

    final static GReferenceInfo refInfo = new GReferenceInfo("reference", String.class.getName(), String.class.getName(), "setReference", "Fooifier");

    public void setUp() throws Exception {
        super.setUp();
        bundleContext = new MockBundleContext(getClass().getClassLoader(), BASEDIR.getAbsolutePath(), null, null);
        gbeanInfo = MockGBean.getGBeanInfo();
    }
View Full Code Here

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

    protected void setUp() throws Exception {
        super.setUp();
        Artifact artifact = new Artifact("foo", "bar", "1.0", "car");
        Map<String, Artifact> locations = new HashMap<String, Artifact>();
        locations.put(null, artifact);
        bundleContext = new MockBundleContext(getClass().getClassLoader(), "", null, locations);
        PackageAdmin packageAdmin = new PackageAdmin() {

                @Override
                public ExportedPackage[] getExportedPackages(Bundle bundle) {
                    return new ExportedPackage[0];
View Full Code Here

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

        ServerInfo serverInfo = new BasicServerInfo(".");
        String location = configurationBaseURL.toString();
        if (appPath != null) {
            location = configurationBaseURL.toURI().resolve(appPath).toString();
        }
        MockBundleContext bundleContext = new MockBundleContext(cl, location, new HashMap<Artifact, ConfigurationData>(), null);
        bundle = bundleContext.getBundle();
        container = new JettyContainerImpl("test:name=JettyContainer",
                bundleContext,
            null, new File(BASEDIR, "target/var/jetty").toString(), serverInfo);
        container.doStart();
        connector = new HTTPSocketConnector(container, null);
View Full Code Here

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

        //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
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.