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

Examples of org.apache.felix.ipojo.runtime.core.test.services.Setter


                ".components.FooConsumer");

        // The provider is rejected => Invalid instance
        assertThat(instance.getState()).isEqualTo(ComponentInstance.INVALID);

        Setter setter = osgiHelper.getServiceObject(Setter.class, null);
        setter.set("toto");

        // The provider is now accepted
        assertThat(instance.getState()).isEqualTo(ComponentInstance.VALID);
    }
View Full Code Here


                ".interceptors.HidingTrackingInterceptor", configuration);

        // The provider is rejected => Invalid instance
        assertThat(instance.getState()).isEqualTo(ComponentInstance.INVALID);

        Setter setter = osgiHelper.getServiceObject(Setter.class, null);
        setter.set("toto");

        // The provider is now accepted
        assertThat(instance.getState()).isEqualTo(ComponentInstance.VALID);

        setter.set("hidden");

        // The provider is rejected => Invalid instance
        assertThat(instance.getState()).isEqualTo(ComponentInstance.INVALID);

        interceptor.dispose();
View Full Code Here

        provider6.dispose();

        assertThat(check.getProps().get("grade")).isEqualTo(4);

        // Change range
        Setter setter = osgiHelper.getServiceObject(Setter.class);
        setter.set("LOW REVERSE");
        assertThat(check.getProps().get("grade")).isEqualTo(0);
    }
View Full Code Here

        // Check we are using provider 2
        osgiHelper.waitForService(CheckService.class.getName(), null, 1000, true);
        CheckService check = osgiHelper.getServiceObject(CheckService.class);
        assertThat(check.getProps().get("grade")).isEqualTo(1);

        Setter setter = osgiHelper.getServiceObject(Setter.class);
        setter.set("true");

        assertThat(check.getProps().get("grade")).isEqualTo(0);
    }
View Full Code Here

        @SuppressWarnings("unchecked") Map<String, ?> props1 = (Map<String, ?>) cs1.getProps().get("props");
        @SuppressWarnings("unchecked") Map<String, ?> props2 = (Map<String, ?>) cs2.getProps().get("props");
        assertThat(props1.get("location")).isEqualTo("kitchen");
        assertThat(props2.get("location")).isEqualTo("kitchen");

        Setter setter = osgiHelper.getServiceObject(Setter.class, null);
        setter.set("bedroom");

        props1 = (Map<String, ?>) cs1.getProps().get("props");
        props2 = (Map<String, ?>) cs2.getProps().get("props");
        assertThat(props1.get("location")).isEqualTo("bedroom");
        assertThat(props2.get("location")).isEqualTo("bedroom");
View Full Code Here

TOP

Related Classes of org.apache.felix.ipojo.runtime.core.test.services.Setter

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.