use of org.talend.daikon.definition.service.DefinitionRegistryService in project components by Talend.
the class OsgiComponentServiceTest method testRegistryServiceDynamicLoadOfComponent.
@Test
public void testRegistryServiceDynamicLoadOfComponent() throws BundleException, MalformedURLException, URISyntaxException {
// inside eclipse the bundle context can be retrieved from the Activator.start method or using the FrameworkUtil
// class.
BundleContext bundleContext = FrameworkUtil.getBundle(getClass()).getBundleContext();
ServiceReference<DefinitionRegistryService> compServiceRef = bundleContext.getServiceReference(DefinitionRegistryService.class);
if (compServiceRef != null) {
DefinitionRegistryService defService = bundleContext.getService(compServiceRef);
assertNotNull(defService);
assertEquals(0, defService.getDefinitionsMapByType(Definition.class).size());
installNewComponentBundle(bundleContext);
assertEquals(1, defService.getDefinitionsMapByType(Definition.class).size());
} else {
fail("Failed to retrieve the Component service");
}
}
use of org.talend.daikon.definition.service.DefinitionRegistryService in project components by Talend.
the class DefintitionRegistryTest method testCreateNewPropertiesWithNestedInjected.
@Test
public void testCreateNewPropertiesWithNestedInjected() {
DefinitionRegistryService registry = new DefinitionRegistry();
TestNestedInjectComponentDefinition def = new TestNestedInjectComponentDefinition();
TestNestedInjectComponentProperties testProps = (TestNestedInjectComponentProperties) registry.createProperties(def, "testProps");
assertThat(testProps.getNestedProperties().getDefinitionRegistry(), equalTo(registry));
}
use of org.talend.daikon.definition.service.DefinitionRegistryService in project components by Talend.
the class DefintitionRegistryTest method testCreateNewPropertiesWithInjected.
@Test
public void testCreateNewPropertiesWithInjected() {
DefinitionRegistryService registry = new DefinitionRegistry();
TestInjectComponentDefinition def = new TestInjectComponentDefinition();
TestInjectComponentProperties testProps = (TestInjectComponentProperties) registry.createProperties(def, "testProps");
assertThat(testProps.getDefinitionRegistry(), equalTo(registry));
}
Aggregations