Package org.apache.felix.ipojo.runtime.core.services

Examples of org.apache.felix.ipojo.runtime.core.services.CheckService.map()


        BundleContext context = (BundleContext) check.map().get("context");
        assertNotNull(context);
        assertEquals(getTestBundle().getSymbolicName(), context.getBundle().getSymbolicName());

        assertEquals("hello", check.map().get("message"));
    }

    @Test
    public void testWhenPropertyIsLast() {
        BundleContext bc = osgiHelper.getBundle("org.apache.felix.ipojo").getBundleContext();
View Full Code Here


                ".components.mix.MixWithProperties2", configuration);

        CheckService check = ipojoHelper.getServiceObjectByName(CheckService.class, instance.getInstanceName());
        assertNotNull(check);

        BundleContext context = (BundleContext) check.map().get("context");
        assertNotNull(context);
        assertEquals(getTestBundle().getSymbolicName(), context.getBundle().getSymbolicName());

        assertEquals("hello", check.map().get("message"));
    }
View Full Code Here

        BundleContext context = (BundleContext) check.map().get("context");
        assertNotNull(context);
        assertEquals(getTestBundle().getSymbolicName(), context.getBundle().getSymbolicName());

        assertEquals("hello", check.map().get("message"));
    }

}
View Full Code Here

    public void testFieldInjectionOfComponentBundleContext() {
        ComponentInstance instance = ipojoHelper.createComponentInstance("org.apache.felix.ipojo.runtime.core" +
                ".components.annotations.ComponentBundleContextInjectionInField");
        CheckService check = ipojoHelper.getServiceObjectByName(CheckService.class, instance.getInstanceName());
        assertNotNull(check);
        BundleContext context = (BundleContext) check.map().get("context");
        assertNotNull(context);
        assertEquals(getTestBundle().getSymbolicName(), context.getBundle().getSymbolicName());
    }

    @Test
View Full Code Here

        ComponentInstance instance = ipojoHelper.createComponentInstance("org.apache.felix.ipojo.runtime.core" +
                ".components.annotations.InstanceBundleContextInjectionInField", configuration);

        CheckService check = ipojoHelper.getServiceObjectByName(CheckService.class, instance.getInstanceName());
        assertNotNull(check);
        BundleContext context = (BundleContext) check.map().get("context");
        assertNotNull(context);
        assertEquals(bc, context);
    }

    @Test
View Full Code Here

    public void testMethodInjectionOfComponentBundleContext() {
        ComponentInstance instance = ipojoHelper.createComponentInstance("org.apache.felix.ipojo.runtime.core" +
                ".components.annotations.ComponentBundleContextInjectionInMethod");
        CheckService check = ipojoHelper.getServiceObjectByName(CheckService.class, instance.getInstanceName());
        assertNotNull(check);
        BundleContext context = (BundleContext) check.map().get("context");
        assertNotNull(context);
        assertEquals(getTestBundle().getSymbolicName(), context.getBundle().getSymbolicName());
    }

    @Test
View Full Code Here

        ComponentInstance instance = ipojoHelper.createComponentInstance("org.apache.felix.ipojo.runtime.core" +
                ".components.annotations.InstanceBundleContextInjectionInMethod", configuration);

        CheckService check = ipojoHelper.getServiceObjectByName(CheckService.class, instance.getInstanceName());
        assertNotNull(check);
        BundleContext context = (BundleContext) check.map().get("context");
        assertNotNull(context);
        assertEquals(bc, context);
    }

    @Test
View Full Code Here

    public void testConstructorInjectionOfComponentBundleContext() {
        ComponentInstance instance = ipojoHelper.createComponentInstance("org.apache.felix.ipojo.runtime.core" +
                ".components.annotations.ComponentBundleContextInjectionInConstructor");
        CheckService check = ipojoHelper.getServiceObjectByName(CheckService.class, instance.getInstanceName());
        assertNotNull(check);
        BundleContext context = (BundleContext) check.map().get("context");
        assertNotNull(context);
        assertEquals(getTestBundle().getSymbolicName(), context.getBundle().getSymbolicName());
    }

    @Test
View Full Code Here

        ComponentInstance instance = ipojoHelper.createComponentInstance("org.apache.felix.ipojo.runtime.core" +
                ".components.annotations.InstanceBundleContextInjectionInConstructor", configuration);

        CheckService check = ipojoHelper.getServiceObjectByName(CheckService.class, instance.getInstanceName());
        assertNotNull(check);
        BundleContext context = (BundleContext) check.map().get("context");
        assertNotNull(context);
        assertEquals(bc, context);
    }

}
View Full Code Here

    @Test
    public void testFieldInjectionOfComponentBundleContextUsingXML() {
        ComponentInstance instance = ipojoHelper.createComponentInstance("CTX-Field-Component");
        CheckService check = ipojoHelper.getServiceObjectByName(CheckService.class, instance.getInstanceName());
        assertNotNull(check);
        BundleContext context = (BundleContext) check.map().get("context");
        assertNotNull(context);
        assertEquals(getTestBundle().getSymbolicName(), context.getBundle().getSymbolicName());
    }

    @Test
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.