Package org.apache.geronimo.kernel.osgi

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


        bundle.put("mail.smtp.quitwait", "true");

        SMTPTransportGBean protocol = new SMTPTransportGBean("test:name=smtp", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
        protocol.doStart();

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

        assertNotNull(proxy);
View Full Code Here


        properties.put("mail.pop3.ehlo", "true");

        POP3StoreGBean protocol = new POP3StoreGBean("test:name=pop3", null, null, null, null, null, null, null, null, null, null, null, null, null, null);
        protocol.doStart();

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

        assertNotNull(proxy);
View Full Code Here

        properties.put("mail.imap.ehlo", "true");

        IMAPStoreGBean protocol = new IMAPStoreGBean("test:name=imap", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
        protocol.doStart();

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

View Full Code Here

        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

    protected AbstractName testCE;
    protected AbstractName testRealm;
    private GenericSecurityRealm gsr;

    public void setUp() throws Exception {
        ProxyLoginModule.init(new MockBundleContext(bundle));
        needServerInfo = true;
        needLoginConfiguration = false;
        super.setUp();

        Map<String, Object> props = new HashMap<String, Object>();
View Full Code Here

            "                    </tss:compoundSecMech>\n" +
            "                </tss:compoundSecMechTypeList>\n" +
            "            </tss:tss>";

    public void testCORBABean() throws Exception {
        Bundle bundle = new MockBundleContext(getClass().getClassLoader(), "", null, null).getBundle();
        Naming naming = new Jsr77Naming();
        AbstractName testName = naming.createRootName(new Artifact("test", "stuff", "", "ear"), "gbean", NameFactory.CORBA_SERVICE);
        ConfigAdapter configAdapter = new org.apache.geronimo.yoko.ORBConfigAdapter(bundle);
        CORBABean corbaBean = new CORBABean(testName, configAdapter, "localhost", 8050, getClass().getClassLoader(), null, null);
        XmlObject xmlObject = getXmlObject(TEST_XML4);
View Full Code Here

    private AtomicBoolean isDefault = new AtomicBoolean(false);

    protected void setUp() throws Exception {
        super.setUp();
        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),
                jettyContainerObjectName,
                new WebAppInfo(),
                null,
View Full Code Here

    protected Map<JndiKey, Map<String, Object>> jndiContext;
    protected Module parentModule;

    protected void setUp() throws Exception {
        super.setUp();
        bundleContext = new MockBundleContext(getClass().getClassLoader(), "", new HashMap<Artifact, ConfigurationData>(), locations);
        ((MockBundleContext)bundleContext).setConfigurationManager(new MockConfigurationManager());
        bundleContext.registerService(DependencyManager.class.getName(), new MockDependencyManager(bundleContext, Collections.<Repository> emptyList(), null), new Hashtable());
        Set<Artifact> repo = new HashSet<Artifact>();
        repo.add(Artifact.create("org.apache.geronimo.tests/test/1/car"));
        repository = new MockRepository(repo);
View Full Code Here

         * 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

        return new AbstractName(new Artifact("test", "foo", "1", "car"), names, objectName);
    }

    protected void setUp() throws Exception {
        super.setUp();
        BundleContext bundleContext = new MockBundleContext(getClass().getClassLoader(), "", new HashMap<Artifact, ConfigurationData>(), null);
        kernel = KernelFactory.newInstance(bundleContext).createKernel(DOMAIN);
        kernel.boot();

        // server info
        SERVER_INFO_DATA.setAttribute("baseDirectory", System.getProperty("java.io.tmpdir"));
View Full Code Here

TOP

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

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.