Search in sources :

Example 1 with CheckServiceHandlerDescription

use of org.apache.felix.ipojo.runtime.externalhandlers.services.CheckServiceHandlerDescription in project felix by apache.

the class AutoHandlerTest method testInstanceCreation.

@Test
public void testInstanceCreation() throws Exception {
    String v = "org.apache.felix.ipojo.test.handler.checkservice:check";
    System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, v);
    factory.stop();
    factory.restart();
    factory.start();
    instance = factory.createComponentInstance(new Properties());
    assertEquals(ComponentInstance.VALID, instance.getState());
    HandlerDescription hd = instance.getInstanceDescription().getHandlerDescription(v);
    assertNotNull(hd);
    assertTrue(hd instanceof CheckServiceHandlerDescription);
    System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, "");
    factory.stop();
    factory.restart();
    factory.start();
}
Also used : CheckServiceHandlerDescription(org.apache.felix.ipojo.runtime.externalhandlers.services.CheckServiceHandlerDescription) HandlerDescription(org.apache.felix.ipojo.architecture.HandlerDescription) CheckServiceHandlerDescription(org.apache.felix.ipojo.runtime.externalhandlers.services.CheckServiceHandlerDescription) Properties(java.util.Properties) Test(org.junit.Test)

Aggregations

Properties (java.util.Properties)1 HandlerDescription (org.apache.felix.ipojo.architecture.HandlerDescription)1 CheckServiceHandlerDescription (org.apache.felix.ipojo.runtime.externalhandlers.services.CheckServiceHandlerDescription)1 Test (org.junit.Test)1