Examples of FooProviderType1


Examples of org.apache.felix.ipojo.runtime.core.components.FooProviderType1

     * Test a custom constructor.
     * Not manipulated.
     */
    @Test
    public void testCustomConstuctor() {
        FooService fs = new FooProviderType1(0, "foo", bc);
        Properties props = fs.fooProps();
        assertEquals("Check bar", 0, ((Integer) props.get("bar")).intValue());
        assertEquals("Check foo", "foo", props.get("foo"));
        assertEquals("Check context", bc, props.get("context"));
    }
View Full Code Here

Examples of org.apache.felix.ipojo.runtime.core.components.FooProviderType1

     */
    @Test
    public void testException() {
        ServiceReference ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy.getInstanceName());
        assertNotNull("Check that a FooService from " + ci_lazzy.getInstanceName() + " is available", ref);
        FooProviderType1 fs = (FooProviderType1) osgiHelper.getServiceObject(ref);
        try {
            fs.testException();
            fail("The method must returns an exception");
        } catch (Exception e) {
            // OK
        }
    }
View Full Code Here

Examples of org.apache.felix.ipojo.runtime.core.components.FooProviderType1

     */
    @Test
    public void testTry() {
        ServiceReference ref = ipojoHelper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy.getInstanceName());
        assertNotNull("Check that a FooService from " + ci_lazzy.getInstanceName() + " is available", ref);
        FooProviderType1 fs = (FooProviderType1) osgiHelper.getServiceObject(ref);
        try {
            fs.testTry();
        } catch (Exception e) {
            fail("The method has returned an exception");
        }
    }
View Full Code Here

Examples of org.apache.felix.ipojo.test.scenarios.component.FooProviderType1

     * Check that the exception is correctly propagated.
     */
    public void testException() {
        ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy.getInstanceName());
        assertNotNull("Check that a FooService from " + ci_lazzy.getInstanceName() + " is available",ref);
        FooProviderType1 fs = (FooProviderType1) getServiceObject(ref);
        try {
            fs.testException();
            fail("The method must returns an exception");
        } catch(Exception e) {
            // OK
        }
    }
View Full Code Here

Examples of org.apache.felix.ipojo.test.scenarios.component.FooProviderType1

     * Check that the exception is correctly catch by the POJO.
     */
    public void testTry() {
        ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy.getInstanceName());
        assertNotNull("Check that a FooService from " + ci_lazzy.getInstanceName() + " is available",ref);
        FooProviderType1 fs = (FooProviderType1) getServiceObject(ref);
        try {
            fs.testTry();
        } catch(Exception e) {
            fail("The method has returned an exception");
        }
    }
View Full Code Here

Examples of org.apache.felix.ipojo.test.scenarios.component.FooProviderType1

    /**
     * Test a custom constructor.
     * Not manipulated.
     */
    public void testCustomConstuctor() {
        FooService fs = new FooProviderType1(0, "foo", getContext());
        Properties props = fs.fooProps();
        assertEquals("Check bar", 0, ((Integer) props.get("bar")).intValue());
        assertEquals("Check foo", "foo", props.get("foo"));
        assertEquals("Check context", getContext(), props.get("context"));
    }
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.