Search in sources :

Example 16 with ProviderTypeKey

use of org.guvnor.ala.ui.model.ProviderTypeKey in project kie-wb-common by kiegroup.

the class AbstractProviderHandlerRegistryTest method createExpectedKeys.

protected List<ProviderTypeKey> createExpectedKeys() {
    List<ProviderTypeKey> keys = new ArrayList<>();
    for (int i = 0; i < COUNT; i++) {
        ProviderTypeKey key = mock(ProviderTypeKey.class);
        keys.add(key);
    }
    return keys;
}
Also used : ArrayList(java.util.ArrayList) ProviderTypeKey(org.guvnor.ala.ui.model.ProviderTypeKey)

Example 17 with ProviderTypeKey

use of org.guvnor.ala.ui.model.ProviderTypeKey in project kie-wb-common by kiegroup.

the class AbstractProviderHandlerRegistryTest method testGetProvidersHandler.

@Test
public void testGetProvidersHandler() {
    for (int i = 0; i < expectedKeys.size(); i++) {
        ProviderTypeKey key = expectedKeys.get(i);
        assertNotNull(handlerRegistry.isProviderInstalled(key));
        ProviderHandler handler = handlerRegistry.getProviderHandler(key);
        assertEquals(expectedHandlers.get(i), handler);
    }
}
Also used : ProviderTypeKey(org.guvnor.ala.ui.model.ProviderTypeKey) Test(org.junit.Test)

Example 18 with ProviderTypeKey

use of org.guvnor.ala.ui.model.ProviderTypeKey in project kie-wb-common by kiegroup.

the class AbstractProviderHandlerRegistryTest method testGetProviderHandlerMissing.

@Test
public void testGetProviderHandlerMissing() {
    ProviderTypeKey providerTypeKey = mock(ProviderTypeKey.class);
    assertNull(handlerRegistry.getProviderHandler(providerTypeKey));
}
Also used : ProviderTypeKey(org.guvnor.ala.ui.model.ProviderTypeKey) Test(org.junit.Test)

Example 19 with ProviderTypeKey

use of org.guvnor.ala.ui.model.ProviderTypeKey in project kie-wb-common by kiegroup.

the class BaseProviderHandlerTest method expectedProviderType.

protected ProviderTypeKey expectedProviderType() {
    ProviderTypeKey providerTypeKey = mock(ProviderTypeKey.class);
    when(providerTypeKey.getId()).thenReturn(getProviderTypeName());
    return providerTypeKey;
}
Also used : ProviderTypeKey(org.guvnor.ala.ui.model.ProviderTypeKey)

Example 20 with ProviderTypeKey

use of org.guvnor.ala.ui.model.ProviderTypeKey in project kie-wb-common by kiegroup.

the class ProviderTypeServiceImpl method getAvailableProviderTypes.

@Override
public Collection<ProviderType> getAvailableProviderTypes() {
    List<ProviderType> result = new ArrayList<>();
    List<org.guvnor.ala.runtime.providers.ProviderType> providers = runtimeProvisioningService.getProviderTypes(0, 100, PROVIDER_TYPE_NAME_SORT, true);
    if (providers != null) {
        providers.forEach(providerType -> result.add(new ProviderType(new ProviderTypeKey(providerType.getProviderTypeName(), providerType.getVersion()), providerType.getProviderTypeName())));
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) ProviderType(org.guvnor.ala.ui.model.ProviderType) ProviderTypeKey(org.guvnor.ala.ui.model.ProviderTypeKey)

Aggregations

ProviderTypeKey (org.guvnor.ala.ui.model.ProviderTypeKey)29 Test (org.junit.Test)18 ProviderKey (org.guvnor.ala.ui.model.ProviderKey)14 Provider (org.guvnor.ala.ui.model.Provider)8 ProviderType (org.guvnor.ala.ui.model.ProviderType)7 Input (org.guvnor.ala.pipeline.Input)4 Before (org.junit.Before)4 ArrayList (java.util.ArrayList)3 ProvisioningManagementTestCommons.mockProviderTypeKey (org.guvnor.ala.ui.ProvisioningManagementTestCommons.mockProviderTypeKey)3 PipelineKey (org.guvnor.ala.ui.model.PipelineKey)3 Map (java.util.Map)2 RuntimeQueryResultItem (org.guvnor.ala.services.api.RuntimeQueryResultItem)2 ProviderTypeSelectedEvent (org.guvnor.ala.ui.client.events.ProviderTypeSelectedEvent)2 AbstractProviderHandlerRegistryTest (org.guvnor.ala.ui.handler.AbstractProviderHandlerRegistryTest)2 ProviderConfiguration (org.guvnor.ala.ui.model.ProviderConfiguration)2 ProvidersInfo (org.guvnor.ala.ui.model.ProvidersInfo)2 Runtime (org.guvnor.ala.ui.model.Runtime)2 RuntimeKey (org.guvnor.ala.ui.model.RuntimeKey)2 RuntimeListItem (org.guvnor.ala.ui.model.RuntimeListItem)2 RuntimeQuery (org.guvnor.ala.services.api.RuntimeQuery)1