use of org.guvnor.ala.runtime.providers.ProviderType in project kie-wb-common by kiegroup.
the class InMemoryPipelineRegistryTest method getPipelinesForProvider.
@Test
public void getPipelinesForProvider() {
ProviderType providerType1 = mockProviderTypeSPI("providerType1");
ProviderType providerType2 = mockProviderTypeSPI("providerType2");
List<Pipeline> result = pipelineRegistry.getPipelines(0, 1000, PipelineRegistry.PIPELINE_NAME_SORT, true);
assertTrue(result.isEmpty());
// register pipelines for providerType, providerType1, and providerType2
List<Pipeline> pipelines = mockPipelineList("providerType", ELEMENTS_COUNT);
registerPipelinesForProviderType(pipelines, providerType);
registerPipelinesForProviderType(mockPipelineList("providerType1", ELEMENTS_COUNT), providerType1);
registerPipelinesForProviderType(mockPipelineList("providerType2", ELEMENTS_COUNT), providerType2);
result = pipelineRegistry.getPipelines(0, 1000, PipelineRegistry.PIPELINE_NAME_SORT, true);
assertEquals(3 * ELEMENTS_COUNT, result.size());
result = pipelineRegistry.getPipelines(providerType.getProviderTypeName(), providerType.getVersion(), 0, 1000, PipelineRegistry.PIPELINE_NAME_SORT, true);
assertEquals(pipelines.size(), result.size());
for (Pipeline pipeline : result) {
assertTrue(result.contains(pipeline));
}
}
use of org.guvnor.ala.runtime.providers.ProviderType in project kie-wb-common by kiegroup.
the class InMemoryRuntimeRegistryTest method testGetProvidersByType.
@Test
public void testGetProvidersByType() {
ProviderType providerType1 = mockProviderTypeSPI("ProviderType1");
ProviderType providerType2 = mockProviderTypeSPI("ProviderType2");
List<Provider> providers = mockProviderListSPI(providerType, "1", ELEMENTS_COUNT);
List<Provider> providersForType1 = mockProviderListSPI(providerType1, "2", ELEMENTS_COUNT);
List<Provider> providersForType2 = mockProviderListSPI(providerType2, ELEMENTS_COUNT);
List<Provider> allProviders = new ArrayList<>();
allProviders.addAll(providers);
allProviders.addAll(providersForType1);
allProviders.addAll(providersForType2);
allProviders.forEach(provider -> runtimeRegistry.registerProvider(provider));
List<Provider> result = runtimeRegistry.getProvidersByType(providerType);
assertEquals(providers.size(), result.size());
for (Provider provider : providers) {
assertTrue(result.contains(provider));
}
}
use of org.guvnor.ala.runtime.providers.ProviderType in project kie-wb-common by kiegroup.
the class InMemoryRuntimeRegistryTest method testGetProviderTypes.
@Test
public void testGetProviderTypes() {
List<ProviderType> result = runtimeRegistry.getProviderTypes(0, 1000, RuntimeRegistry.PROVIDER_TYPE_NAME_SORT, true);
assertTrue(result.isEmpty());
List<ProviderType> providerTypes = mockProviderTypeListSPI(ELEMENTS_COUNT);
providerTypes.forEach(providerType -> runtimeRegistry.registerProviderType(providerType));
result = runtimeRegistry.getProviderTypes(0, 1000, RuntimeRegistry.PROVIDER_TYPE_NAME_SORT, true);
for (ProviderType providerType : providerTypes) {
assertTrue(result.contains(providerType));
}
}
Aggregations