use of org.talend.components.api.service.common.DefinitionRegistry in project components by Talend.
the class MarkLogicInputTestBase method getDefinitionRegistry.
@Override
public DefinitionRegistryService getDefinitionRegistry() {
if (definitionRegistry == null) {
definitionRegistry = new DefinitionRegistry();
definitionRegistry.registerComponentFamilyDefinition(new MarkLogicFamilyDefinition());
}
return definitionRegistry;
}
use of org.talend.components.api.service.common.DefinitionRegistry in project components by Talend.
the class ServiceSpiFactoryTest method testGetComponentService.
@Test
public void testGetComponentService() throws Exception {
ComponentService cs = ServiceSpiFactory.getComponentService();
assertThat(cs, not(nullValue()));
DefinitionRegistry defReg = ServiceSpiFactory.getDefinitionRegistry();
assertThat(cs, not(nullValue()));
Map<String, ComponentFamilyDefinition> families = defReg.getComponentFamilies();
assertThat(families, hasEntry(is("LocalIO"), isA((Class) LocalIOComponentFamilyDefinition.class)));
assertThat(families, hasEntry(is("SimpleFileIo"), isA((Class) SimpleFileIOComponentFamilyDefinition.class)));
Map<String, Definition> definitions = defReg.getDefinitions();
assertThat(definitions, hasEntry(is("FixedFlowInput"), isA((Class) FixedFlowInputDefinition.class)));
assertThat(definitions, hasEntry(is("SimpleFileIoDatastore"), isA((Class) SimpleFileIODatastoreDefinition.class)));
assertThat(definitions, hasEntry(is("SimpleFileIoDataset"), isA((Class) SimpleFileIODatasetDefinition.class)));
assertThat(definitions, hasEntry(is("SimpleFileIoInput"), isA((Class) SimpleFileIOInputDefinition.class)));
assertThat(definitions, hasEntry(is("SimpleFileIoOutput"), isA((Class) SimpleFileIOOutputDefinition.class)));
}
use of org.talend.components.api.service.common.DefinitionRegistry in project components by Talend.
the class ServiceSpiFactoryTest method testCreateClassLoaderService.
@Test
public void testCreateClassLoaderService() throws MalformedURLException {
// this will check that create a new registry with the new url
// given
DefinitionRegistry definitionRegistry = ServiceSpiFactory.getDefinitionRegistry();
assertThat(definitionRegistry.getComponentFamilies(), not(hasKey(is("MultiRuntimeExample"))));
// when
DefinitionRegistry definitionRegistry2 = ServiceSpiFactory.createDefinitionRegistry(new URL[] { new URL("mvn:org.talend.components/multiple-runtime-comp/0.18.0") });
// then
assertThat(definitionRegistry2.getComponentFamilies(), hasKey(is("MultiRuntimeExample")));
assertThat(definitionRegistry, not(equalTo(definitionRegistry2)));
// this will check that same registry is returned if no classpath is passed
assertThat(definitionRegistry2, equalTo(ServiceSpiFactory.createDefinitionRegistry(null)));
assertThat(definitionRegistry2, equalTo(ServiceSpiFactory.createDefinitionRegistry(new URL[0])));
}
use of org.talend.components.api.service.common.DefinitionRegistry in project components by Talend.
the class AzureStorageBaseTestIT method getComponentService.
// default implementation for pure java test. Shall be overriden of Spring or OSGI tests
public ComponentService getComponentService() {
if (componentService == null) {
DefinitionRegistry testComponentRegistry = new DefinitionRegistry();
// register component
testComponentRegistry.registerComponentFamilyDefinition(new AzureStorageFamilyDefinition());
componentService = new ComponentServiceImpl(testComponentRegistry);
}
return componentService;
}
use of org.talend.components.api.service.common.DefinitionRegistry in project components by Talend.
the class SalesforceTestBase method getComponentService.
// default implementation for pure java test. Shall be overriden of Spring or OSGI tests
@Override
public ComponentService getComponentService() {
if (componentService == null) {
DefinitionRegistry testComponentRegistry = new DefinitionRegistry();
// register component
testComponentRegistry.registerComponentFamilyDefinition(new SalesforceFamilyDefinition());
componentService = new ComponentServiceImpl(testComponentRegistry);
}
return componentService;
}
Aggregations