Search in sources :

Example 6 with InstanceBuilder

use of org.apache.felix.ipojo.extender.InstanceBuilder in project felix by apache.

the class DefaultInstanceBuilderTestCase method testDeepConfiguration.

public void testDeepConfiguration() throws Exception {
    InstanceBuilder builder = new DefaultInstanceBuilder(m_bundleContext, "type");
    assertNotNull(builder.configure());
}
Also used : InstanceBuilder(org.apache.felix.ipojo.extender.InstanceBuilder)

Example 7 with InstanceBuilder

use of org.apache.felix.ipojo.extender.InstanceBuilder in project felix by apache.

the class DefaultInstanceBuilderTestCase method testNoConfiguration.

public void testNoConfiguration() throws Exception {
    InstanceBuilder builder = new DefaultInstanceBuilder(m_bundleContext, "type");
    DeclarationHandle handle = builder.build();
    InstanceDeclaration did = (InstanceDeclaration) handle;
    assertEquals("type", did.getComponentName());
    assertEquals(InstanceDeclaration.UNNAMED_INSTANCE, did.getInstanceName());
    assertNull(did.getComponentVersion());
    Dictionary<String, Object> configuration = did.getConfiguration();
    assertTrue(configuration.isEmpty());
}
Also used : DefaultInstanceDeclaration(org.apache.felix.ipojo.extender.internal.declaration.DefaultInstanceDeclaration) InstanceDeclaration(org.apache.felix.ipojo.extender.InstanceDeclaration) DeclarationHandle(org.apache.felix.ipojo.extender.DeclarationHandle) InstanceBuilder(org.apache.felix.ipojo.extender.InstanceBuilder)

Aggregations

InstanceBuilder (org.apache.felix.ipojo.extender.InstanceBuilder)7 DeclarationHandle (org.apache.felix.ipojo.extender.DeclarationHandle)5 DefaultInstanceDeclaration (org.apache.felix.ipojo.extender.internal.declaration.DefaultInstanceDeclaration)4 InstanceDeclaration (org.apache.felix.ipojo.extender.InstanceDeclaration)3 Dictionary (java.util.Dictionary)1