target
stringlengths 20
113k
| src_fm
stringlengths 11
86.3k
| src_fm_fc
stringlengths 21
86.4k
| src_fm_fc_co
stringlengths 30
86.4k
| src_fm_fc_ms
stringlengths 42
86.8k
| src_fm_fc_ms_ff
stringlengths 43
86.8k
|
---|---|---|---|---|---|
@Test public void testGetRuntimesInfoProviderExisting() { when(providerService.getProvider(providerKey)).thenReturn(provider); when(runtimeService.getRuntimeItems(providerKey)).thenReturn(runtimeListItems); RuntimesInfo info = service.getRuntimesInfo(providerKey); assertNotNull(info); assertEquals(provider, info.getProvider()); assertEquals(runtimeListItems, info.getRuntimeItems()); verify(providerService, times(1)).getProvider(providerKey); verify(runtimeService, times(1)).getRuntimeItems(providerKey); }
|
@Override public RuntimesInfo getRuntimesInfo(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); final Provider provider = providerService.getProvider(providerKey); if (provider == null) { return null; } final Collection<RuntimeListItem> items = runtimeService.getRuntimeItems(providerKey); return new RuntimesInfo(provider, items); }
|
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public RuntimesInfo getRuntimesInfo(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); final Provider provider = providerService.getProvider(providerKey); if (provider == null) { return null; } final Collection<RuntimeListItem> items = runtimeService.getRuntimeItems(providerKey); return new RuntimesInfo(provider, items); } }
|
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public RuntimesInfo getRuntimesInfo(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); final Provider provider = providerService.getProvider(providerKey); if (provider == null) { return null; } final Collection<RuntimeListItem> items = runtimeService.getRuntimeItems(providerKey); return new RuntimesInfo(provider, items); } ProvisioningScreensServiceImpl(); @Inject ProvisioningScreensServiceImpl(final ProviderTypeService providerTypeService,
final ProviderService providerService,
final RuntimeService runtimeService); }
|
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public RuntimesInfo getRuntimesInfo(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); final Provider provider = providerService.getProvider(providerKey); if (provider == null) { return null; } final Collection<RuntimeListItem> items = runtimeService.getRuntimeItems(providerKey); return new RuntimesInfo(provider, items); } ProvisioningScreensServiceImpl(); @Inject ProvisioningScreensServiceImpl(final ProviderTypeService providerTypeService,
final ProviderService providerService,
final RuntimeService runtimeService); @Override ProvidersInfo getProvidersInfo(final ProviderTypeKey providerTypeKey); @Override RuntimesInfo getRuntimesInfo(final ProviderKey providerKey); @Override boolean hasRuntimes(final ProviderKey providerKey); }
|
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public RuntimesInfo getRuntimesInfo(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); final Provider provider = providerService.getProvider(providerKey); if (provider == null) { return null; } final Collection<RuntimeListItem> items = runtimeService.getRuntimeItems(providerKey); return new RuntimesInfo(provider, items); } ProvisioningScreensServiceImpl(); @Inject ProvisioningScreensServiceImpl(final ProviderTypeService providerTypeService,
final ProviderService providerService,
final RuntimeService runtimeService); @Override ProvidersInfo getProvidersInfo(final ProviderTypeKey providerTypeKey); @Override RuntimesInfo getRuntimesInfo(final ProviderKey providerKey); @Override boolean hasRuntimes(final ProviderKey providerKey); }
|
@Test public void testGetRuntimesInfoProviderNotExisting() { when(providerService.getProvider(providerKey)).thenReturn(null); RuntimesInfo info = service.getRuntimesInfo(providerKey); assertNull(info); verify(providerService, times(1)).getProvider(providerKey); verify(runtimeService, never()).getRuntimeItems(providerKey); }
|
@Override public RuntimesInfo getRuntimesInfo(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); final Provider provider = providerService.getProvider(providerKey); if (provider == null) { return null; } final Collection<RuntimeListItem> items = runtimeService.getRuntimeItems(providerKey); return new RuntimesInfo(provider, items); }
|
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public RuntimesInfo getRuntimesInfo(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); final Provider provider = providerService.getProvider(providerKey); if (provider == null) { return null; } final Collection<RuntimeListItem> items = runtimeService.getRuntimeItems(providerKey); return new RuntimesInfo(provider, items); } }
|
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public RuntimesInfo getRuntimesInfo(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); final Provider provider = providerService.getProvider(providerKey); if (provider == null) { return null; } final Collection<RuntimeListItem> items = runtimeService.getRuntimeItems(providerKey); return new RuntimesInfo(provider, items); } ProvisioningScreensServiceImpl(); @Inject ProvisioningScreensServiceImpl(final ProviderTypeService providerTypeService,
final ProviderService providerService,
final RuntimeService runtimeService); }
|
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public RuntimesInfo getRuntimesInfo(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); final Provider provider = providerService.getProvider(providerKey); if (provider == null) { return null; } final Collection<RuntimeListItem> items = runtimeService.getRuntimeItems(providerKey); return new RuntimesInfo(provider, items); } ProvisioningScreensServiceImpl(); @Inject ProvisioningScreensServiceImpl(final ProviderTypeService providerTypeService,
final ProviderService providerService,
final RuntimeService runtimeService); @Override ProvidersInfo getProvidersInfo(final ProviderTypeKey providerTypeKey); @Override RuntimesInfo getRuntimesInfo(final ProviderKey providerKey); @Override boolean hasRuntimes(final ProviderKey providerKey); }
|
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public RuntimesInfo getRuntimesInfo(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); final Provider provider = providerService.getProvider(providerKey); if (provider == null) { return null; } final Collection<RuntimeListItem> items = runtimeService.getRuntimeItems(providerKey); return new RuntimesInfo(provider, items); } ProvisioningScreensServiceImpl(); @Inject ProvisioningScreensServiceImpl(final ProviderTypeService providerTypeService,
final ProviderService providerService,
final RuntimeService runtimeService); @Override ProvidersInfo getProvidersInfo(final ProviderTypeKey providerTypeKey); @Override RuntimesInfo getRuntimesInfo(final ProviderKey providerKey); @Override boolean hasRuntimes(final ProviderKey providerKey); }
|
@Test public void testHasRuntimesTrue() { Collection<RuntimeListItem> runtimes = mock(Collection.class); when(runtimeService.getRuntimeItems(providerKey)).thenReturn(runtimes); when(runtimes.isEmpty()).thenReturn(false); assertTrue(service.hasRuntimes(providerKey)); verify(runtimeService, times(1)).getRuntimeItems(providerKey); }
|
@Override public boolean hasRuntimes(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); return !runtimeService.getRuntimeItems(providerKey).isEmpty(); }
|
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public boolean hasRuntimes(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); return !runtimeService.getRuntimeItems(providerKey).isEmpty(); } }
|
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public boolean hasRuntimes(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); return !runtimeService.getRuntimeItems(providerKey).isEmpty(); } ProvisioningScreensServiceImpl(); @Inject ProvisioningScreensServiceImpl(final ProviderTypeService providerTypeService,
final ProviderService providerService,
final RuntimeService runtimeService); }
|
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public boolean hasRuntimes(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); return !runtimeService.getRuntimeItems(providerKey).isEmpty(); } ProvisioningScreensServiceImpl(); @Inject ProvisioningScreensServiceImpl(final ProviderTypeService providerTypeService,
final ProviderService providerService,
final RuntimeService runtimeService); @Override ProvidersInfo getProvidersInfo(final ProviderTypeKey providerTypeKey); @Override RuntimesInfo getRuntimesInfo(final ProviderKey providerKey); @Override boolean hasRuntimes(final ProviderKey providerKey); }
|
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public boolean hasRuntimes(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); return !runtimeService.getRuntimeItems(providerKey).isEmpty(); } ProvisioningScreensServiceImpl(); @Inject ProvisioningScreensServiceImpl(final ProviderTypeService providerTypeService,
final ProviderService providerService,
final RuntimeService runtimeService); @Override ProvidersInfo getProvidersInfo(final ProviderTypeKey providerTypeKey); @Override RuntimesInfo getRuntimesInfo(final ProviderKey providerKey); @Override boolean hasRuntimes(final ProviderKey providerKey); }
|
@Test public void testHasRuntimesFalse() { Collection<RuntimeListItem> runtimes = mock(Collection.class); when(runtimeService.getRuntimeItems(providerKey)).thenReturn(runtimes); when(runtimes.isEmpty()).thenReturn(true); assertFalse(service.hasRuntimes(providerKey)); verify(runtimeService, times(1)).getRuntimeItems(providerKey); }
|
@Override public boolean hasRuntimes(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); return !runtimeService.getRuntimeItems(providerKey).isEmpty(); }
|
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public boolean hasRuntimes(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); return !runtimeService.getRuntimeItems(providerKey).isEmpty(); } }
|
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public boolean hasRuntimes(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); return !runtimeService.getRuntimeItems(providerKey).isEmpty(); } ProvisioningScreensServiceImpl(); @Inject ProvisioningScreensServiceImpl(final ProviderTypeService providerTypeService,
final ProviderService providerService,
final RuntimeService runtimeService); }
|
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public boolean hasRuntimes(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); return !runtimeService.getRuntimeItems(providerKey).isEmpty(); } ProvisioningScreensServiceImpl(); @Inject ProvisioningScreensServiceImpl(final ProviderTypeService providerTypeService,
final ProviderService providerService,
final RuntimeService runtimeService); @Override ProvidersInfo getProvidersInfo(final ProviderTypeKey providerTypeKey); @Override RuntimesInfo getRuntimesInfo(final ProviderKey providerKey); @Override boolean hasRuntimes(final ProviderKey providerKey); }
|
ProvisioningScreensServiceImpl implements ProvisioningScreensService { @Override public boolean hasRuntimes(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); return !runtimeService.getRuntimeItems(providerKey).isEmpty(); } ProvisioningScreensServiceImpl(); @Inject ProvisioningScreensServiceImpl(final ProviderTypeService providerTypeService,
final ProviderService providerService,
final RuntimeService runtimeService); @Override ProvidersInfo getProvidersInfo(final ProviderTypeKey providerTypeKey); @Override RuntimesInfo getRuntimesInfo(final ProviderKey providerKey); @Override boolean hasRuntimes(final ProviderKey providerKey); }
|
@Test public void getGetStringValue() { Map values = new HashMap(); String result = ServiceUtil.getStringValue(values, KEY); assertNull(result); Object obj = mock(Object.class); when(obj.toString()).thenReturn(STRING_VALUE); values.put(KEY, obj); result = ServiceUtil.getStringValue(values, KEY); assertEquals(STRING_VALUE, result); }
|
public static final String getStringValue(Map map, String key) { return map.get(key) != null ? map.get(key).toString() : null; }
|
ServiceUtil { public static final String getStringValue(Map map, String key) { return map.get(key) != null ? map.get(key).toString() : null; } }
|
ServiceUtil { public static final String getStringValue(Map map, String key) { return map.get(key) != null ? map.get(key).toString() : null; } }
|
ServiceUtil { public static final String getStringValue(Map map, String key) { return map.get(key) != null ? map.get(key).toString() : null; } static final String getStringValue(Map map,
String key); }
|
ServiceUtil { public static final String getStringValue(Map map, String key) { return map.get(key) != null ? map.get(key).toString() : null; } static final String getStringValue(Map map,
String key); }
|
@Test public void testGetRuntimeItems() { ProviderTypeKey providerTypeKey = new ProviderTypeKey(PROVIDER_NAME, PROVIDER_VERSION); ProviderKey providerKey = new ProviderKey(providerTypeKey, PROVIDER_ID); when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(queryItems); Collection<RuntimeListItem> result = service.getRuntimeItems(providerKey); Collection<RuntimeListItem> expectedResult = buildExpectedResult(queryItems); assertEquals(expectedResult, result); }
|
@Override public Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withProviderId(providerKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)); }
|
RuntimeServiceImpl implements RuntimeService { @Override public Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withProviderId(providerKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)); } }
|
RuntimeServiceImpl implements RuntimeService { @Override public Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withProviderId(providerKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); }
|
RuntimeServiceImpl implements RuntimeService { @Override public Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withProviderId(providerKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
RuntimeServiceImpl implements RuntimeService { @Override public Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey) { checkNotNull("providerKey", providerKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withProviderId(providerKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
@Test public void getRuntimeItemByPipelineExecutionKeyExisting() { PipelineExecutionTraceKey traceKey = new PipelineExecutionTraceKey(PIPELINE_EXECUTION_ID); List<RuntimeQueryResultItem> singleResult = mockRuntimeQueryResultItemList(1); when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(singleResult); RuntimeListItem expectedItem = buildExpectedResult(singleResult).iterator().next(); RuntimeListItem result = service.getRuntimeItem(traceKey); assertEquals(expectedItem, result); }
|
@Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); }
|
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } }
|
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); }
|
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
@Test public void getRuntimeItemByPipelineExecutionKeyNotExisting() { PipelineExecutionTraceKey traceKey = new PipelineExecutionTraceKey(PIPELINE_EXECUTION_ID); List<RuntimeQueryResultItem> singleResult = new ArrayList<>(); when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(singleResult); RuntimeListItem result = service.getRuntimeItem(traceKey); assertNull(result); }
|
@Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); }
|
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } }
|
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); }
|
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
@Test public void getRuntimeItemByRuntimeKeyExisting() { ProviderKey providerKey = mock(ProviderKey.class); RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID); List<RuntimeQueryResultItem> singleResult = mockRuntimeQueryResultItemList(1); when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(singleResult); RuntimeListItem expectedItem = buildExpectedResult(singleResult).iterator().next(); RuntimeListItem result = service.getRuntimeItem(runtimeKey); assertEquals(expectedItem, result); }
|
@Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); }
|
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } }
|
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); }
|
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
@Test(expected = UnsupportedOperationException.class) public void testSetTitle() { header.setTitle("title"); }
|
@Override public void setTitle(final String title) { throw new UnsupportedOperationException("Title is derived and cannot be set on the HeaderMetaData."); }
|
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void setTitle(final String title) { throw new UnsupportedOperationException("Title is derived and cannot be set on the HeaderMetaData."); } }
|
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void setTitle(final String title) { throw new UnsupportedOperationException("Title is derived and cannot be set on the HeaderMetaData."); } EditablePopupHeaderMetaData(final CellEditorControlsView.Presenter cellEditorControls,
final E editor); }
|
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void setTitle(final String title) { throw new UnsupportedOperationException("Title is derived and cannot be set on the HeaderMetaData."); } EditablePopupHeaderMetaData(final CellEditorControlsView.Presenter cellEditorControls,
final E editor); @Override void setColumnGroup(final String columnGroup); @Override void setTitle(final String title); @Override void edit(final GridBodyCellEditContext context); @Override void destroyResources(); }
|
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void setTitle(final String title) { throw new UnsupportedOperationException("Title is derived and cannot be set on the HeaderMetaData."); } EditablePopupHeaderMetaData(final CellEditorControlsView.Presenter cellEditorControls,
final E editor); @Override void setColumnGroup(final String columnGroup); @Override void setTitle(final String title); @Override void edit(final GridBodyCellEditContext context); @Override void destroyResources(); }
|
@Test public void getRuntimeItemByRuntimeKeyNotExisting() { ProviderKey providerKey = mock(ProviderKey.class); RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID); List<RuntimeQueryResultItem> singleResult = new ArrayList<>(); when(runtimeProvisioningService.executeQuery(any(RuntimeQuery.class))).thenReturn(singleResult); RuntimeListItem result = service.getRuntimeItem(runtimeKey); assertNull(result); }
|
@Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); }
|
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } }
|
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); }
|
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
RuntimeServiceImpl implements RuntimeService { @Override public RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); final RuntimeQuery query = RuntimeQueryBuilder.newInstance() .withPipelineExecutionId(pipelineExecutionTraceKey.getId()) .build(); return buildRuntimeQueryResult(runtimeProvisioningService.executeQuery(query)).stream() .findFirst() .orElse(null); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
@Test public void testGetPipelines() { ProviderTypeKey providerTypeKey = new ProviderTypeKey(PROVIDER_NAME, PROVIDER_VERSION); when(pipelineService.getPipelineNames(any(org.guvnor.ala.runtime.providers.ProviderType.class), anyInt(), anyInt(), anyString(), anyBoolean())).thenReturn(pipelineNames); Collection<PipelineKey> result = service.getPipelines(providerTypeKey); assertEquals(pipelineKeys, result); }
|
@Override public Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); return pipelineService.getPipelineNames(new org.guvnor.ala.runtime.providers.ProviderType() { @Override public String getProviderTypeName() { return providerTypeKey.getId(); } @Override public String getVersion() { return providerTypeKey.getVersion(); } }, 0, 1000, "name", true ).stream().map(PipelineKey::new).collect(Collectors.toList()); }
|
RuntimeServiceImpl implements RuntimeService { @Override public Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); return pipelineService.getPipelineNames(new org.guvnor.ala.runtime.providers.ProviderType() { @Override public String getProviderTypeName() { return providerTypeKey.getId(); } @Override public String getVersion() { return providerTypeKey.getVersion(); } }, 0, 1000, "name", true ).stream().map(PipelineKey::new).collect(Collectors.toList()); } }
|
RuntimeServiceImpl implements RuntimeService { @Override public Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); return pipelineService.getPipelineNames(new org.guvnor.ala.runtime.providers.ProviderType() { @Override public String getProviderTypeName() { return providerTypeKey.getId(); } @Override public String getVersion() { return providerTypeKey.getVersion(); } }, 0, 1000, "name", true ).stream().map(PipelineKey::new).collect(Collectors.toList()); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); }
|
RuntimeServiceImpl implements RuntimeService { @Override public Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); return pipelineService.getPipelineNames(new org.guvnor.ala.runtime.providers.ProviderType() { @Override public String getProviderTypeName() { return providerTypeKey.getId(); } @Override public String getVersion() { return providerTypeKey.getVersion(); } }, 0, 1000, "name", true ).stream().map(PipelineKey::new).collect(Collectors.toList()); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
RuntimeServiceImpl implements RuntimeService { @Override public Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); return pipelineService.getPipelineNames(new org.guvnor.ala.runtime.providers.ProviderType() { @Override public String getProviderTypeName() { return providerTypeKey.getId(); } @Override public String getVersion() { return providerTypeKey.getVersion(); } }, 0, 1000, "name", true ).stream().map(PipelineKey::new).collect(Collectors.toList()); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
@Test public void testCreateRuntimeSuccessful() { Provider provider = mock(Provider.class); ProviderTypeKey providerTypeKey = new ProviderTypeKey(PROVIDER_NAME, PROVIDER_VERSION); ProviderKey providerKey = new ProviderKey(providerTypeKey, PROVIDER_ID); Map<String, String> params = PipelineInputBuilderTest.mockParams(PARAMS_COUNT); List<RuntimeQueryResultItem> items = mock(List.class); when(providerService.getProvider(providerKey)).thenReturn(provider); when(runtimeProvisioningService.executeQuery(RuntimeQueryBuilder.newInstance() .withRuntimeName(RUNTIME_ID) .build())).thenReturn(items); when(items.isEmpty()).thenReturn(true); Input expectedInput = PipelineInputBuilder.newInstance() .withProvider(providerKey) .withRuntimeName(RUNTIME_ID) .withParams(params).build(); service.createRuntime(providerKey, RUNTIME_ID, PIPELINE_KEY, params); verify(pipelineService, times(1)).runPipeline(PIPELINE, expectedInput, true); }
|
@Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } }
|
RuntimeServiceImpl implements RuntimeService { @Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } } }
|
RuntimeServiceImpl implements RuntimeService { @Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); }
|
RuntimeServiceImpl implements RuntimeService { @Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
RuntimeServiceImpl implements RuntimeService { @Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
@Test public void testCreateRuntimeWhenProviderNotExists() { ProviderTypeKey providerTypeKey = new ProviderTypeKey(PROVIDER_NAME, PROVIDER_VERSION); ProviderKey providerKey = new ProviderKey(providerTypeKey, PROVIDER_ID); expectedException.expectMessage("No provider was found for providerKey: " + providerKey); service.createRuntime(providerKey, RUNTIME_ID, PIPELINE_KEY, null); verify(pipelineService, never()).runPipeline(anyString(), any(Input.class), eq(true)); }
|
@Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } }
|
RuntimeServiceImpl implements RuntimeService { @Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } } }
|
RuntimeServiceImpl implements RuntimeService { @Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); }
|
RuntimeServiceImpl implements RuntimeService { @Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
RuntimeServiceImpl implements RuntimeService { @Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
@Test public void testCreateRuntimeWhenProviderExistsButRuntimeNameExitsts() { Provider provider = mock(Provider.class); ProviderTypeKey providerTypeKey = new ProviderTypeKey(PROVIDER_NAME, PROVIDER_VERSION); ProviderKey providerKey = new ProviderKey(providerTypeKey, PROVIDER_ID); List<RuntimeQueryResultItem> items = mock(List.class); when(providerService.getProvider(providerKey)).thenReturn(provider); when(runtimeProvisioningService.executeQuery(RuntimeQueryBuilder.newInstance() .withRuntimeName(RUNTIME_ID) .build())).thenReturn(items); when(items.isEmpty()).thenReturn(false); expectedException.expectMessage("A runtime with the given name already exists: " + RUNTIME_ID); service.createRuntime(providerKey, RUNTIME_ID, PIPELINE_KEY, mock(Map.class)); verify(pipelineService, never()).runPipeline(anyString(), any(Input.class), eq(true)); }
|
@Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } }
|
RuntimeServiceImpl implements RuntimeService { @Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } } }
|
RuntimeServiceImpl implements RuntimeService { @Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); }
|
RuntimeServiceImpl implements RuntimeService { @Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
RuntimeServiceImpl implements RuntimeService { @Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
@Test public void testCreateRuntimeWhenUnExpectedError() { Provider provider = mock(Provider.class); ProviderTypeKey providerTypeKey = new ProviderTypeKey(PROVIDER_NAME, PROVIDER_VERSION); ProviderKey providerKey = new ProviderKey(providerTypeKey, PROVIDER_ID); when(providerService.getProvider(providerKey)).thenReturn(provider); when(pipelineService.runPipeline(anyString(), any(Input.class), eq(true))).thenThrow(new RuntimeException(ERROR_MESSAGE)); expectedException.expectMessage(ERROR_MESSAGE); service.createRuntime(providerKey, "irrelevant for the test", mock(PipelineKey.class), mock(Map.class)); }
|
@Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } }
|
RuntimeServiceImpl implements RuntimeService { @Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } } }
|
RuntimeServiceImpl implements RuntimeService { @Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); }
|
RuntimeServiceImpl implements RuntimeService { @Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
RuntimeServiceImpl implements RuntimeService { @Override public PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey, final String runtimeName, final PipelineKey pipelineKey, final Map<String, String> params) { checkNotNull("providerKey", providerKey); checkNotNull("runtimeName", runtimeName); checkNotNull("pipelineKey", pipelineKey); validateForCreateRuntime(providerKey, runtimeName); try { final Input input = PipelineInputBuilder.newInstance() .withRuntimeName(runtimeName) .withProvider(providerKey) .withParams(params) .build(); return new PipelineExecutionTraceKey(pipelineService.runPipeline(pipelineKey.getId(), input, true)); } catch (Exception e) { logger.error("Runtime creation failed.", e); throw ExceptionUtilities.handleException(e); } } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
@Test public void testStopPipelineExecution() { PipelineExecutionTraceKey pipelineExecutionTraceKey = new PipelineExecutionTraceKey(PIPELINE_EXECUTION_ID); service.stopPipelineExecution(pipelineExecutionTraceKey); verify(pipelineService, times(1)).stopPipelineExecution(PIPELINE_EXECUTION_ID); verify(pipelineExecutionChangeEvent, times(1)).fire(new PipelineExecutionChangeEvent(PipelineExecutionChange.STOPPED, pipelineExecutionTraceKey)); }
|
@Override public void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); pipelineService.stopPipelineExecution(pipelineExecutionTraceKey.getId()); pipelineExecutionChangeEvent.fire(new PipelineExecutionChangeEvent(PipelineExecutionChange.STOPPED, pipelineExecutionTraceKey)); }
|
RuntimeServiceImpl implements RuntimeService { @Override public void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); pipelineService.stopPipelineExecution(pipelineExecutionTraceKey.getId()); pipelineExecutionChangeEvent.fire(new PipelineExecutionChangeEvent(PipelineExecutionChange.STOPPED, pipelineExecutionTraceKey)); } }
|
RuntimeServiceImpl implements RuntimeService { @Override public void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); pipelineService.stopPipelineExecution(pipelineExecutionTraceKey.getId()); pipelineExecutionChangeEvent.fire(new PipelineExecutionChangeEvent(PipelineExecutionChange.STOPPED, pipelineExecutionTraceKey)); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); }
|
RuntimeServiceImpl implements RuntimeService { @Override public void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); pipelineService.stopPipelineExecution(pipelineExecutionTraceKey.getId()); pipelineExecutionChangeEvent.fire(new PipelineExecutionChangeEvent(PipelineExecutionChange.STOPPED, pipelineExecutionTraceKey)); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
RuntimeServiceImpl implements RuntimeService { @Override public void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); pipelineService.stopPipelineExecution(pipelineExecutionTraceKey.getId()); pipelineExecutionChangeEvent.fire(new PipelineExecutionChangeEvent(PipelineExecutionChange.STOPPED, pipelineExecutionTraceKey)); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
@Test public void testDeletePipelineExecution() { PipelineExecutionTraceKey pipelineExecutionTraceKey = new PipelineExecutionTraceKey(PIPELINE_EXECUTION_ID); service.deletePipelineExecution(pipelineExecutionTraceKey); verify(pipelineService, times(1)).deletePipelineExecution(PIPELINE_EXECUTION_ID); verify(pipelineExecutionChangeEvent, times(1)).fire(new PipelineExecutionChangeEvent(PipelineExecutionChange.DELETED, pipelineExecutionTraceKey)); }
|
@Override public void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); pipelineService.deletePipelineExecution(pipelineExecutionTraceKey.getId()); pipelineExecutionChangeEvent.fire(new PipelineExecutionChangeEvent(PipelineExecutionChange.DELETED, pipelineExecutionTraceKey)); }
|
RuntimeServiceImpl implements RuntimeService { @Override public void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); pipelineService.deletePipelineExecution(pipelineExecutionTraceKey.getId()); pipelineExecutionChangeEvent.fire(new PipelineExecutionChangeEvent(PipelineExecutionChange.DELETED, pipelineExecutionTraceKey)); } }
|
RuntimeServiceImpl implements RuntimeService { @Override public void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); pipelineService.deletePipelineExecution(pipelineExecutionTraceKey.getId()); pipelineExecutionChangeEvent.fire(new PipelineExecutionChangeEvent(PipelineExecutionChange.DELETED, pipelineExecutionTraceKey)); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); }
|
RuntimeServiceImpl implements RuntimeService { @Override public void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); pipelineService.deletePipelineExecution(pipelineExecutionTraceKey.getId()); pipelineExecutionChangeEvent.fire(new PipelineExecutionChangeEvent(PipelineExecutionChange.DELETED, pipelineExecutionTraceKey)); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
RuntimeServiceImpl implements RuntimeService { @Override public void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey) { checkNotNull("pipelineExecutionTraceKey", pipelineExecutionTraceKey); pipelineService.deletePipelineExecution(pipelineExecutionTraceKey.getId()); pipelineExecutionChangeEvent.fire(new PipelineExecutionChangeEvent(PipelineExecutionChange.DELETED, pipelineExecutionTraceKey)); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
@Test public void testStopRuntime() { ProviderKey providerKey = mock(ProviderKey.class); RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID); service.stopRuntime(runtimeKey); verify(runtimeProvisioningService, times(1)).stopRuntime(RUNTIME_ID); verify(runtimeChangeEvent, times(1)).fire(new RuntimeChangeEvent(RuntimeChange.STOPPED, runtimeKey)); }
|
@Override public void stopRuntime(final RuntimeKey runtimeKey) { checkNotNull("runtimeKey", runtimeKey); runtimeProvisioningService.stopRuntime(runtimeKey.getId()); runtimeChangeEvent.fire(new RuntimeChangeEvent(RuntimeChange.STOPPED, runtimeKey)); }
|
RuntimeServiceImpl implements RuntimeService { @Override public void stopRuntime(final RuntimeKey runtimeKey) { checkNotNull("runtimeKey", runtimeKey); runtimeProvisioningService.stopRuntime(runtimeKey.getId()); runtimeChangeEvent.fire(new RuntimeChangeEvent(RuntimeChange.STOPPED, runtimeKey)); } }
|
RuntimeServiceImpl implements RuntimeService { @Override public void stopRuntime(final RuntimeKey runtimeKey) { checkNotNull("runtimeKey", runtimeKey); runtimeProvisioningService.stopRuntime(runtimeKey.getId()); runtimeChangeEvent.fire(new RuntimeChangeEvent(RuntimeChange.STOPPED, runtimeKey)); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); }
|
RuntimeServiceImpl implements RuntimeService { @Override public void stopRuntime(final RuntimeKey runtimeKey) { checkNotNull("runtimeKey", runtimeKey); runtimeProvisioningService.stopRuntime(runtimeKey.getId()); runtimeChangeEvent.fire(new RuntimeChangeEvent(RuntimeChange.STOPPED, runtimeKey)); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
RuntimeServiceImpl implements RuntimeService { @Override public void stopRuntime(final RuntimeKey runtimeKey) { checkNotNull("runtimeKey", runtimeKey); runtimeProvisioningService.stopRuntime(runtimeKey.getId()); runtimeChangeEvent.fire(new RuntimeChangeEvent(RuntimeChange.STOPPED, runtimeKey)); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
@Test public void testStartRuntime() { ProviderKey providerKey = mock(ProviderKey.class); RuntimeKey runtimeKey = new RuntimeKey(providerKey, RUNTIME_ID); service.startRuntime(runtimeKey); verify(runtimeProvisioningService, times(1)).startRuntime(RUNTIME_ID); verify(runtimeChangeEvent, times(1)).fire(new RuntimeChangeEvent(RuntimeChange.STARTED, runtimeKey)); }
|
@Override public void startRuntime(final RuntimeKey runtimeKey) { checkNotNull("runtimeKey", runtimeKey); runtimeProvisioningService.startRuntime(runtimeKey.getId()); runtimeChangeEvent.fire(new RuntimeChangeEvent(RuntimeChange.STARTED, runtimeKey)); }
|
RuntimeServiceImpl implements RuntimeService { @Override public void startRuntime(final RuntimeKey runtimeKey) { checkNotNull("runtimeKey", runtimeKey); runtimeProvisioningService.startRuntime(runtimeKey.getId()); runtimeChangeEvent.fire(new RuntimeChangeEvent(RuntimeChange.STARTED, runtimeKey)); } }
|
RuntimeServiceImpl implements RuntimeService { @Override public void startRuntime(final RuntimeKey runtimeKey) { checkNotNull("runtimeKey", runtimeKey); runtimeProvisioningService.startRuntime(runtimeKey.getId()); runtimeChangeEvent.fire(new RuntimeChangeEvent(RuntimeChange.STARTED, runtimeKey)); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); }
|
RuntimeServiceImpl implements RuntimeService { @Override public void startRuntime(final RuntimeKey runtimeKey) { checkNotNull("runtimeKey", runtimeKey); runtimeProvisioningService.startRuntime(runtimeKey.getId()); runtimeChangeEvent.fire(new RuntimeChangeEvent(RuntimeChange.STARTED, runtimeKey)); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
RuntimeServiceImpl implements RuntimeService { @Override public void startRuntime(final RuntimeKey runtimeKey) { checkNotNull("runtimeKey", runtimeKey); runtimeProvisioningService.startRuntime(runtimeKey.getId()); runtimeChangeEvent.fire(new RuntimeChangeEvent(RuntimeChange.STARTED, runtimeKey)); } RuntimeServiceImpl(); @Inject RuntimeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final PipelineServiceBackend pipelineService,
final ProviderService providerService,
final Event<RuntimeChangeEvent> runtimeChangeEvent,
final Event<PipelineExecutionChangeEvent> pipelineExecutionChangeEvent); @Override Collection<RuntimeListItem> getRuntimeItems(final ProviderKey providerKey); @Override RuntimeListItem getRuntimeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override RuntimeListItem getRuntimeItem(final RuntimeKey runtimeKey); @Override Collection<PipelineKey> getPipelines(final ProviderTypeKey providerTypeKey); @Override PipelineExecutionTraceKey createRuntime(final ProviderKey providerKey,
final String runtimeName,
final PipelineKey pipelineKey,
final Map<String, String> params); @Override void stopPipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void deletePipelineExecution(final PipelineExecutionTraceKey pipelineExecutionTraceKey); @Override void stopRuntime(final RuntimeKey runtimeKey); @Override void startRuntime(final RuntimeKey runtimeKey); @Override void deleteRuntime(final RuntimeKey runtimeKey,
final boolean forced); }
|
@Test public void testEditWithRelationLocation() { final GridBodyCellEditContext context = new GridBodyCellEditContext(ABSOLUTE_CELL_X, ABSOLUTE_CELL_Y, CELL_WIDTH, CELL_HEIGHT, CLIP_MIN_Y, CLIP_MIN_X, ROW_INDEX, COLUMN_INDEX, IS_FLOATING, transform, renderer, Optional.of(new Point2D(RELATIVE_X, RELATIVE_Y))); header.edit(context); verify(editor).bind(eq(gridWidget), eq(ROW_INDEX), eq(COLUMN_INDEX)); verify(cellEditorControls).show(eq(editor), eq((int) RELATIVE_X), eq((int) RELATIVE_Y)); }
|
@Override public void edit(final GridBodyCellEditContext context) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double cellWidth = context.getCellWidth(); final double cellHeight = context.getCellHeight(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); editor.bind(getPresenter(), uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX + cellWidth / 2, absoluteCellY + cellHeight / 2}; final Optional<Point2D> rx = context.getRelativeLocation(); rx.ifPresent(r -> { dxy[0] = r.getX(); dxy[1] = r.getY(); }); cellEditorControls.show(editor, (int) (dxy[0]), (int) (dxy[1])); }
|
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void edit(final GridBodyCellEditContext context) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double cellWidth = context.getCellWidth(); final double cellHeight = context.getCellHeight(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); editor.bind(getPresenter(), uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX + cellWidth / 2, absoluteCellY + cellHeight / 2}; final Optional<Point2D> rx = context.getRelativeLocation(); rx.ifPresent(r -> { dxy[0] = r.getX(); dxy[1] = r.getY(); }); cellEditorControls.show(editor, (int) (dxy[0]), (int) (dxy[1])); } }
|
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void edit(final GridBodyCellEditContext context) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double cellWidth = context.getCellWidth(); final double cellHeight = context.getCellHeight(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); editor.bind(getPresenter(), uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX + cellWidth / 2, absoluteCellY + cellHeight / 2}; final Optional<Point2D> rx = context.getRelativeLocation(); rx.ifPresent(r -> { dxy[0] = r.getX(); dxy[1] = r.getY(); }); cellEditorControls.show(editor, (int) (dxy[0]), (int) (dxy[1])); } EditablePopupHeaderMetaData(final CellEditorControlsView.Presenter cellEditorControls,
final E editor); }
|
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void edit(final GridBodyCellEditContext context) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double cellWidth = context.getCellWidth(); final double cellHeight = context.getCellHeight(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); editor.bind(getPresenter(), uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX + cellWidth / 2, absoluteCellY + cellHeight / 2}; final Optional<Point2D> rx = context.getRelativeLocation(); rx.ifPresent(r -> { dxy[0] = r.getX(); dxy[1] = r.getY(); }); cellEditorControls.show(editor, (int) (dxy[0]), (int) (dxy[1])); } EditablePopupHeaderMetaData(final CellEditorControlsView.Presenter cellEditorControls,
final E editor); @Override void setColumnGroup(final String columnGroup); @Override void setTitle(final String title); @Override void edit(final GridBodyCellEditContext context); @Override void destroyResources(); }
|
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void edit(final GridBodyCellEditContext context) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double cellWidth = context.getCellWidth(); final double cellHeight = context.getCellHeight(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); editor.bind(getPresenter(), uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX + cellWidth / 2, absoluteCellY + cellHeight / 2}; final Optional<Point2D> rx = context.getRelativeLocation(); rx.ifPresent(r -> { dxy[0] = r.getX(); dxy[1] = r.getY(); }); cellEditorControls.show(editor, (int) (dxy[0]), (int) (dxy[1])); } EditablePopupHeaderMetaData(final CellEditorControlsView.Presenter cellEditorControls,
final E editor); @Override void setColumnGroup(final String columnGroup); @Override void setTitle(final String title); @Override void edit(final GridBodyCellEditContext context); @Override void destroyResources(); }
|
@Test public void testGetAvailableProviders() { Collection<ProviderType> result = service.getAvailableProviderTypes(); assertEquals(PROVIDER_TYPES_COUNT, result.size()); int i = 0; for (ProviderType providerType : result) { assertNotNull(providerType.getKey()); assertEquals(providerTypesSpi.get(i).getProviderTypeName(), providerType.getKey().getId()); assertEquals(providerTypesSpi.get(i).getVersion(), providerType.getKey().getVersion()); i++; } }
|
@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; }
|
ProviderTypeServiceImpl implements ProviderTypeService { @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; } }
|
ProviderTypeServiceImpl implements ProviderTypeService { @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; } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @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; } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); @Override Collection<ProviderType> getAvailableProviderTypes(); @Override ProviderType getProviderType(final ProviderTypeKey providerTypeKey); @Override Collection<ProviderType> getEnabledProviderTypes(); @Override void enableProviderTypes(final Collection<ProviderType> providerTypes); @Override void disableProviderType(final ProviderType providerType); @Override Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus(); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @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; } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); @Override Collection<ProviderType> getAvailableProviderTypes(); @Override ProviderType getProviderType(final ProviderTypeKey providerTypeKey); @Override Collection<ProviderType> getEnabledProviderTypes(); @Override void enableProviderTypes(final Collection<ProviderType> providerTypes); @Override void disableProviderType(final ProviderType providerType); @Override Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus(); }
|
@Test public void testGetProviderTypeExisting() { org.guvnor.ala.runtime.providers.ProviderType providerTypeSpi = providerTypesSpi.get(2); ProviderTypeKey providerTypeKey = new ProviderTypeKey(providerTypeSpi.getProviderTypeName(), providerTypeSpi.getVersion()); ProviderType providerType = service.getProviderType(providerTypeKey); assertNotNull(providerType); assertEquals(providerTypeSpi.getProviderTypeName(), providerType.getKey().getId()); assertEquals(providerTypeSpi.getVersion(), providerType.getKey().getVersion()); }
|
@Override public ProviderType getProviderType(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); return getAvailableProviderTypes().stream() .filter(providerType -> providerType.getKey().equals(providerTypeKey)) .findFirst().orElse(null); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public ProviderType getProviderType(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); return getAvailableProviderTypes().stream() .filter(providerType -> providerType.getKey().equals(providerTypeKey)) .findFirst().orElse(null); } }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public ProviderType getProviderType(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); return getAvailableProviderTypes().stream() .filter(providerType -> providerType.getKey().equals(providerTypeKey)) .findFirst().orElse(null); } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public ProviderType getProviderType(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); return getAvailableProviderTypes().stream() .filter(providerType -> providerType.getKey().equals(providerTypeKey)) .findFirst().orElse(null); } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); @Override Collection<ProviderType> getAvailableProviderTypes(); @Override ProviderType getProviderType(final ProviderTypeKey providerTypeKey); @Override Collection<ProviderType> getEnabledProviderTypes(); @Override void enableProviderTypes(final Collection<ProviderType> providerTypes); @Override void disableProviderType(final ProviderType providerType); @Override Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus(); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public ProviderType getProviderType(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); return getAvailableProviderTypes().stream() .filter(providerType -> providerType.getKey().equals(providerTypeKey)) .findFirst().orElse(null); } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); @Override Collection<ProviderType> getAvailableProviderTypes(); @Override ProviderType getProviderType(final ProviderTypeKey providerTypeKey); @Override Collection<ProviderType> getEnabledProviderTypes(); @Override void enableProviderTypes(final Collection<ProviderType> providerTypes); @Override void disableProviderType(final ProviderType providerType); @Override Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus(); }
|
@Test public void testGetProviderTypeNotExisting() { ProviderTypeKey providerTypeKey = new ProviderTypeKey("NonExisting", "NonExisting"); ProviderType providerType = service.getProviderType(providerTypeKey); assertNull(providerType); }
|
@Override public ProviderType getProviderType(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); return getAvailableProviderTypes().stream() .filter(providerType -> providerType.getKey().equals(providerTypeKey)) .findFirst().orElse(null); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public ProviderType getProviderType(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); return getAvailableProviderTypes().stream() .filter(providerType -> providerType.getKey().equals(providerTypeKey)) .findFirst().orElse(null); } }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public ProviderType getProviderType(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); return getAvailableProviderTypes().stream() .filter(providerType -> providerType.getKey().equals(providerTypeKey)) .findFirst().orElse(null); } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public ProviderType getProviderType(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); return getAvailableProviderTypes().stream() .filter(providerType -> providerType.getKey().equals(providerTypeKey)) .findFirst().orElse(null); } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); @Override Collection<ProviderType> getAvailableProviderTypes(); @Override ProviderType getProviderType(final ProviderTypeKey providerTypeKey); @Override Collection<ProviderType> getEnabledProviderTypes(); @Override void enableProviderTypes(final Collection<ProviderType> providerTypes); @Override void disableProviderType(final ProviderType providerType); @Override Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus(); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public ProviderType getProviderType(final ProviderTypeKey providerTypeKey) { checkNotNull("providerTypeKey", providerTypeKey); return getAvailableProviderTypes().stream() .filter(providerType -> providerType.getKey().equals(providerTypeKey)) .findFirst().orElse(null); } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); @Override Collection<ProviderType> getAvailableProviderTypes(); @Override ProviderType getProviderType(final ProviderTypeKey providerTypeKey); @Override Collection<ProviderType> getEnabledProviderTypes(); @Override void enableProviderTypes(final Collection<ProviderType> providerTypes); @Override void disableProviderType(final ProviderType providerType); @Override Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus(); }
|
@Test public void testGetEnabledProviderTypes() { pickSomeProviders(); pickedProviderTypes.forEach(providerType -> provisioningPreferences.getProviderTypeEnablements().put(providerType, Boolean.TRUE)); Collection<ProviderType> result = service.getEnabledProviderTypes(); assertEquals(pickedProviderTypes.size(), result.size()); pickedProviderTypes.forEach(providerType -> assertTrue(result.contains(providerType))); verify(provisioningPreferences, times(1)).load(); }
|
@Override public Collection<ProviderType> getEnabledProviderTypes() { return getProviderTypesStatus().entrySet().stream() .filter(entry -> ProviderTypeStatus.ENABLED.equals(entry.getValue())) .map(Map.Entry::getKey) .collect(Collectors.toList()); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public Collection<ProviderType> getEnabledProviderTypes() { return getProviderTypesStatus().entrySet().stream() .filter(entry -> ProviderTypeStatus.ENABLED.equals(entry.getValue())) .map(Map.Entry::getKey) .collect(Collectors.toList()); } }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public Collection<ProviderType> getEnabledProviderTypes() { return getProviderTypesStatus().entrySet().stream() .filter(entry -> ProviderTypeStatus.ENABLED.equals(entry.getValue())) .map(Map.Entry::getKey) .collect(Collectors.toList()); } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public Collection<ProviderType> getEnabledProviderTypes() { return getProviderTypesStatus().entrySet().stream() .filter(entry -> ProviderTypeStatus.ENABLED.equals(entry.getValue())) .map(Map.Entry::getKey) .collect(Collectors.toList()); } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); @Override Collection<ProviderType> getAvailableProviderTypes(); @Override ProviderType getProviderType(final ProviderTypeKey providerTypeKey); @Override Collection<ProviderType> getEnabledProviderTypes(); @Override void enableProviderTypes(final Collection<ProviderType> providerTypes); @Override void disableProviderType(final ProviderType providerType); @Override Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus(); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public Collection<ProviderType> getEnabledProviderTypes() { return getProviderTypesStatus().entrySet().stream() .filter(entry -> ProviderTypeStatus.ENABLED.equals(entry.getValue())) .map(Map.Entry::getKey) .collect(Collectors.toList()); } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); @Override Collection<ProviderType> getAvailableProviderTypes(); @Override ProviderType getProviderType(final ProviderTypeKey providerTypeKey); @Override Collection<ProviderType> getEnabledProviderTypes(); @Override void enableProviderTypes(final Collection<ProviderType> providerTypes); @Override void disableProviderType(final ProviderType providerType); @Override Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus(); }
|
@Test public void testEnableProviderTypes() { pickSomeProviders(); pickedProviderTypes.forEach(providerType -> provisioningPreferences.getProviderTypeEnablements().put(providerType, Boolean.FALSE)); service.enableProviderTypes(pickedProviderTypes); pickedProviderTypes.forEach(providerType -> assertTrue(provisioningPreferences.getProviderTypeEnablements().get(providerType))); verify(provisioningPreferences, times(pickedProviderTypes.size())).save(preferenceScope); }
|
@Override public void enableProviderTypes(final Collection<ProviderType> providerTypes) { checkNotEmpty("providerTypes", providerTypes); providerTypes.forEach(providerType -> enableProviderType(providerType, true)); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public void enableProviderTypes(final Collection<ProviderType> providerTypes) { checkNotEmpty("providerTypes", providerTypes); providerTypes.forEach(providerType -> enableProviderType(providerType, true)); } }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public void enableProviderTypes(final Collection<ProviderType> providerTypes) { checkNotEmpty("providerTypes", providerTypes); providerTypes.forEach(providerType -> enableProviderType(providerType, true)); } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public void enableProviderTypes(final Collection<ProviderType> providerTypes) { checkNotEmpty("providerTypes", providerTypes); providerTypes.forEach(providerType -> enableProviderType(providerType, true)); } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); @Override Collection<ProviderType> getAvailableProviderTypes(); @Override ProviderType getProviderType(final ProviderTypeKey providerTypeKey); @Override Collection<ProviderType> getEnabledProviderTypes(); @Override void enableProviderTypes(final Collection<ProviderType> providerTypes); @Override void disableProviderType(final ProviderType providerType); @Override Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus(); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public void enableProviderTypes(final Collection<ProviderType> providerTypes) { checkNotEmpty("providerTypes", providerTypes); providerTypes.forEach(providerType -> enableProviderType(providerType, true)); } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); @Override Collection<ProviderType> getAvailableProviderTypes(); @Override ProviderType getProviderType(final ProviderTypeKey providerTypeKey); @Override Collection<ProviderType> getEnabledProviderTypes(); @Override void enableProviderTypes(final Collection<ProviderType> providerTypes); @Override void disableProviderType(final ProviderType providerType); @Override Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus(); }
|
@Test public void testDisableProviderType() { pickSomeProviders(); pickSomeProviders(); pickedProviderTypes.forEach(providerType -> provisioningPreferences.getProviderTypeEnablements().put(providerType, Boolean.TRUE)); ProviderType providerTypeToDisable = pickedProviderTypes.get(0); service.disableProviderType(providerTypeToDisable); assertFalse(provisioningPreferences.getProviderTypeEnablements().get(providerTypeToDisable)); verify(provisioningPreferences, times(1)).save(preferenceScope); }
|
@Override public void disableProviderType(final ProviderType providerType) { checkNotNull("providerType", providerType); enableProviderType(providerType, false); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public void disableProviderType(final ProviderType providerType) { checkNotNull("providerType", providerType); enableProviderType(providerType, false); } }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public void disableProviderType(final ProviderType providerType) { checkNotNull("providerType", providerType); enableProviderType(providerType, false); } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public void disableProviderType(final ProviderType providerType) { checkNotNull("providerType", providerType); enableProviderType(providerType, false); } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); @Override Collection<ProviderType> getAvailableProviderTypes(); @Override ProviderType getProviderType(final ProviderTypeKey providerTypeKey); @Override Collection<ProviderType> getEnabledProviderTypes(); @Override void enableProviderTypes(final Collection<ProviderType> providerTypes); @Override void disableProviderType(final ProviderType providerType); @Override Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus(); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public void disableProviderType(final ProviderType providerType) { checkNotNull("providerType", providerType); enableProviderType(providerType, false); } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); @Override Collection<ProviderType> getAvailableProviderTypes(); @Override ProviderType getProviderType(final ProviderTypeKey providerTypeKey); @Override Collection<ProviderType> getEnabledProviderTypes(); @Override void enableProviderTypes(final Collection<ProviderType> providerTypes); @Override void disableProviderType(final ProviderType providerType); @Override Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus(); }
|
@Test public void testGetProviderTypesStatus() { Map<ProviderType, ProviderTypeStatus> initialStatusMap = service.getProviderTypesStatus(); assertEquals(PROVIDER_TYPES_COUNT, initialStatusMap.size()); initialStatusMap.values().forEach(status -> assertEquals(status, ProviderTypeStatus.DISABLED)); pickSomeProviders(); service.enableProviderTypes(pickedProviderTypes); Map<ProviderType, ProviderTypeStatus> currentStatusMap = service.getProviderTypesStatus(); assertEquals(PROVIDER_TYPES_COUNT, currentStatusMap.size()); pickedProviderTypes.forEach(enabledProvider -> assertEquals(ProviderTypeStatus.ENABLED, currentStatusMap.get(pickedProviderTypes.get(0)))); long expectedDisabled = PROVIDER_TYPES_COUNT - pickedProviderTypes.size(); long currentDisabled = currentStatusMap.values().stream() .filter(status -> status == ProviderTypeStatus.DISABLED).count(); assertEquals(expectedDisabled, currentDisabled); }
|
@Override public Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus() { final Map<ProviderType, ProviderTypeStatus> result = new HashMap<>(); readProviderTypeEnablements().forEach((providerType, isEnabled) -> result.put(providerType, Boolean.TRUE.equals(isEnabled) ? ProviderTypeStatus.ENABLED : ProviderTypeStatus.DISABLED) ); getAvailableProviderTypes().forEach(providerType -> { if (!result.containsKey(providerType)) { result.put(providerType, ProviderTypeStatus.DISABLED); } }); return result; }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus() { final Map<ProviderType, ProviderTypeStatus> result = new HashMap<>(); readProviderTypeEnablements().forEach((providerType, isEnabled) -> result.put(providerType, Boolean.TRUE.equals(isEnabled) ? ProviderTypeStatus.ENABLED : ProviderTypeStatus.DISABLED) ); getAvailableProviderTypes().forEach(providerType -> { if (!result.containsKey(providerType)) { result.put(providerType, ProviderTypeStatus.DISABLED); } }); return result; } }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus() { final Map<ProviderType, ProviderTypeStatus> result = new HashMap<>(); readProviderTypeEnablements().forEach((providerType, isEnabled) -> result.put(providerType, Boolean.TRUE.equals(isEnabled) ? ProviderTypeStatus.ENABLED : ProviderTypeStatus.DISABLED) ); getAvailableProviderTypes().forEach(providerType -> { if (!result.containsKey(providerType)) { result.put(providerType, ProviderTypeStatus.DISABLED); } }); return result; } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus() { final Map<ProviderType, ProviderTypeStatus> result = new HashMap<>(); readProviderTypeEnablements().forEach((providerType, isEnabled) -> result.put(providerType, Boolean.TRUE.equals(isEnabled) ? ProviderTypeStatus.ENABLED : ProviderTypeStatus.DISABLED) ); getAvailableProviderTypes().forEach(providerType -> { if (!result.containsKey(providerType)) { result.put(providerType, ProviderTypeStatus.DISABLED); } }); return result; } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); @Override Collection<ProviderType> getAvailableProviderTypes(); @Override ProviderType getProviderType(final ProviderTypeKey providerTypeKey); @Override Collection<ProviderType> getEnabledProviderTypes(); @Override void enableProviderTypes(final Collection<ProviderType> providerTypes); @Override void disableProviderType(final ProviderType providerType); @Override Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus(); }
|
ProviderTypeServiceImpl implements ProviderTypeService { @Override public Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus() { final Map<ProviderType, ProviderTypeStatus> result = new HashMap<>(); readProviderTypeEnablements().forEach((providerType, isEnabled) -> result.put(providerType, Boolean.TRUE.equals(isEnabled) ? ProviderTypeStatus.ENABLED : ProviderTypeStatus.DISABLED) ); getAvailableProviderTypes().forEach(providerType -> { if (!result.containsKey(providerType)) { result.put(providerType, ProviderTypeStatus.DISABLED); } }); return result; } ProviderTypeServiceImpl(); @Inject ProviderTypeServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProvisioningPreferences provisioningPreferences,
final PreferenceScopeFactory scopeFactory); @Override Collection<ProviderType> getAvailableProviderTypes(); @Override ProviderType getProviderType(final ProviderTypeKey providerTypeKey); @Override Collection<ProviderType> getEnabledProviderTypes(); @Override void enableProviderTypes(final Collection<ProviderType> providerTypes); @Override void disableProviderType(final ProviderType providerType); @Override Map<ProviderType, ProviderTypeStatus> getProviderTypesStatus(); }
|
@Test public void testEnsureHandlerForRegisteredProviderType() throws Exception { ProviderTypeKey providerTypeKey = expectedKeys.get(0); BackendProviderHandler handler = ((BackendProviderHandlerRegistry) handlerRegistry).ensureHandler(providerTypeKey); assertEquals(expectedHandlers.get(0), handler); }
|
public BackendProviderHandler ensureHandler(ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = getProviderHandler(providerTypeKey); if (handler == null) { throw new RuntimeException("BackendProviderHandler was not found for providerTypeKey: " + providerTypeKey); } return handler; }
|
BackendProviderHandlerRegistry extends AbstractProviderHandlerRegistry<BackendProviderHandler> { public BackendProviderHandler ensureHandler(ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = getProviderHandler(providerTypeKey); if (handler == null) { throw new RuntimeException("BackendProviderHandler was not found for providerTypeKey: " + providerTypeKey); } return handler; } }
|
BackendProviderHandlerRegistry extends AbstractProviderHandlerRegistry<BackendProviderHandler> { public BackendProviderHandler ensureHandler(ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = getProviderHandler(providerTypeKey); if (handler == null) { throw new RuntimeException("BackendProviderHandler was not found for providerTypeKey: " + providerTypeKey); } return handler; } BackendProviderHandlerRegistry(); @Inject BackendProviderHandlerRegistry(final @Any Instance<BackendProviderHandler> handlerInstance); }
|
BackendProviderHandlerRegistry extends AbstractProviderHandlerRegistry<BackendProviderHandler> { public BackendProviderHandler ensureHandler(ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = getProviderHandler(providerTypeKey); if (handler == null) { throw new RuntimeException("BackendProviderHandler was not found for providerTypeKey: " + providerTypeKey); } return handler; } BackendProviderHandlerRegistry(); @Inject BackendProviderHandlerRegistry(final @Any Instance<BackendProviderHandler> handlerInstance); BackendProviderHandler ensureHandler(ProviderTypeKey providerTypeKey); }
|
BackendProviderHandlerRegistry extends AbstractProviderHandlerRegistry<BackendProviderHandler> { public BackendProviderHandler ensureHandler(ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = getProviderHandler(providerTypeKey); if (handler == null) { throw new RuntimeException("BackendProviderHandler was not found for providerTypeKey: " + providerTypeKey); } return handler; } BackendProviderHandlerRegistry(); @Inject BackendProviderHandlerRegistry(final @Any Instance<BackendProviderHandler> handlerInstance); BackendProviderHandler ensureHandler(ProviderTypeKey providerTypeKey); }
|
@Test public void testEnsureHandlerForNonRegisteredProviderType() throws Exception { ProviderTypeKey providerTypeKey = mock(ProviderTypeKey.class); expectedException.expectMessage("BackendProviderHandler was not found for providerTypeKey: " + providerTypeKey); ((BackendProviderHandlerRegistry) handlerRegistry).ensureHandler(providerTypeKey); }
|
public BackendProviderHandler ensureHandler(ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = getProviderHandler(providerTypeKey); if (handler == null) { throw new RuntimeException("BackendProviderHandler was not found for providerTypeKey: " + providerTypeKey); } return handler; }
|
BackendProviderHandlerRegistry extends AbstractProviderHandlerRegistry<BackendProviderHandler> { public BackendProviderHandler ensureHandler(ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = getProviderHandler(providerTypeKey); if (handler == null) { throw new RuntimeException("BackendProviderHandler was not found for providerTypeKey: " + providerTypeKey); } return handler; } }
|
BackendProviderHandlerRegistry extends AbstractProviderHandlerRegistry<BackendProviderHandler> { public BackendProviderHandler ensureHandler(ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = getProviderHandler(providerTypeKey); if (handler == null) { throw new RuntimeException("BackendProviderHandler was not found for providerTypeKey: " + providerTypeKey); } return handler; } BackendProviderHandlerRegistry(); @Inject BackendProviderHandlerRegistry(final @Any Instance<BackendProviderHandler> handlerInstance); }
|
BackendProviderHandlerRegistry extends AbstractProviderHandlerRegistry<BackendProviderHandler> { public BackendProviderHandler ensureHandler(ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = getProviderHandler(providerTypeKey); if (handler == null) { throw new RuntimeException("BackendProviderHandler was not found for providerTypeKey: " + providerTypeKey); } return handler; } BackendProviderHandlerRegistry(); @Inject BackendProviderHandlerRegistry(final @Any Instance<BackendProviderHandler> handlerInstance); BackendProviderHandler ensureHandler(ProviderTypeKey providerTypeKey); }
|
BackendProviderHandlerRegistry extends AbstractProviderHandlerRegistry<BackendProviderHandler> { public BackendProviderHandler ensureHandler(ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = getProviderHandler(providerTypeKey); if (handler == null) { throw new RuntimeException("BackendProviderHandler was not found for providerTypeKey: " + providerTypeKey); } return handler; } BackendProviderHandlerRegistry(); @Inject BackendProviderHandlerRegistry(final @Any Instance<BackendProviderHandler> handlerInstance); BackendProviderHandler ensureHandler(ProviderTypeKey providerTypeKey); }
|
@Test public void testBuild() { Input result = PipelineInputBuilder.newInstance() .withProvider(providerKey) .withParams(params) .withRuntimeName(RUNTIME).build(); assertNotNull(result); assertEquals(RUNTIME, result.get(RuntimeConfig.RUNTIME_NAME)); assertEquals(PROVIDER, result.get(ProviderConfig.PROVIDER_NAME)); params.forEach((name, value) -> assertEquals(value, result.get(name))); }
|
public Input build() { final Input input = new Input(); if (runtimeName != null) { input.put(RuntimeConfig.RUNTIME_NAME, runtimeName); } if (providerKey != null) { input.put(ProviderConfig.PROVIDER_NAME, providerKey.getId()); } if (params != null) { input.putAll(params); } return input; }
|
PipelineInputBuilder { public Input build() { final Input input = new Input(); if (runtimeName != null) { input.put(RuntimeConfig.RUNTIME_NAME, runtimeName); } if (providerKey != null) { input.put(ProviderConfig.PROVIDER_NAME, providerKey.getId()); } if (params != null) { input.putAll(params); } return input; } }
|
PipelineInputBuilder { public Input build() { final Input input = new Input(); if (runtimeName != null) { input.put(RuntimeConfig.RUNTIME_NAME, runtimeName); } if (providerKey != null) { input.put(ProviderConfig.PROVIDER_NAME, providerKey.getId()); } if (params != null) { input.putAll(params); } return input; } private PipelineInputBuilder(); }
|
PipelineInputBuilder { public Input build() { final Input input = new Input(); if (runtimeName != null) { input.put(RuntimeConfig.RUNTIME_NAME, runtimeName); } if (providerKey != null) { input.put(ProviderConfig.PROVIDER_NAME, providerKey.getId()); } if (params != null) { input.putAll(params); } return input; } private PipelineInputBuilder(); static PipelineInputBuilder newInstance(); PipelineInputBuilder withRuntimeName(final String runtimeName); PipelineInputBuilder withProvider(final ProviderKey providerKey); PipelineInputBuilder withParams(final Map<String, String> params); Input build(); }
|
PipelineInputBuilder { public Input build() { final Input input = new Input(); if (runtimeName != null) { input.put(RuntimeConfig.RUNTIME_NAME, runtimeName); } if (providerKey != null) { input.put(ProviderConfig.PROVIDER_NAME, providerKey.getId()); } if (params != null) { input.putAll(params); } return input; } private PipelineInputBuilder(); static PipelineInputBuilder newInstance(); PipelineInputBuilder withRuntimeName(final String runtimeName); PipelineInputBuilder withProvider(final ProviderKey providerKey); PipelineInputBuilder withParams(final Map<String, String> params); Input build(); }
|
@Test public void testEditWithNoRelationLocation() { final GridBodyCellEditContext context = new GridBodyCellEditContext(ABSOLUTE_CELL_X, ABSOLUTE_CELL_Y, CELL_WIDTH, CELL_HEIGHT, CLIP_MIN_Y, CLIP_MIN_X, ROW_INDEX, COLUMN_INDEX, IS_FLOATING, transform, renderer, Optional.empty()); header.edit(context); verify(editor).bind(eq(gridWidget), eq(ROW_INDEX), eq(COLUMN_INDEX)); verify(cellEditorControls).show(eq(editor), eq((int) (ABSOLUTE_CELL_X + CELL_WIDTH / 2)), eq((int) (ABSOLUTE_CELL_Y + CELL_HEIGHT / 2))); }
|
@Override public void edit(final GridBodyCellEditContext context) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double cellWidth = context.getCellWidth(); final double cellHeight = context.getCellHeight(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); editor.bind(getPresenter(), uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX + cellWidth / 2, absoluteCellY + cellHeight / 2}; final Optional<Point2D> rx = context.getRelativeLocation(); rx.ifPresent(r -> { dxy[0] = r.getX(); dxy[1] = r.getY(); }); cellEditorControls.show(editor, (int) (dxy[0]), (int) (dxy[1])); }
|
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void edit(final GridBodyCellEditContext context) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double cellWidth = context.getCellWidth(); final double cellHeight = context.getCellHeight(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); editor.bind(getPresenter(), uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX + cellWidth / 2, absoluteCellY + cellHeight / 2}; final Optional<Point2D> rx = context.getRelativeLocation(); rx.ifPresent(r -> { dxy[0] = r.getX(); dxy[1] = r.getY(); }); cellEditorControls.show(editor, (int) (dxy[0]), (int) (dxy[1])); } }
|
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void edit(final GridBodyCellEditContext context) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double cellWidth = context.getCellWidth(); final double cellHeight = context.getCellHeight(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); editor.bind(getPresenter(), uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX + cellWidth / 2, absoluteCellY + cellHeight / 2}; final Optional<Point2D> rx = context.getRelativeLocation(); rx.ifPresent(r -> { dxy[0] = r.getX(); dxy[1] = r.getY(); }); cellEditorControls.show(editor, (int) (dxy[0]), (int) (dxy[1])); } EditablePopupHeaderMetaData(final CellEditorControlsView.Presenter cellEditorControls,
final E editor); }
|
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void edit(final GridBodyCellEditContext context) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double cellWidth = context.getCellWidth(); final double cellHeight = context.getCellHeight(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); editor.bind(getPresenter(), uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX + cellWidth / 2, absoluteCellY + cellHeight / 2}; final Optional<Point2D> rx = context.getRelativeLocation(); rx.ifPresent(r -> { dxy[0] = r.getX(); dxy[1] = r.getY(); }); cellEditorControls.show(editor, (int) (dxy[0]), (int) (dxy[1])); } EditablePopupHeaderMetaData(final CellEditorControlsView.Presenter cellEditorControls,
final E editor); @Override void setColumnGroup(final String columnGroup); @Override void setTitle(final String title); @Override void edit(final GridBodyCellEditContext context); @Override void destroyResources(); }
|
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void edit(final GridBodyCellEditContext context) { final int uiRowIndex = context.getRowIndex(); final int uiColumnIndex = context.getColumnIndex(); final double cellWidth = context.getCellWidth(); final double cellHeight = context.getCellHeight(); final double absoluteCellX = context.getAbsoluteCellX(); final double absoluteCellY = context.getAbsoluteCellY(); editor.bind(getPresenter(), uiRowIndex, uiColumnIndex); final double[] dxy = {absoluteCellX + cellWidth / 2, absoluteCellY + cellHeight / 2}; final Optional<Point2D> rx = context.getRelativeLocation(); rx.ifPresent(r -> { dxy[0] = r.getX(); dxy[1] = r.getY(); }); cellEditorControls.show(editor, (int) (dxy[0]), (int) (dxy[1])); } EditablePopupHeaderMetaData(final CellEditorControlsView.Presenter cellEditorControls,
final E editor); @Override void setColumnGroup(final String columnGroup); @Override void setTitle(final String title); @Override void edit(final GridBodyCellEditContext context); @Override void destroyResources(); }
|
@Test public void testToModelWhenHandlerNotConfigured() { when(handlerRegistry.ensureHandler(providerTypeKey)).thenThrow(new RuntimeException(ERROR_MESSAGE)); expectedException.expectMessage(ERROR_MESSAGE); converter.toModel(provider); }
|
@Override public Provider toModel(org.guvnor.ala.runtime.providers.Provider provider) { Provider result = null; if (provider != null) { ProviderTypeKey providerTypeKey = new ProviderTypeKey(provider.getProviderType().getProviderTypeName(), provider.getProviderType().getVersion()); ProviderKey providerKey = new ProviderKey(providerTypeKey, provider.getId()); final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); @SuppressWarnings("unchecked") final ProviderConfiguration providerConfiguration = (ProviderConfiguration) handler.getProviderConfigConverter().toModel(provider.getConfig()); result = new Provider(providerKey, providerConfiguration); } return result; }
|
ProviderConverterImpl implements ProviderConverter { @Override public Provider toModel(org.guvnor.ala.runtime.providers.Provider provider) { Provider result = null; if (provider != null) { ProviderTypeKey providerTypeKey = new ProviderTypeKey(provider.getProviderType().getProviderTypeName(), provider.getProviderType().getVersion()); ProviderKey providerKey = new ProviderKey(providerTypeKey, provider.getId()); final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); @SuppressWarnings("unchecked") final ProviderConfiguration providerConfiguration = (ProviderConfiguration) handler.getProviderConfigConverter().toModel(provider.getConfig()); result = new Provider(providerKey, providerConfiguration); } return result; } }
|
ProviderConverterImpl implements ProviderConverter { @Override public Provider toModel(org.guvnor.ala.runtime.providers.Provider provider) { Provider result = null; if (provider != null) { ProviderTypeKey providerTypeKey = new ProviderTypeKey(provider.getProviderType().getProviderTypeName(), provider.getProviderType().getVersion()); ProviderKey providerKey = new ProviderKey(providerTypeKey, provider.getId()); final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); @SuppressWarnings("unchecked") final ProviderConfiguration providerConfiguration = (ProviderConfiguration) handler.getProviderConfigConverter().toModel(provider.getConfig()); result = new Provider(providerKey, providerConfiguration); } return result; } ProviderConverterImpl(final BackendProviderHandlerRegistry handlerRegistry); }
|
ProviderConverterImpl implements ProviderConverter { @Override public Provider toModel(org.guvnor.ala.runtime.providers.Provider provider) { Provider result = null; if (provider != null) { ProviderTypeKey providerTypeKey = new ProviderTypeKey(provider.getProviderType().getProviderTypeName(), provider.getProviderType().getVersion()); ProviderKey providerKey = new ProviderKey(providerTypeKey, provider.getId()); final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); @SuppressWarnings("unchecked") final ProviderConfiguration providerConfiguration = (ProviderConfiguration) handler.getProviderConfigConverter().toModel(provider.getConfig()); result = new Provider(providerKey, providerConfiguration); } return result; } ProviderConverterImpl(final BackendProviderHandlerRegistry handlerRegistry); @Override Class<Provider> getModelType(); @Override Class<org.guvnor.ala.runtime.providers.Provider> getDomainType(); @Override org.guvnor.ala.runtime.providers.Provider toDomain(Provider modelValue); @Override Provider toModel(org.guvnor.ala.runtime.providers.Provider provider); }
|
ProviderConverterImpl implements ProviderConverter { @Override public Provider toModel(org.guvnor.ala.runtime.providers.Provider provider) { Provider result = null; if (provider != null) { ProviderTypeKey providerTypeKey = new ProviderTypeKey(provider.getProviderType().getProviderTypeName(), provider.getProviderType().getVersion()); ProviderKey providerKey = new ProviderKey(providerTypeKey, provider.getId()); final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); @SuppressWarnings("unchecked") final ProviderConfiguration providerConfiguration = (ProviderConfiguration) handler.getProviderConfigConverter().toModel(provider.getConfig()); result = new Provider(providerKey, providerConfiguration); } return result; } ProviderConverterImpl(final BackendProviderHandlerRegistry handlerRegistry); @Override Class<Provider> getModelType(); @Override Class<org.guvnor.ala.runtime.providers.Provider> getDomainType(); @Override org.guvnor.ala.runtime.providers.Provider toDomain(Provider modelValue); @Override Provider toModel(org.guvnor.ala.runtime.providers.Provider provider); }
|
@Test public void testToModelWhenHandlerIsConfigured() { when(handlerRegistry.ensureHandler(providerTypeKey)).thenReturn(providerHandler); when(providerHandler.getProviderConfigConverter()).thenReturn(providerConfigConverter); when(providerConfigConverter.toModel(providerConfig)).thenReturn(providerConfiguration); Provider result = converter.toModel(provider); assertNotNull(result); assertEquals(PROVIDER_ID, result.getKey().getId()); assertEquals(PROVIDER_TYPE_NAME, result.getKey().getProviderTypeKey().getId()); assertEquals(PROVIDER_VERSION, result.getKey().getProviderTypeKey().getVersion()); assertEquals(result.getConfiguration(), providerConfiguration); }
|
@Override public Provider toModel(org.guvnor.ala.runtime.providers.Provider provider) { Provider result = null; if (provider != null) { ProviderTypeKey providerTypeKey = new ProviderTypeKey(provider.getProviderType().getProviderTypeName(), provider.getProviderType().getVersion()); ProviderKey providerKey = new ProviderKey(providerTypeKey, provider.getId()); final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); @SuppressWarnings("unchecked") final ProviderConfiguration providerConfiguration = (ProviderConfiguration) handler.getProviderConfigConverter().toModel(provider.getConfig()); result = new Provider(providerKey, providerConfiguration); } return result; }
|
ProviderConverterImpl implements ProviderConverter { @Override public Provider toModel(org.guvnor.ala.runtime.providers.Provider provider) { Provider result = null; if (provider != null) { ProviderTypeKey providerTypeKey = new ProviderTypeKey(provider.getProviderType().getProviderTypeName(), provider.getProviderType().getVersion()); ProviderKey providerKey = new ProviderKey(providerTypeKey, provider.getId()); final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); @SuppressWarnings("unchecked") final ProviderConfiguration providerConfiguration = (ProviderConfiguration) handler.getProviderConfigConverter().toModel(provider.getConfig()); result = new Provider(providerKey, providerConfiguration); } return result; } }
|
ProviderConverterImpl implements ProviderConverter { @Override public Provider toModel(org.guvnor.ala.runtime.providers.Provider provider) { Provider result = null; if (provider != null) { ProviderTypeKey providerTypeKey = new ProviderTypeKey(provider.getProviderType().getProviderTypeName(), provider.getProviderType().getVersion()); ProviderKey providerKey = new ProviderKey(providerTypeKey, provider.getId()); final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); @SuppressWarnings("unchecked") final ProviderConfiguration providerConfiguration = (ProviderConfiguration) handler.getProviderConfigConverter().toModel(provider.getConfig()); result = new Provider(providerKey, providerConfiguration); } return result; } ProviderConverterImpl(final BackendProviderHandlerRegistry handlerRegistry); }
|
ProviderConverterImpl implements ProviderConverter { @Override public Provider toModel(org.guvnor.ala.runtime.providers.Provider provider) { Provider result = null; if (provider != null) { ProviderTypeKey providerTypeKey = new ProviderTypeKey(provider.getProviderType().getProviderTypeName(), provider.getProviderType().getVersion()); ProviderKey providerKey = new ProviderKey(providerTypeKey, provider.getId()); final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); @SuppressWarnings("unchecked") final ProviderConfiguration providerConfiguration = (ProviderConfiguration) handler.getProviderConfigConverter().toModel(provider.getConfig()); result = new Provider(providerKey, providerConfiguration); } return result; } ProviderConverterImpl(final BackendProviderHandlerRegistry handlerRegistry); @Override Class<Provider> getModelType(); @Override Class<org.guvnor.ala.runtime.providers.Provider> getDomainType(); @Override org.guvnor.ala.runtime.providers.Provider toDomain(Provider modelValue); @Override Provider toModel(org.guvnor.ala.runtime.providers.Provider provider); }
|
ProviderConverterImpl implements ProviderConverter { @Override public Provider toModel(org.guvnor.ala.runtime.providers.Provider provider) { Provider result = null; if (provider != null) { ProviderTypeKey providerTypeKey = new ProviderTypeKey(provider.getProviderType().getProviderTypeName(), provider.getProviderType().getVersion()); ProviderKey providerKey = new ProviderKey(providerTypeKey, provider.getId()); final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); @SuppressWarnings("unchecked") final ProviderConfiguration providerConfiguration = (ProviderConfiguration) handler.getProviderConfigConverter().toModel(provider.getConfig()); result = new Provider(providerKey, providerConfiguration); } return result; } ProviderConverterImpl(final BackendProviderHandlerRegistry handlerRegistry); @Override Class<Provider> getModelType(); @Override Class<org.guvnor.ala.runtime.providers.Provider> getDomainType(); @Override org.guvnor.ala.runtime.providers.Provider toDomain(Provider modelValue); @Override Provider toModel(org.guvnor.ala.runtime.providers.Provider provider); }
|
@Test public void testGetProviderConfigConverterWhenHandlerConfigured() { when(handlerRegistry.ensureHandler(providerTypeKey)).thenReturn(providerHandler); when(providerHandler.getProviderConfigConverter()).thenReturn(configConverter); assertEquals(configConverter, converterFactory.getProviderConfigConverter(providerTypeKey)); }
|
@Override public ProviderConfigConverter getProviderConfigConverter(final ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); return handler.getProviderConfigConverter(); }
|
ProviderConverterFactoryImpl implements ProviderConverterFactory { @Override public ProviderConfigConverter getProviderConfigConverter(final ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); return handler.getProviderConfigConverter(); } }
|
ProviderConverterFactoryImpl implements ProviderConverterFactory { @Override public ProviderConfigConverter getProviderConfigConverter(final ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); return handler.getProviderConfigConverter(); } ProviderConverterFactoryImpl(); @Inject ProviderConverterFactoryImpl(final BackendProviderHandlerRegistry handlerRegistry); }
|
ProviderConverterFactoryImpl implements ProviderConverterFactory { @Override public ProviderConfigConverter getProviderConfigConverter(final ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); return handler.getProviderConfigConverter(); } ProviderConverterFactoryImpl(); @Inject ProviderConverterFactoryImpl(final BackendProviderHandlerRegistry handlerRegistry); @Override ProviderConfigConverter getProviderConfigConverter(final ProviderTypeKey providerTypeKey); @Override ProviderConverter getProviderConverter(); }
|
ProviderConverterFactoryImpl implements ProviderConverterFactory { @Override public ProviderConfigConverter getProviderConfigConverter(final ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); return handler.getProviderConfigConverter(); } ProviderConverterFactoryImpl(); @Inject ProviderConverterFactoryImpl(final BackendProviderHandlerRegistry handlerRegistry); @Override ProviderConfigConverter getProviderConfigConverter(final ProviderTypeKey providerTypeKey); @Override ProviderConverter getProviderConverter(); }
|
@Test public void testGetProviderConfigConverterWhenHandlerNotConfigured() { when(handlerRegistry.ensureHandler(providerTypeKey)).thenThrow(new RuntimeException(ERROR_MESSAGE)); expectedException.expectMessage(ERROR_MESSAGE); converterFactory.getProviderConfigConverter(providerTypeKey); }
|
@Override public ProviderConfigConverter getProviderConfigConverter(final ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); return handler.getProviderConfigConverter(); }
|
ProviderConverterFactoryImpl implements ProviderConverterFactory { @Override public ProviderConfigConverter getProviderConfigConverter(final ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); return handler.getProviderConfigConverter(); } }
|
ProviderConverterFactoryImpl implements ProviderConverterFactory { @Override public ProviderConfigConverter getProviderConfigConverter(final ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); return handler.getProviderConfigConverter(); } ProviderConverterFactoryImpl(); @Inject ProviderConverterFactoryImpl(final BackendProviderHandlerRegistry handlerRegistry); }
|
ProviderConverterFactoryImpl implements ProviderConverterFactory { @Override public ProviderConfigConverter getProviderConfigConverter(final ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); return handler.getProviderConfigConverter(); } ProviderConverterFactoryImpl(); @Inject ProviderConverterFactoryImpl(final BackendProviderHandlerRegistry handlerRegistry); @Override ProviderConfigConverter getProviderConfigConverter(final ProviderTypeKey providerTypeKey); @Override ProviderConverter getProviderConverter(); }
|
ProviderConverterFactoryImpl implements ProviderConverterFactory { @Override public ProviderConfigConverter getProviderConfigConverter(final ProviderTypeKey providerTypeKey) { final BackendProviderHandler handler = handlerRegistry.ensureHandler(providerTypeKey); return handler.getProviderConfigConverter(); } ProviderConverterFactoryImpl(); @Inject ProviderConverterFactoryImpl(final BackendProviderHandlerRegistry handlerRegistry); @Override ProviderConfigConverter getProviderConfigConverter(final ProviderTypeKey providerTypeKey); @Override ProviderConverter getProviderConverter(); }
|
@Test public void testGetProviderConverter() { assertNotNull(converterFactory.getProviderConverter()); }
|
@Override public ProviderConverter getProviderConverter() { return providerConverter; }
|
ProviderConverterFactoryImpl implements ProviderConverterFactory { @Override public ProviderConverter getProviderConverter() { return providerConverter; } }
|
ProviderConverterFactoryImpl implements ProviderConverterFactory { @Override public ProviderConverter getProviderConverter() { return providerConverter; } ProviderConverterFactoryImpl(); @Inject ProviderConverterFactoryImpl(final BackendProviderHandlerRegistry handlerRegistry); }
|
ProviderConverterFactoryImpl implements ProviderConverterFactory { @Override public ProviderConverter getProviderConverter() { return providerConverter; } ProviderConverterFactoryImpl(); @Inject ProviderConverterFactoryImpl(final BackendProviderHandlerRegistry handlerRegistry); @Override ProviderConfigConverter getProviderConfigConverter(final ProviderTypeKey providerTypeKey); @Override ProviderConverter getProviderConverter(); }
|
ProviderConverterFactoryImpl implements ProviderConverterFactory { @Override public ProviderConverter getProviderConverter() { return providerConverter; } ProviderConverterFactoryImpl(); @Inject ProviderConverterFactoryImpl(final BackendProviderHandlerRegistry handlerRegistry); @Override ProviderConfigConverter getProviderConfigConverter(final ProviderTypeKey providerTypeKey); @Override ProviderConverter getProviderConverter(); }
|
@Test public void testIsValidContainerNameForValidNames() { Arrays.stream(validContainerNames).forEach(name -> assertTrue(service.isValidContainerName(name))); }
|
@Override public boolean isValidContainerName(final String containerName) { return containerName != null && containerName.matches("[A-Za-z0-9_\\-.:]+"); }
|
ProvisioningValidationServiceImpl implements ProvisioningValidationService { @Override public boolean isValidContainerName(final String containerName) { return containerName != null && containerName.matches("[A-Za-z0-9_\\-.:]+"); } }
|
ProvisioningValidationServiceImpl implements ProvisioningValidationService { @Override public boolean isValidContainerName(final String containerName) { return containerName != null && containerName.matches("[A-Za-z0-9_\\-.:]+"); } ProvisioningValidationServiceImpl(); }
|
ProvisioningValidationServiceImpl implements ProvisioningValidationService { @Override public boolean isValidContainerName(final String containerName) { return containerName != null && containerName.matches("[A-Za-z0-9_\\-.:]+"); } ProvisioningValidationServiceImpl(); @Override boolean isValidContainerName(final String containerName); }
|
ProvisioningValidationServiceImpl implements ProvisioningValidationService { @Override public boolean isValidContainerName(final String containerName) { return containerName != null && containerName.matches("[A-Za-z0-9_\\-.:]+"); } ProvisioningValidationServiceImpl(); @Override boolean isValidContainerName(final String containerName); }
|
@Test public void testIsValidContainerNameForInvalidNames() { Arrays.stream(invalidContainerNames).forEach(name -> assertFalse(service.isValidContainerName(name))); }
|
@Override public boolean isValidContainerName(final String containerName) { return containerName != null && containerName.matches("[A-Za-z0-9_\\-.:]+"); }
|
ProvisioningValidationServiceImpl implements ProvisioningValidationService { @Override public boolean isValidContainerName(final String containerName) { return containerName != null && containerName.matches("[A-Za-z0-9_\\-.:]+"); } }
|
ProvisioningValidationServiceImpl implements ProvisioningValidationService { @Override public boolean isValidContainerName(final String containerName) { return containerName != null && containerName.matches("[A-Za-z0-9_\\-.:]+"); } ProvisioningValidationServiceImpl(); }
|
ProvisioningValidationServiceImpl implements ProvisioningValidationService { @Override public boolean isValidContainerName(final String containerName) { return containerName != null && containerName.matches("[A-Za-z0-9_\\-.:]+"); } ProvisioningValidationServiceImpl(); @Override boolean isValidContainerName(final String containerName); }
|
ProvisioningValidationServiceImpl implements ProvisioningValidationService { @Override public boolean isValidContainerName(final String containerName) { return containerName != null && containerName.matches("[A-Za-z0-9_\\-.:]+"); } ProvisioningValidationServiceImpl(); @Override boolean isValidContainerName(final String containerName); }
|
@Test public void testGetProviders() { Collection<Provider> result = service.getProviders(providerType); assertEquals(providers, result); }
|
@Override public Collection<Provider> getProviders(final ProviderType providerType) { checkNotNull("providerType", providerType); return getAllProviders().stream() .filter(provider -> provider.getKey().getProviderTypeKey().equals(providerType.getKey())) .collect(toList()); }
|
ProviderServiceImpl implements ProviderService { @Override public Collection<Provider> getProviders(final ProviderType providerType) { checkNotNull("providerType", providerType); return getAllProviders().stream() .filter(provider -> provider.getKey().getProviderTypeKey().equals(providerType.getKey())) .collect(toList()); } }
|
ProviderServiceImpl implements ProviderService { @Override public Collection<Provider> getProviders(final ProviderType providerType) { checkNotNull("providerType", providerType); return getAllProviders().stream() .filter(provider -> provider.getKey().getProviderTypeKey().equals(providerType.getKey())) .collect(toList()); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); }
|
ProviderServiceImpl implements ProviderService { @Override public Collection<Provider> getProviders(final ProviderType providerType) { checkNotNull("providerType", providerType); return getAllProviders().stream() .filter(provider -> provider.getKey().getProviderTypeKey().equals(providerType.getKey())) .collect(toList()); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); @Override Collection<Provider> getProviders(final ProviderType providerType); @Override Collection<ProviderKey> getProvidersKey(final ProviderType providerType); @Override void createProvider(final ProviderType providerType,
final ProviderConfiguration configuration); @Override void deleteProvider(final ProviderKey providerKey); @Override Provider getProvider(final ProviderKey providerKey); }
|
ProviderServiceImpl implements ProviderService { @Override public Collection<Provider> getProviders(final ProviderType providerType) { checkNotNull("providerType", providerType); return getAllProviders().stream() .filter(provider -> provider.getKey().getProviderTypeKey().equals(providerType.getKey())) .collect(toList()); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); @Override Collection<Provider> getProviders(final ProviderType providerType); @Override Collection<ProviderKey> getProvidersKey(final ProviderType providerType); @Override void createProvider(final ProviderType providerType,
final ProviderConfiguration configuration); @Override void deleteProvider(final ProviderKey providerKey); @Override Provider getProvider(final ProviderKey providerKey); }
|
@Test public void testGetProvidersKey() { Collection<ProviderKey> result = service.getProvidersKey(providerType); assertEquals(providerKeys, result); }
|
@Override public Collection<ProviderKey> getProvidersKey(final ProviderType providerType) { return getProviders(providerType).stream() .map(AbstractHasKeyObject::getKey) .collect(toList()); }
|
ProviderServiceImpl implements ProviderService { @Override public Collection<ProviderKey> getProvidersKey(final ProviderType providerType) { return getProviders(providerType).stream() .map(AbstractHasKeyObject::getKey) .collect(toList()); } }
|
ProviderServiceImpl implements ProviderService { @Override public Collection<ProviderKey> getProvidersKey(final ProviderType providerType) { return getProviders(providerType).stream() .map(AbstractHasKeyObject::getKey) .collect(toList()); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); }
|
ProviderServiceImpl implements ProviderService { @Override public Collection<ProviderKey> getProvidersKey(final ProviderType providerType) { return getProviders(providerType).stream() .map(AbstractHasKeyObject::getKey) .collect(toList()); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); @Override Collection<Provider> getProviders(final ProviderType providerType); @Override Collection<ProviderKey> getProvidersKey(final ProviderType providerType); @Override void createProvider(final ProviderType providerType,
final ProviderConfiguration configuration); @Override void deleteProvider(final ProviderKey providerKey); @Override Provider getProvider(final ProviderKey providerKey); }
|
ProviderServiceImpl implements ProviderService { @Override public Collection<ProviderKey> getProvidersKey(final ProviderType providerType) { return getProviders(providerType).stream() .map(AbstractHasKeyObject::getKey) .collect(toList()); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); @Override Collection<Provider> getProviders(final ProviderType providerType); @Override Collection<ProviderKey> getProvidersKey(final ProviderType providerType); @Override void createProvider(final ProviderType providerType,
final ProviderConfiguration configuration); @Override void deleteProvider(final ProviderKey providerKey); @Override Provider getProvider(final ProviderKey providerKey); }
|
@Test public void testCreateProvider() { prepareConfigurationForCreate(); when(providerConfiguration.getId()).thenReturn(PROVIDER_ID); service.createProvider(providerType, providerConfiguration); verify(runtimeProvisioningService, times(1)).registerProvider(providerConfig); }
|
@Override public void createProvider(final ProviderType providerType, final ProviderConfiguration configuration) { checkNotNull("providerType", providerType); checkNotNull("providerType.providerTypeKey", providerType.getKey()); checkNotNull("configuration", configuration); checkNotEmpty("configuration.values", configuration.getValues()); validateForCreateProvider(configuration); @SuppressWarnings("unchecked") final ProviderConfig providerConfig = (ProviderConfig) providerConverterFactory.getProviderConfigConverter(providerType.getKey()).toDomain(configuration); runtimeProvisioningService.registerProvider(providerConfig); }
|
ProviderServiceImpl implements ProviderService { @Override public void createProvider(final ProviderType providerType, final ProviderConfiguration configuration) { checkNotNull("providerType", providerType); checkNotNull("providerType.providerTypeKey", providerType.getKey()); checkNotNull("configuration", configuration); checkNotEmpty("configuration.values", configuration.getValues()); validateForCreateProvider(configuration); @SuppressWarnings("unchecked") final ProviderConfig providerConfig = (ProviderConfig) providerConverterFactory.getProviderConfigConverter(providerType.getKey()).toDomain(configuration); runtimeProvisioningService.registerProvider(providerConfig); } }
|
ProviderServiceImpl implements ProviderService { @Override public void createProvider(final ProviderType providerType, final ProviderConfiguration configuration) { checkNotNull("providerType", providerType); checkNotNull("providerType.providerTypeKey", providerType.getKey()); checkNotNull("configuration", configuration); checkNotEmpty("configuration.values", configuration.getValues()); validateForCreateProvider(configuration); @SuppressWarnings("unchecked") final ProviderConfig providerConfig = (ProviderConfig) providerConverterFactory.getProviderConfigConverter(providerType.getKey()).toDomain(configuration); runtimeProvisioningService.registerProvider(providerConfig); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); }
|
ProviderServiceImpl implements ProviderService { @Override public void createProvider(final ProviderType providerType, final ProviderConfiguration configuration) { checkNotNull("providerType", providerType); checkNotNull("providerType.providerTypeKey", providerType.getKey()); checkNotNull("configuration", configuration); checkNotEmpty("configuration.values", configuration.getValues()); validateForCreateProvider(configuration); @SuppressWarnings("unchecked") final ProviderConfig providerConfig = (ProviderConfig) providerConverterFactory.getProviderConfigConverter(providerType.getKey()).toDomain(configuration); runtimeProvisioningService.registerProvider(providerConfig); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); @Override Collection<Provider> getProviders(final ProviderType providerType); @Override Collection<ProviderKey> getProvidersKey(final ProviderType providerType); @Override void createProvider(final ProviderType providerType,
final ProviderConfiguration configuration); @Override void deleteProvider(final ProviderKey providerKey); @Override Provider getProvider(final ProviderKey providerKey); }
|
ProviderServiceImpl implements ProviderService { @Override public void createProvider(final ProviderType providerType, final ProviderConfiguration configuration) { checkNotNull("providerType", providerType); checkNotNull("providerType.providerTypeKey", providerType.getKey()); checkNotNull("configuration", configuration); checkNotEmpty("configuration.values", configuration.getValues()); validateForCreateProvider(configuration); @SuppressWarnings("unchecked") final ProviderConfig providerConfig = (ProviderConfig) providerConverterFactory.getProviderConfigConverter(providerType.getKey()).toDomain(configuration); runtimeProvisioningService.registerProvider(providerConfig); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); @Override Collection<Provider> getProviders(final ProviderType providerType); @Override Collection<ProviderKey> getProvidersKey(final ProviderType providerType); @Override void createProvider(final ProviderType providerType,
final ProviderConfiguration configuration); @Override void deleteProvider(final ProviderKey providerKey); @Override Provider getProvider(final ProviderKey providerKey); }
|
@Test public void testDestroyResources() { header.destroyResources(); verify(editor).hide(); }
|
@Override public void destroyResources() { editor.hide(); }
|
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void destroyResources() { editor.hide(); } }
|
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void destroyResources() { editor.hide(); } EditablePopupHeaderMetaData(final CellEditorControlsView.Presenter cellEditorControls,
final E editor); }
|
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void destroyResources() { editor.hide(); } EditablePopupHeaderMetaData(final CellEditorControlsView.Presenter cellEditorControls,
final E editor); @Override void setColumnGroup(final String columnGroup); @Override void setTitle(final String title); @Override void edit(final GridBodyCellEditContext context); @Override void destroyResources(); }
|
EditablePopupHeaderMetaData implements EditableHeaderMetaData { @Override public void destroyResources() { editor.hide(); } EditablePopupHeaderMetaData(final CellEditorControlsView.Presenter cellEditorControls,
final E editor); @Override void setColumnGroup(final String columnGroup); @Override void setTitle(final String title); @Override void edit(final GridBodyCellEditContext context); @Override void destroyResources(); }
|
@Test public void testCreateProviderExisting() { prepareConfigurationForCreate(); String existingId = providers.get(1).getKey().getId(); when(providerConfiguration.getId()).thenReturn(existingId); expectedException.expectMessage("A provider with the given name already exists: " + existingId); service.createProvider(providerType, providerConfiguration); verify(runtimeProvisioningService, never()).registerProvider(any(ProviderConfig.class)); }
|
@Override public void createProvider(final ProviderType providerType, final ProviderConfiguration configuration) { checkNotNull("providerType", providerType); checkNotNull("providerType.providerTypeKey", providerType.getKey()); checkNotNull("configuration", configuration); checkNotEmpty("configuration.values", configuration.getValues()); validateForCreateProvider(configuration); @SuppressWarnings("unchecked") final ProviderConfig providerConfig = (ProviderConfig) providerConverterFactory.getProviderConfigConverter(providerType.getKey()).toDomain(configuration); runtimeProvisioningService.registerProvider(providerConfig); }
|
ProviderServiceImpl implements ProviderService { @Override public void createProvider(final ProviderType providerType, final ProviderConfiguration configuration) { checkNotNull("providerType", providerType); checkNotNull("providerType.providerTypeKey", providerType.getKey()); checkNotNull("configuration", configuration); checkNotEmpty("configuration.values", configuration.getValues()); validateForCreateProvider(configuration); @SuppressWarnings("unchecked") final ProviderConfig providerConfig = (ProviderConfig) providerConverterFactory.getProviderConfigConverter(providerType.getKey()).toDomain(configuration); runtimeProvisioningService.registerProvider(providerConfig); } }
|
ProviderServiceImpl implements ProviderService { @Override public void createProvider(final ProviderType providerType, final ProviderConfiguration configuration) { checkNotNull("providerType", providerType); checkNotNull("providerType.providerTypeKey", providerType.getKey()); checkNotNull("configuration", configuration); checkNotEmpty("configuration.values", configuration.getValues()); validateForCreateProvider(configuration); @SuppressWarnings("unchecked") final ProviderConfig providerConfig = (ProviderConfig) providerConverterFactory.getProviderConfigConverter(providerType.getKey()).toDomain(configuration); runtimeProvisioningService.registerProvider(providerConfig); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); }
|
ProviderServiceImpl implements ProviderService { @Override public void createProvider(final ProviderType providerType, final ProviderConfiguration configuration) { checkNotNull("providerType", providerType); checkNotNull("providerType.providerTypeKey", providerType.getKey()); checkNotNull("configuration", configuration); checkNotEmpty("configuration.values", configuration.getValues()); validateForCreateProvider(configuration); @SuppressWarnings("unchecked") final ProviderConfig providerConfig = (ProviderConfig) providerConverterFactory.getProviderConfigConverter(providerType.getKey()).toDomain(configuration); runtimeProvisioningService.registerProvider(providerConfig); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); @Override Collection<Provider> getProviders(final ProviderType providerType); @Override Collection<ProviderKey> getProvidersKey(final ProviderType providerType); @Override void createProvider(final ProviderType providerType,
final ProviderConfiguration configuration); @Override void deleteProvider(final ProviderKey providerKey); @Override Provider getProvider(final ProviderKey providerKey); }
|
ProviderServiceImpl implements ProviderService { @Override public void createProvider(final ProviderType providerType, final ProviderConfiguration configuration) { checkNotNull("providerType", providerType); checkNotNull("providerType.providerTypeKey", providerType.getKey()); checkNotNull("configuration", configuration); checkNotEmpty("configuration.values", configuration.getValues()); validateForCreateProvider(configuration); @SuppressWarnings("unchecked") final ProviderConfig providerConfig = (ProviderConfig) providerConverterFactory.getProviderConfigConverter(providerType.getKey()).toDomain(configuration); runtimeProvisioningService.registerProvider(providerConfig); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); @Override Collection<Provider> getProviders(final ProviderType providerType); @Override Collection<ProviderKey> getProvidersKey(final ProviderType providerType); @Override void createProvider(final ProviderType providerType,
final ProviderConfiguration configuration); @Override void deleteProvider(final ProviderKey providerKey); @Override Provider getProvider(final ProviderKey providerKey); }
|
@Test public void testDeleteProvider() { ProviderKey providerKey = mock(ProviderKey.class); when(providerKey.getId()).thenReturn(PROVIDER_ID); service.deleteProvider(providerKey); verify(runtimeProvisioningService, times(1)).unregisterProvider(PROVIDER_ID); }
|
@Override public void deleteProvider(final ProviderKey providerKey) { runtimeProvisioningService.unregisterProvider(providerKey.getId()); }
|
ProviderServiceImpl implements ProviderService { @Override public void deleteProvider(final ProviderKey providerKey) { runtimeProvisioningService.unregisterProvider(providerKey.getId()); } }
|
ProviderServiceImpl implements ProviderService { @Override public void deleteProvider(final ProviderKey providerKey) { runtimeProvisioningService.unregisterProvider(providerKey.getId()); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); }
|
ProviderServiceImpl implements ProviderService { @Override public void deleteProvider(final ProviderKey providerKey) { runtimeProvisioningService.unregisterProvider(providerKey.getId()); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); @Override Collection<Provider> getProviders(final ProviderType providerType); @Override Collection<ProviderKey> getProvidersKey(final ProviderType providerType); @Override void createProvider(final ProviderType providerType,
final ProviderConfiguration configuration); @Override void deleteProvider(final ProviderKey providerKey); @Override Provider getProvider(final ProviderKey providerKey); }
|
ProviderServiceImpl implements ProviderService { @Override public void deleteProvider(final ProviderKey providerKey) { runtimeProvisioningService.unregisterProvider(providerKey.getId()); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); @Override Collection<Provider> getProviders(final ProviderType providerType); @Override Collection<ProviderKey> getProvidersKey(final ProviderType providerType); @Override void createProvider(final ProviderType providerType,
final ProviderConfiguration configuration); @Override void deleteProvider(final ProviderKey providerKey); @Override Provider getProvider(final ProviderKey providerKey); }
|
@Test public void testGetProviderExisting() { org.guvnor.ala.runtime.providers.Provider providerSpi = providersSpi.get(2); ProviderTypeKey providerTypeKey = new ProviderTypeKey(providerSpi.getProviderType().getProviderTypeName(), providerSpi.getProviderType().getVersion()); ProviderKey providerKey = new ProviderKey(providerTypeKey, providerSpi.getId()); Provider provider = service.getProvider(providerKey); assertNotNull(provider); assertEquals(providers.get(2).getKey(), provider.getKey()); }
|
@Override public Provider getProvider(final ProviderKey providerKey) { List<org.guvnor.ala.runtime.providers.Provider> providers = runtimeProvisioningService.getProviders(0, 1000, PROVIDER_TYPE_NAME_SORT, true); Optional<Provider> result = Optional.empty(); if (providers != null) { result = providers.stream() .filter(provider -> provider.getId().equals(providerKey.getId())) .map(this::convert) .findFirst(); } return result.orElse(null); }
|
ProviderServiceImpl implements ProviderService { @Override public Provider getProvider(final ProviderKey providerKey) { List<org.guvnor.ala.runtime.providers.Provider> providers = runtimeProvisioningService.getProviders(0, 1000, PROVIDER_TYPE_NAME_SORT, true); Optional<Provider> result = Optional.empty(); if (providers != null) { result = providers.stream() .filter(provider -> provider.getId().equals(providerKey.getId())) .map(this::convert) .findFirst(); } return result.orElse(null); } }
|
ProviderServiceImpl implements ProviderService { @Override public Provider getProvider(final ProviderKey providerKey) { List<org.guvnor.ala.runtime.providers.Provider> providers = runtimeProvisioningService.getProviders(0, 1000, PROVIDER_TYPE_NAME_SORT, true); Optional<Provider> result = Optional.empty(); if (providers != null) { result = providers.stream() .filter(provider -> provider.getId().equals(providerKey.getId())) .map(this::convert) .findFirst(); } return result.orElse(null); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); }
|
ProviderServiceImpl implements ProviderService { @Override public Provider getProvider(final ProviderKey providerKey) { List<org.guvnor.ala.runtime.providers.Provider> providers = runtimeProvisioningService.getProviders(0, 1000, PROVIDER_TYPE_NAME_SORT, true); Optional<Provider> result = Optional.empty(); if (providers != null) { result = providers.stream() .filter(provider -> provider.getId().equals(providerKey.getId())) .map(this::convert) .findFirst(); } return result.orElse(null); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); @Override Collection<Provider> getProviders(final ProviderType providerType); @Override Collection<ProviderKey> getProvidersKey(final ProviderType providerType); @Override void createProvider(final ProviderType providerType,
final ProviderConfiguration configuration); @Override void deleteProvider(final ProviderKey providerKey); @Override Provider getProvider(final ProviderKey providerKey); }
|
ProviderServiceImpl implements ProviderService { @Override public Provider getProvider(final ProviderKey providerKey) { List<org.guvnor.ala.runtime.providers.Provider> providers = runtimeProvisioningService.getProviders(0, 1000, PROVIDER_TYPE_NAME_SORT, true); Optional<Provider> result = Optional.empty(); if (providers != null) { result = providers.stream() .filter(provider -> provider.getId().equals(providerKey.getId())) .map(this::convert) .findFirst(); } return result.orElse(null); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); @Override Collection<Provider> getProviders(final ProviderType providerType); @Override Collection<ProviderKey> getProvidersKey(final ProviderType providerType); @Override void createProvider(final ProviderType providerType,
final ProviderConfiguration configuration); @Override void deleteProvider(final ProviderKey providerKey); @Override Provider getProvider(final ProviderKey providerKey); }
|
@Test public void testGetProviderNotExisting() { ProviderTypeKey providerTypeKey = new ProviderTypeKey("not exist", "not exist"); ProviderKey providerKey = new ProviderKey(providerTypeKey, "not exist"); Provider provider = service.getProvider(providerKey); assertNull(provider); }
|
@Override public Provider getProvider(final ProviderKey providerKey) { List<org.guvnor.ala.runtime.providers.Provider> providers = runtimeProvisioningService.getProviders(0, 1000, PROVIDER_TYPE_NAME_SORT, true); Optional<Provider> result = Optional.empty(); if (providers != null) { result = providers.stream() .filter(provider -> provider.getId().equals(providerKey.getId())) .map(this::convert) .findFirst(); } return result.orElse(null); }
|
ProviderServiceImpl implements ProviderService { @Override public Provider getProvider(final ProviderKey providerKey) { List<org.guvnor.ala.runtime.providers.Provider> providers = runtimeProvisioningService.getProviders(0, 1000, PROVIDER_TYPE_NAME_SORT, true); Optional<Provider> result = Optional.empty(); if (providers != null) { result = providers.stream() .filter(provider -> provider.getId().equals(providerKey.getId())) .map(this::convert) .findFirst(); } return result.orElse(null); } }
|
ProviderServiceImpl implements ProviderService { @Override public Provider getProvider(final ProviderKey providerKey) { List<org.guvnor.ala.runtime.providers.Provider> providers = runtimeProvisioningService.getProviders(0, 1000, PROVIDER_TYPE_NAME_SORT, true); Optional<Provider> result = Optional.empty(); if (providers != null) { result = providers.stream() .filter(provider -> provider.getId().equals(providerKey.getId())) .map(this::convert) .findFirst(); } return result.orElse(null); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); }
|
ProviderServiceImpl implements ProviderService { @Override public Provider getProvider(final ProviderKey providerKey) { List<org.guvnor.ala.runtime.providers.Provider> providers = runtimeProvisioningService.getProviders(0, 1000, PROVIDER_TYPE_NAME_SORT, true); Optional<Provider> result = Optional.empty(); if (providers != null) { result = providers.stream() .filter(provider -> provider.getId().equals(providerKey.getId())) .map(this::convert) .findFirst(); } return result.orElse(null); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); @Override Collection<Provider> getProviders(final ProviderType providerType); @Override Collection<ProviderKey> getProvidersKey(final ProviderType providerType); @Override void createProvider(final ProviderType providerType,
final ProviderConfiguration configuration); @Override void deleteProvider(final ProviderKey providerKey); @Override Provider getProvider(final ProviderKey providerKey); }
|
ProviderServiceImpl implements ProviderService { @Override public Provider getProvider(final ProviderKey providerKey) { List<org.guvnor.ala.runtime.providers.Provider> providers = runtimeProvisioningService.getProviders(0, 1000, PROVIDER_TYPE_NAME_SORT, true); Optional<Provider> result = Optional.empty(); if (providers != null) { result = providers.stream() .filter(provider -> provider.getId().equals(providerKey.getId())) .map(this::convert) .findFirst(); } return result.orElse(null); } ProviderServiceImpl(); @Inject ProviderServiceImpl(final RuntimeProvisioningServiceBackend runtimeProvisioningService,
final ProviderConverterFactory providerConverterFactory); @Override Collection<Provider> getProviders(final ProviderType providerType); @Override Collection<ProviderKey> getProvidersKey(final ProviderType providerType); @Override void createProvider(final ProviderType providerType,
final ProviderConfiguration configuration); @Override void deleteProvider(final ProviderKey providerKey); @Override Provider getProvider(final ProviderKey providerKey); }
|
@Test public void testGetOrganizationalUnits() { when(organizationalUnitService.getOrganizationalUnits()).thenReturn(organizationalUnits); List<String> expectedResult = organizationalUnits.stream() .map(OrganizationalUnit::getName) .collect(Collectors.toList()); Collection<String> result = service.getOrganizationUnits(); assertEquals(expectedResult, result); }
|
@Override public Collection<String> getOrganizationUnits() { return organizationalUnitService.getOrganizationalUnits().stream() .map(OrganizationalUnit::getName) .collect(Collectors.toList()); }
|
SourceServiceImpl implements SourceService { @Override public Collection<String> getOrganizationUnits() { return organizationalUnitService.getOrganizationalUnits().stream() .map(OrganizationalUnit::getName) .collect(Collectors.toList()); } }
|
SourceServiceImpl implements SourceService { @Override public Collection<String> getOrganizationUnits() { return organizationalUnitService.getOrganizationalUnits().stream() .map(OrganizationalUnit::getName) .collect(Collectors.toList()); } SourceServiceImpl(); @Inject SourceServiceImpl(OrganizationalUnitService organizationalUnitService,
RepositoryService repositoryService,
ModuleService<? extends Module> moduleService,
AuthorizationManager authorizationManager,
User identity); }
|
SourceServiceImpl implements SourceService { @Override public Collection<String> getOrganizationUnits() { return organizationalUnitService.getOrganizationalUnits().stream() .map(OrganizationalUnit::getName) .collect(Collectors.toList()); } SourceServiceImpl(); @Inject SourceServiceImpl(OrganizationalUnitService organizationalUnitService,
RepositoryService repositoryService,
ModuleService<? extends Module> moduleService,
AuthorizationManager authorizationManager,
User identity); @Override Collection<String> getOrganizationUnits(); @Override Collection<String> getRepositories(final String organizationalUnit); @Override Collection<String> getBranches(final Space space, final String repositoryName); @Override Collection<Module> getModules(final Space space,
final String repositoryAlias,
final String branchName); }
|
SourceServiceImpl implements SourceService { @Override public Collection<String> getOrganizationUnits() { return organizationalUnitService.getOrganizationalUnits().stream() .map(OrganizationalUnit::getName) .collect(Collectors.toList()); } SourceServiceImpl(); @Inject SourceServiceImpl(OrganizationalUnitService organizationalUnitService,
RepositoryService repositoryService,
ModuleService<? extends Module> moduleService,
AuthorizationManager authorizationManager,
User identity); @Override Collection<String> getOrganizationUnits(); @Override Collection<String> getRepositories(final String organizationalUnit); @Override Collection<String> getBranches(final Space space, final String repositoryName); @Override Collection<Module> getModules(final Space space,
final String repositoryAlias,
final String branchName); }
|
@Test public void testGetRepositories() { List<Repository> repositories = mockRepositories("RepoName.", REPOSITORIES_SIZE); OrganizationalUnit organizationalUnit = mock(OrganizationalUnit.class); when(organizationalUnit.getName()).thenReturn(OU_NAME); when(organizationalUnitService.getOrganizationalUnit(OU_NAME)).thenReturn(null); Collection<String> result = service.getRepositories(OU_NAME); assertTrue(result.isEmpty()); when(organizationalUnitService.getOrganizationalUnit(OU_NAME)).thenReturn(organizationalUnit); when(organizationalUnit.getRepositories()).thenReturn(repositories); result = service.getRepositories(OU_NAME); assertTrue(result.isEmpty()); List<Integer> authorizedIndexes = new ArrayList<>(); List<String> authorizedNames = new ArrayList<>(); authorizedIndexes.add(1); authorizedIndexes.add(4); authorizedIndexes.add(6); authorizedIndexes.forEach(index -> { when(authorizationManager.authorize(repositories.get(index), identity)).thenReturn(true); authorizedNames.add(repositories.get(index).getAlias()); }); result = service.getRepositories(OU_NAME); assertEquals(authorizedNames, result); }
|
@Override public Collection<String> getRepositories(final String organizationalUnit) { checkNotNull("organizationalUnit", organizationalUnit); OrganizationalUnit ou = organizationalUnitService.getOrganizationalUnit(organizationalUnit); if (ou == null) { return new ArrayList<>(); } else { return organizationalUnitService.getOrganizationalUnit(organizationalUnit) .getRepositories() .stream() .filter(repository -> authorizationManager.authorize(repository, identity)) .map(Repository::getAlias) .collect(Collectors.toList()); } }
|
SourceServiceImpl implements SourceService { @Override public Collection<String> getRepositories(final String organizationalUnit) { checkNotNull("organizationalUnit", organizationalUnit); OrganizationalUnit ou = organizationalUnitService.getOrganizationalUnit(organizationalUnit); if (ou == null) { return new ArrayList<>(); } else { return organizationalUnitService.getOrganizationalUnit(organizationalUnit) .getRepositories() .stream() .filter(repository -> authorizationManager.authorize(repository, identity)) .map(Repository::getAlias) .collect(Collectors.toList()); } } }
|
SourceServiceImpl implements SourceService { @Override public Collection<String> getRepositories(final String organizationalUnit) { checkNotNull("organizationalUnit", organizationalUnit); OrganizationalUnit ou = organizationalUnitService.getOrganizationalUnit(organizationalUnit); if (ou == null) { return new ArrayList<>(); } else { return organizationalUnitService.getOrganizationalUnit(organizationalUnit) .getRepositories() .stream() .filter(repository -> authorizationManager.authorize(repository, identity)) .map(Repository::getAlias) .collect(Collectors.toList()); } } SourceServiceImpl(); @Inject SourceServiceImpl(OrganizationalUnitService organizationalUnitService,
RepositoryService repositoryService,
ModuleService<? extends Module> moduleService,
AuthorizationManager authorizationManager,
User identity); }
|
SourceServiceImpl implements SourceService { @Override public Collection<String> getRepositories(final String organizationalUnit) { checkNotNull("organizationalUnit", organizationalUnit); OrganizationalUnit ou = organizationalUnitService.getOrganizationalUnit(organizationalUnit); if (ou == null) { return new ArrayList<>(); } else { return organizationalUnitService.getOrganizationalUnit(organizationalUnit) .getRepositories() .stream() .filter(repository -> authorizationManager.authorize(repository, identity)) .map(Repository::getAlias) .collect(Collectors.toList()); } } SourceServiceImpl(); @Inject SourceServiceImpl(OrganizationalUnitService organizationalUnitService,
RepositoryService repositoryService,
ModuleService<? extends Module> moduleService,
AuthorizationManager authorizationManager,
User identity); @Override Collection<String> getOrganizationUnits(); @Override Collection<String> getRepositories(final String organizationalUnit); @Override Collection<String> getBranches(final Space space, final String repositoryName); @Override Collection<Module> getModules(final Space space,
final String repositoryAlias,
final String branchName); }
|
SourceServiceImpl implements SourceService { @Override public Collection<String> getRepositories(final String organizationalUnit) { checkNotNull("organizationalUnit", organizationalUnit); OrganizationalUnit ou = organizationalUnitService.getOrganizationalUnit(organizationalUnit); if (ou == null) { return new ArrayList<>(); } else { return organizationalUnitService.getOrganizationalUnit(organizationalUnit) .getRepositories() .stream() .filter(repository -> authorizationManager.authorize(repository, identity)) .map(Repository::getAlias) .collect(Collectors.toList()); } } SourceServiceImpl(); @Inject SourceServiceImpl(OrganizationalUnitService organizationalUnitService,
RepositoryService repositoryService,
ModuleService<? extends Module> moduleService,
AuthorizationManager authorizationManager,
User identity); @Override Collection<String> getOrganizationUnits(); @Override Collection<String> getRepositories(final String organizationalUnit); @Override Collection<String> getBranches(final Space space, final String repositoryName); @Override Collection<Module> getModules(final Space space,
final String repositoryAlias,
final String branchName); }
|
@Test public void testGetBranches() { final List<Branch> branches = new ArrayList<>(); branches.add(new Branch("branch1", mock(Path.class))); branches.add(new Branch("branch2", mock(Path.class))); branches.add(new Branch("branch3", mock(Path.class))); Repository repository = mock(Repository.class); when(repository.getBranches()).thenReturn(branches); when(repositoryService.getRepositoryFromSpace(SPACE, REPO_NAME)).thenReturn(repository); final Collection<String> result = service.getBranches(SPACE, REPO_NAME); final List<String> originalBranchNames = new ArrayList<>(); for (final Branch branch : branches) { originalBranchNames.add(branch.getName()); } assertEquals(originalBranchNames, result); }
|
@Override public Collection<String> getBranches(final Space space, final String repositoryName) { checkNotNull("repositoryName", repositoryName); final Repository repository = repositoryService.getRepositoryFromSpace(space, repositoryName); return repository != null ? toBranchNames(repository.getBranches()) : new ArrayList<>(); }
|
SourceServiceImpl implements SourceService { @Override public Collection<String> getBranches(final Space space, final String repositoryName) { checkNotNull("repositoryName", repositoryName); final Repository repository = repositoryService.getRepositoryFromSpace(space, repositoryName); return repository != null ? toBranchNames(repository.getBranches()) : new ArrayList<>(); } }
|
SourceServiceImpl implements SourceService { @Override public Collection<String> getBranches(final Space space, final String repositoryName) { checkNotNull("repositoryName", repositoryName); final Repository repository = repositoryService.getRepositoryFromSpace(space, repositoryName); return repository != null ? toBranchNames(repository.getBranches()) : new ArrayList<>(); } SourceServiceImpl(); @Inject SourceServiceImpl(OrganizationalUnitService organizationalUnitService,
RepositoryService repositoryService,
ModuleService<? extends Module> moduleService,
AuthorizationManager authorizationManager,
User identity); }
|
SourceServiceImpl implements SourceService { @Override public Collection<String> getBranches(final Space space, final String repositoryName) { checkNotNull("repositoryName", repositoryName); final Repository repository = repositoryService.getRepositoryFromSpace(space, repositoryName); return repository != null ? toBranchNames(repository.getBranches()) : new ArrayList<>(); } SourceServiceImpl(); @Inject SourceServiceImpl(OrganizationalUnitService organizationalUnitService,
RepositoryService repositoryService,
ModuleService<? extends Module> moduleService,
AuthorizationManager authorizationManager,
User identity); @Override Collection<String> getOrganizationUnits(); @Override Collection<String> getRepositories(final String organizationalUnit); @Override Collection<String> getBranches(final Space space, final String repositoryName); @Override Collection<Module> getModules(final Space space,
final String repositoryAlias,
final String branchName); }
|
SourceServiceImpl implements SourceService { @Override public Collection<String> getBranches(final Space space, final String repositoryName) { checkNotNull("repositoryName", repositoryName); final Repository repository = repositoryService.getRepositoryFromSpace(space, repositoryName); return repository != null ? toBranchNames(repository.getBranches()) : new ArrayList<>(); } SourceServiceImpl(); @Inject SourceServiceImpl(OrganizationalUnitService organizationalUnitService,
RepositoryService repositoryService,
ModuleService<? extends Module> moduleService,
AuthorizationManager authorizationManager,
User identity); @Override Collection<String> getOrganizationUnits(); @Override Collection<String> getRepositories(final String organizationalUnit); @Override Collection<String> getBranches(final Space space, final String repositoryName); @Override Collection<Module> getModules(final Space space,
final String repositoryAlias,
final String branchName); }
|
@Test public void testProjects() { final Repository repository = mock(Repository.class); final Branch branch = new Branch(BRANCH_NAME, mock(Path.class)); doReturn(Optional.of(branch)).when(repository).getBranch(eq(BRANCH_NAME)); @SuppressWarnings("unchecked") final Set<Module> modules = mock(Set.class); when(repositoryService.getRepositoryFromSpace(SPACE, REPO_NAME)).thenReturn(repository); when(moduleService.getAllModules(branch)).thenReturn(modules); final Collection<Module> result = service.getModules(SPACE, REPO_NAME, BRANCH_NAME); assertEquals(modules, result); }
|
@Override public Collection<Module> getModules(final Space space, final String repositoryAlias, final String branchName) { checkNotNull("repositoryAlias", repositoryAlias); checkNotNull("branchName", branchName); final Repository repository = repositoryService.getRepositoryFromSpace(space, repositoryAlias); if (repository == null) { return new ArrayList<>(); } else { final Optional<Branch> branch = repository.getBranch(branchName); if (branch.isPresent()) { return moduleService.getAllModules(branch.get()); } else { return new ArrayList<>(); } } }
|
SourceServiceImpl implements SourceService { @Override public Collection<Module> getModules(final Space space, final String repositoryAlias, final String branchName) { checkNotNull("repositoryAlias", repositoryAlias); checkNotNull("branchName", branchName); final Repository repository = repositoryService.getRepositoryFromSpace(space, repositoryAlias); if (repository == null) { return new ArrayList<>(); } else { final Optional<Branch> branch = repository.getBranch(branchName); if (branch.isPresent()) { return moduleService.getAllModules(branch.get()); } else { return new ArrayList<>(); } } } }
|
SourceServiceImpl implements SourceService { @Override public Collection<Module> getModules(final Space space, final String repositoryAlias, final String branchName) { checkNotNull("repositoryAlias", repositoryAlias); checkNotNull("branchName", branchName); final Repository repository = repositoryService.getRepositoryFromSpace(space, repositoryAlias); if (repository == null) { return new ArrayList<>(); } else { final Optional<Branch> branch = repository.getBranch(branchName); if (branch.isPresent()) { return moduleService.getAllModules(branch.get()); } else { return new ArrayList<>(); } } } SourceServiceImpl(); @Inject SourceServiceImpl(OrganizationalUnitService organizationalUnitService,
RepositoryService repositoryService,
ModuleService<? extends Module> moduleService,
AuthorizationManager authorizationManager,
User identity); }
|
SourceServiceImpl implements SourceService { @Override public Collection<Module> getModules(final Space space, final String repositoryAlias, final String branchName) { checkNotNull("repositoryAlias", repositoryAlias); checkNotNull("branchName", branchName); final Repository repository = repositoryService.getRepositoryFromSpace(space, repositoryAlias); if (repository == null) { return new ArrayList<>(); } else { final Optional<Branch> branch = repository.getBranch(branchName); if (branch.isPresent()) { return moduleService.getAllModules(branch.get()); } else { return new ArrayList<>(); } } } SourceServiceImpl(); @Inject SourceServiceImpl(OrganizationalUnitService organizationalUnitService,
RepositoryService repositoryService,
ModuleService<? extends Module> moduleService,
AuthorizationManager authorizationManager,
User identity); @Override Collection<String> getOrganizationUnits(); @Override Collection<String> getRepositories(final String organizationalUnit); @Override Collection<String> getBranches(final Space space, final String repositoryName); @Override Collection<Module> getModules(final Space space,
final String repositoryAlias,
final String branchName); }
|
SourceServiceImpl implements SourceService { @Override public Collection<Module> getModules(final Space space, final String repositoryAlias, final String branchName) { checkNotNull("repositoryAlias", repositoryAlias); checkNotNull("branchName", branchName); final Repository repository = repositoryService.getRepositoryFromSpace(space, repositoryAlias); if (repository == null) { return new ArrayList<>(); } else { final Optional<Branch> branch = repository.getBranch(branchName); if (branch.isPresent()) { return moduleService.getAllModules(branch.get()); } else { return new ArrayList<>(); } } } SourceServiceImpl(); @Inject SourceServiceImpl(OrganizationalUnitService organizationalUnitService,
RepositoryService repositoryService,
ModuleService<? extends Module> moduleService,
AuthorizationManager authorizationManager,
User identity); @Override Collection<String> getOrganizationUnits(); @Override Collection<String> getRepositories(final String organizationalUnit); @Override Collection<String> getBranches(final Space space, final String repositoryName); @Override Collection<Module> getModules(final Space space,
final String repositoryAlias,
final String branchName); }
|
@Test public void testBeforePipelineExecution() { listener.beforePipelineExecution(new BeforePipelineExecutionEvent(EXECUTION_ID, pipeline)); verify(pipelineStatusChangeEvent, times(1)).fire(new PipelineStatusChangeEvent(traceKey, PipelineStatus.RUNNING)); }
|
@Override public void beforePipelineExecution(BeforePipelineExecutionEvent bpee) { pipelineStatusChangeEvent.fire(new PipelineStatusChangeEvent(new PipelineExecutionTraceKey(bpee.getExecutionId()), PipelineStatus.RUNNING)); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void beforePipelineExecution(BeforePipelineExecutionEvent bpee) { pipelineStatusChangeEvent.fire(new PipelineStatusChangeEvent(new PipelineExecutionTraceKey(bpee.getExecutionId()), PipelineStatus.RUNNING)); } }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void beforePipelineExecution(BeforePipelineExecutionEvent bpee) { pipelineStatusChangeEvent.fire(new PipelineStatusChangeEvent(new PipelineExecutionTraceKey(bpee.getExecutionId()), PipelineStatus.RUNNING)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void beforePipelineExecution(BeforePipelineExecutionEvent bpee) { pipelineStatusChangeEvent.fire(new PipelineStatusChangeEvent(new PipelineExecutionTraceKey(bpee.getExecutionId()), PipelineStatus.RUNNING)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); @Override void beforePipelineExecution(BeforePipelineExecutionEvent bpee); @Override void afterPipelineExecution(AfterPipelineExecutionEvent apee); @Override void beforeStageExecution(BeforeStageExecutionEvent bsee); @Override void onStageError(OnErrorStageExecutionEvent oesee); @Override void afterStageExecution(AfterStageExecutionEvent asee); @Override void onPipelineError(OnErrorPipelineExecutionEvent oepee); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void beforePipelineExecution(BeforePipelineExecutionEvent bpee) { pipelineStatusChangeEvent.fire(new PipelineStatusChangeEvent(new PipelineExecutionTraceKey(bpee.getExecutionId()), PipelineStatus.RUNNING)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); @Override void beforePipelineExecution(BeforePipelineExecutionEvent bpee); @Override void afterPipelineExecution(AfterPipelineExecutionEvent apee); @Override void beforeStageExecution(BeforeStageExecutionEvent bsee); @Override void onStageError(OnErrorStageExecutionEvent oesee); @Override void afterStageExecution(AfterStageExecutionEvent asee); @Override void onPipelineError(OnErrorPipelineExecutionEvent oepee); }
|
@Test public void testAfterPipelineExecution() { listener.afterPipelineExecution(new AfterPipelineExecutionEvent(EXECUTION_ID, pipeline)); verify(pipelineStatusChangeEvent, times(1)).fire(new PipelineStatusChangeEvent(traceKey, PipelineStatus.FINISHED)); }
|
@Override public void afterPipelineExecution(AfterPipelineExecutionEvent apee) { pipelineStatusChangeEvent.fire(new PipelineStatusChangeEvent(new PipelineExecutionTraceKey(apee.getExecutionId()), PipelineStatus.FINISHED)); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void afterPipelineExecution(AfterPipelineExecutionEvent apee) { pipelineStatusChangeEvent.fire(new PipelineStatusChangeEvent(new PipelineExecutionTraceKey(apee.getExecutionId()), PipelineStatus.FINISHED)); } }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void afterPipelineExecution(AfterPipelineExecutionEvent apee) { pipelineStatusChangeEvent.fire(new PipelineStatusChangeEvent(new PipelineExecutionTraceKey(apee.getExecutionId()), PipelineStatus.FINISHED)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void afterPipelineExecution(AfterPipelineExecutionEvent apee) { pipelineStatusChangeEvent.fire(new PipelineStatusChangeEvent(new PipelineExecutionTraceKey(apee.getExecutionId()), PipelineStatus.FINISHED)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); @Override void beforePipelineExecution(BeforePipelineExecutionEvent bpee); @Override void afterPipelineExecution(AfterPipelineExecutionEvent apee); @Override void beforeStageExecution(BeforeStageExecutionEvent bsee); @Override void onStageError(OnErrorStageExecutionEvent oesee); @Override void afterStageExecution(AfterStageExecutionEvent asee); @Override void onPipelineError(OnErrorPipelineExecutionEvent oepee); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void afterPipelineExecution(AfterPipelineExecutionEvent apee) { pipelineStatusChangeEvent.fire(new PipelineStatusChangeEvent(new PipelineExecutionTraceKey(apee.getExecutionId()), PipelineStatus.FINISHED)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); @Override void beforePipelineExecution(BeforePipelineExecutionEvent bpee); @Override void afterPipelineExecution(AfterPipelineExecutionEvent apee); @Override void beforeStageExecution(BeforeStageExecutionEvent bsee); @Override void onStageError(OnErrorStageExecutionEvent oesee); @Override void afterStageExecution(AfterStageExecutionEvent asee); @Override void onPipelineError(OnErrorPipelineExecutionEvent oepee); }
|
@Test public void checkGetTitleWithHasName() { hasName = Optional.of(new MockHasName("name")); assertEquals("name", header.getTitle()); }
|
@Override public String getTitle() { return titleGetter.get(); }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public String getTitle() { return titleGetter.get(); } }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public String getTitle() { return titleGetter.get(); } EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory); EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory,
final String columnGroup); }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public String getTitle() { return titleGetter.get(); } EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory); EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory,
final String columnGroup); @Override String getTitle(); @Override void setTitle(final String title); @Override String getColumnGroup(); @Override void setColumnGroup(final String columnGroup); @Override void destroyResources(); @Override void edit(final GridBodyCellEditContext context); @Override GridCellEditAction getSupportedEditAction(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public String getTitle() { return titleGetter.get(); } EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory); EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory,
final String columnGroup); @Override String getTitle(); @Override void setTitle(final String title); @Override String getColumnGroup(); @Override void setColumnGroup(final String columnGroup); @Override void destroyResources(); @Override void edit(final GridBodyCellEditContext context); @Override GridCellEditAction getSupportedEditAction(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testBeforeStageExecution() { listener.beforeStageExecution(new BeforeStageExecutionEvent(EXECUTION_ID, pipeline, stage)); verify(stageStatusChangeEvent, times(1)).fire(new StageStatusChangeEvent(traceKey, STAGE_NAME, PipelineStatus.RUNNING)); }
|
@Override public void beforeStageExecution(BeforeStageExecutionEvent bsee) { stageStatusChangeEvent.fire(new StageStatusChangeEvent(new PipelineExecutionTraceKey(bsee.getExecutionId()), bsee.getStage().getName(), PipelineStatus.RUNNING)); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void beforeStageExecution(BeforeStageExecutionEvent bsee) { stageStatusChangeEvent.fire(new StageStatusChangeEvent(new PipelineExecutionTraceKey(bsee.getExecutionId()), bsee.getStage().getName(), PipelineStatus.RUNNING)); } }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void beforeStageExecution(BeforeStageExecutionEvent bsee) { stageStatusChangeEvent.fire(new StageStatusChangeEvent(new PipelineExecutionTraceKey(bsee.getExecutionId()), bsee.getStage().getName(), PipelineStatus.RUNNING)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void beforeStageExecution(BeforeStageExecutionEvent bsee) { stageStatusChangeEvent.fire(new StageStatusChangeEvent(new PipelineExecutionTraceKey(bsee.getExecutionId()), bsee.getStage().getName(), PipelineStatus.RUNNING)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); @Override void beforePipelineExecution(BeforePipelineExecutionEvent bpee); @Override void afterPipelineExecution(AfterPipelineExecutionEvent apee); @Override void beforeStageExecution(BeforeStageExecutionEvent bsee); @Override void onStageError(OnErrorStageExecutionEvent oesee); @Override void afterStageExecution(AfterStageExecutionEvent asee); @Override void onPipelineError(OnErrorPipelineExecutionEvent oepee); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void beforeStageExecution(BeforeStageExecutionEvent bsee) { stageStatusChangeEvent.fire(new StageStatusChangeEvent(new PipelineExecutionTraceKey(bsee.getExecutionId()), bsee.getStage().getName(), PipelineStatus.RUNNING)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); @Override void beforePipelineExecution(BeforePipelineExecutionEvent bpee); @Override void afterPipelineExecution(AfterPipelineExecutionEvent apee); @Override void beforeStageExecution(BeforeStageExecutionEvent bsee); @Override void onStageError(OnErrorStageExecutionEvent oesee); @Override void afterStageExecution(AfterStageExecutionEvent asee); @Override void onPipelineError(OnErrorPipelineExecutionEvent oepee); }
|
@Test public void testOnStageError() { listener.onStageError(new OnErrorStageExecutionEvent(EXECUTION_ID, pipeline, stage, throwable)); verify(stageStatusChangeEvent, times(1)).fire(new StageStatusChangeEvent(traceKey, STAGE_NAME, PipelineStatus.ERROR)); }
|
@Override public void onStageError(OnErrorStageExecutionEvent oesee) { stageStatusChangeEvent.fire(new StageStatusChangeEvent(new PipelineExecutionTraceKey(oesee.getExecutionId()), oesee.getStage().getName(), PipelineStatus.ERROR)); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void onStageError(OnErrorStageExecutionEvent oesee) { stageStatusChangeEvent.fire(new StageStatusChangeEvent(new PipelineExecutionTraceKey(oesee.getExecutionId()), oesee.getStage().getName(), PipelineStatus.ERROR)); } }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void onStageError(OnErrorStageExecutionEvent oesee) { stageStatusChangeEvent.fire(new StageStatusChangeEvent(new PipelineExecutionTraceKey(oesee.getExecutionId()), oesee.getStage().getName(), PipelineStatus.ERROR)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void onStageError(OnErrorStageExecutionEvent oesee) { stageStatusChangeEvent.fire(new StageStatusChangeEvent(new PipelineExecutionTraceKey(oesee.getExecutionId()), oesee.getStage().getName(), PipelineStatus.ERROR)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); @Override void beforePipelineExecution(BeforePipelineExecutionEvent bpee); @Override void afterPipelineExecution(AfterPipelineExecutionEvent apee); @Override void beforeStageExecution(BeforeStageExecutionEvent bsee); @Override void onStageError(OnErrorStageExecutionEvent oesee); @Override void afterStageExecution(AfterStageExecutionEvent asee); @Override void onPipelineError(OnErrorPipelineExecutionEvent oepee); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void onStageError(OnErrorStageExecutionEvent oesee) { stageStatusChangeEvent.fire(new StageStatusChangeEvent(new PipelineExecutionTraceKey(oesee.getExecutionId()), oesee.getStage().getName(), PipelineStatus.ERROR)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); @Override void beforePipelineExecution(BeforePipelineExecutionEvent bpee); @Override void afterPipelineExecution(AfterPipelineExecutionEvent apee); @Override void beforeStageExecution(BeforeStageExecutionEvent bsee); @Override void onStageError(OnErrorStageExecutionEvent oesee); @Override void afterStageExecution(AfterStageExecutionEvent asee); @Override void onPipelineError(OnErrorPipelineExecutionEvent oepee); }
|
@Test public void testAfterStageExecution() { listener.afterStageExecution(new AfterStageExecutionEvent(EXECUTION_ID, pipeline, stage)); verify(stageStatusChangeEvent, times(1)).fire(new StageStatusChangeEvent(traceKey, STAGE_NAME, PipelineStatus.FINISHED)); }
|
@Override public void afterStageExecution(AfterStageExecutionEvent asee) { stageStatusChangeEvent.fire(new StageStatusChangeEvent(new PipelineExecutionTraceKey(asee.getExecutionId()), asee.getStage().getName(), PipelineStatus.FINISHED)); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void afterStageExecution(AfterStageExecutionEvent asee) { stageStatusChangeEvent.fire(new StageStatusChangeEvent(new PipelineExecutionTraceKey(asee.getExecutionId()), asee.getStage().getName(), PipelineStatus.FINISHED)); } }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void afterStageExecution(AfterStageExecutionEvent asee) { stageStatusChangeEvent.fire(new StageStatusChangeEvent(new PipelineExecutionTraceKey(asee.getExecutionId()), asee.getStage().getName(), PipelineStatus.FINISHED)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void afterStageExecution(AfterStageExecutionEvent asee) { stageStatusChangeEvent.fire(new StageStatusChangeEvent(new PipelineExecutionTraceKey(asee.getExecutionId()), asee.getStage().getName(), PipelineStatus.FINISHED)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); @Override void beforePipelineExecution(BeforePipelineExecutionEvent bpee); @Override void afterPipelineExecution(AfterPipelineExecutionEvent apee); @Override void beforeStageExecution(BeforeStageExecutionEvent bsee); @Override void onStageError(OnErrorStageExecutionEvent oesee); @Override void afterStageExecution(AfterStageExecutionEvent asee); @Override void onPipelineError(OnErrorPipelineExecutionEvent oepee); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void afterStageExecution(AfterStageExecutionEvent asee) { stageStatusChangeEvent.fire(new StageStatusChangeEvent(new PipelineExecutionTraceKey(asee.getExecutionId()), asee.getStage().getName(), PipelineStatus.FINISHED)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); @Override void beforePipelineExecution(BeforePipelineExecutionEvent bpee); @Override void afterPipelineExecution(AfterPipelineExecutionEvent apee); @Override void beforeStageExecution(BeforeStageExecutionEvent bsee); @Override void onStageError(OnErrorStageExecutionEvent oesee); @Override void afterStageExecution(AfterStageExecutionEvent asee); @Override void onPipelineError(OnErrorPipelineExecutionEvent oepee); }
|
@Test public void testOnPipelineError() { listener.onPipelineError(new OnErrorPipelineExecutionEvent(EXECUTION_ID, pipeline, stage, throwable)); verify(pipelineStatusChangeEvent, times(1)).fire(new PipelineStatusChangeEvent(traceKey, PipelineStatus.ERROR)); }
|
@Override public void onPipelineError(OnErrorPipelineExecutionEvent oepee) { pipelineStatusChangeEvent.fire(new PipelineStatusChangeEvent(new PipelineExecutionTraceKey(oepee.getExecutionId()), PipelineStatus.ERROR)); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void onPipelineError(OnErrorPipelineExecutionEvent oepee) { pipelineStatusChangeEvent.fire(new PipelineStatusChangeEvent(new PipelineExecutionTraceKey(oepee.getExecutionId()), PipelineStatus.ERROR)); } }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void onPipelineError(OnErrorPipelineExecutionEvent oepee) { pipelineStatusChangeEvent.fire(new PipelineStatusChangeEvent(new PipelineExecutionTraceKey(oepee.getExecutionId()), PipelineStatus.ERROR)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void onPipelineError(OnErrorPipelineExecutionEvent oepee) { pipelineStatusChangeEvent.fire(new PipelineStatusChangeEvent(new PipelineExecutionTraceKey(oepee.getExecutionId()), PipelineStatus.ERROR)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); @Override void beforePipelineExecution(BeforePipelineExecutionEvent bpee); @Override void afterPipelineExecution(AfterPipelineExecutionEvent apee); @Override void beforeStageExecution(BeforeStageExecutionEvent bsee); @Override void onStageError(OnErrorStageExecutionEvent oesee); @Override void afterStageExecution(AfterStageExecutionEvent asee); @Override void onPipelineError(OnErrorPipelineExecutionEvent oepee); }
|
PipelineExecutionListener implements PipelineEventListener { @Override public void onPipelineError(OnErrorPipelineExecutionEvent oepee) { pipelineStatusChangeEvent.fire(new PipelineStatusChangeEvent(new PipelineExecutionTraceKey(oepee.getExecutionId()), PipelineStatus.ERROR)); } PipelineExecutionListener(); @Inject PipelineExecutionListener(final Event<PipelineStatusChangeEvent> pipelineStatusChangeEvent,
final Event<StageStatusChangeEvent> stageStatusChangeEvent); @Override void beforePipelineExecution(BeforePipelineExecutionEvent bpee); @Override void afterPipelineExecution(AfterPipelineExecutionEvent apee); @Override void beforeStageExecution(BeforeStageExecutionEvent bsee); @Override void onStageError(OnErrorStageExecutionEvent oesee); @Override void afterStageExecution(AfterStageExecutionEvent asee); @Override void onPipelineError(OnErrorPipelineExecutionEvent oepee); }
|
@Test public void testIsValidContainerNameForValidName() { when(validationService.isValidContainerName(CONTAINER_NAME)).thenReturn(true); service.isValidContainerName(CONTAINER_NAME, validatorCallback); verify(validationService, times(1)).isValidContainerName(CONTAINER_NAME); verify(validatorCallback, times(1)).onSuccess(); verify(validatorCallback, never()).onFailure(); }
|
public void isValidContainerName(final String containerName, final ValidatorCallback callback) { validationService.call(result -> { if (Boolean.TRUE.equals(result)) { callback.onSuccess(); } else { callback.onFailure(); } }).isValidContainerName(containerName); }
|
ProvisioningClientValidationService { public void isValidContainerName(final String containerName, final ValidatorCallback callback) { validationService.call(result -> { if (Boolean.TRUE.equals(result)) { callback.onSuccess(); } else { callback.onFailure(); } }).isValidContainerName(containerName); } }
|
ProvisioningClientValidationService { public void isValidContainerName(final String containerName, final ValidatorCallback callback) { validationService.call(result -> { if (Boolean.TRUE.equals(result)) { callback.onSuccess(); } else { callback.onFailure(); } }).isValidContainerName(containerName); } @Inject ProvisioningClientValidationService(final Caller<ProvisioningValidationService> validationService); }
|
ProvisioningClientValidationService { public void isValidContainerName(final String containerName, final ValidatorCallback callback) { validationService.call(result -> { if (Boolean.TRUE.equals(result)) { callback.onSuccess(); } else { callback.onFailure(); } }).isValidContainerName(containerName); } @Inject ProvisioningClientValidationService(final Caller<ProvisioningValidationService> validationService); void isValidContainerName(final String containerName,
final ValidatorCallback callback); }
|
ProvisioningClientValidationService { public void isValidContainerName(final String containerName, final ValidatorCallback callback) { validationService.call(result -> { if (Boolean.TRUE.equals(result)) { callback.onSuccess(); } else { callback.onFailure(); } }).isValidContainerName(containerName); } @Inject ProvisioningClientValidationService(final Caller<ProvisioningValidationService> validationService); void isValidContainerName(final String containerName,
final ValidatorCallback callback); }
|
@Test public void testIsValidContainerNameForInvalidName() { when(validationService.isValidContainerName(CONTAINER_NAME)).thenReturn(false); service.isValidContainerName(CONTAINER_NAME, validatorCallback); verify(validationService, times(1)).isValidContainerName(CONTAINER_NAME); verify(validatorCallback, times(1)).onFailure(); verify(validatorCallback, never()).onSuccess(); }
|
public void isValidContainerName(final String containerName, final ValidatorCallback callback) { validationService.call(result -> { if (Boolean.TRUE.equals(result)) { callback.onSuccess(); } else { callback.onFailure(); } }).isValidContainerName(containerName); }
|
ProvisioningClientValidationService { public void isValidContainerName(final String containerName, final ValidatorCallback callback) { validationService.call(result -> { if (Boolean.TRUE.equals(result)) { callback.onSuccess(); } else { callback.onFailure(); } }).isValidContainerName(containerName); } }
|
ProvisioningClientValidationService { public void isValidContainerName(final String containerName, final ValidatorCallback callback) { validationService.call(result -> { if (Boolean.TRUE.equals(result)) { callback.onSuccess(); } else { callback.onFailure(); } }).isValidContainerName(containerName); } @Inject ProvisioningClientValidationService(final Caller<ProvisioningValidationService> validationService); }
|
ProvisioningClientValidationService { public void isValidContainerName(final String containerName, final ValidatorCallback callback) { validationService.call(result -> { if (Boolean.TRUE.equals(result)) { callback.onSuccess(); } else { callback.onFailure(); } }).isValidContainerName(containerName); } @Inject ProvisioningClientValidationService(final Caller<ProvisioningValidationService> validationService); void isValidContainerName(final String containerName,
final ValidatorCallback callback); }
|
ProvisioningClientValidationService { public void isValidContainerName(final String containerName, final ValidatorCallback callback) { validationService.call(result -> { if (Boolean.TRUE.equals(result)) { callback.onSuccess(); } else { callback.onFailure(); } }).isValidContainerName(containerName); } @Inject ProvisioningClientValidationService(final Caller<ProvisioningValidationService> validationService); void isValidContainerName(final String containerName,
final ValidatorCallback callback); }
|
@Test public void testAddNewProviderType() { List<ProviderType> providerTypes = mockProviderTypeList(PROVIDER_TYPE_COUNT); Map<ProviderType, ProviderTypeStatus> providerTypeStatusMap = new HashMap<>(); providerTypes.forEach(providerType -> providerTypeStatusMap.put(providerType, mock(ProviderTypeStatus.class))); when(providerTypeService.getProviderTypesStatus()).thenReturn(providerTypeStatusMap); List<ProviderType> properlyInstalledProviderTypes = new ArrayList<>(); properlyInstalledProviderTypes.add(providerTypes.get(0)); properlyInstalledProviderTypes.add(providerTypes.get(3)); properlyInstalledProviderTypes.add(providerTypes.get(5)); properlyInstalledProviderTypes.forEach(providerType -> when(handlerRegistry.isProviderInstalled(providerType.getKey())).thenReturn(true)); perspective.onAddNewProviderType(mock(AddNewProviderTypeEvent.class)); verify(providerTypeService, times(1)).getProviderTypesStatus(); verify(enableProviderTypeWizard, times(1)).start(providerTypesCaptor.capture()); assertEquals(properlyInstalledProviderTypes.size(), providerTypesCaptor.getValue().size()); @SuppressWarnings("unchecked") List<Pair<ProviderType, ProviderTypeStatus>> capturedValues = providerTypesCaptor.getValue(); capturedValues.forEach(value -> assertTrue(properlyInstalledProviderTypes.contains(value.getK1()))); }
|
protected void onAddNewProviderType(@Observes final AddNewProviderTypeEvent event) { providerTypeService.call((Map<ProviderType, ProviderTypeStatus> result) -> { enableProviderTypeWizard.start(buildProviderStatusList(result)); }).getProviderTypesStatus(); }
|
ProvisioningManagementPerspective { protected void onAddNewProviderType(@Observes final AddNewProviderTypeEvent event) { providerTypeService.call((Map<ProviderType, ProviderTypeStatus> result) -> { enableProviderTypeWizard.start(buildProviderStatusList(result)); }).getProviderTypesStatus(); } }
|
ProvisioningManagementPerspective { protected void onAddNewProviderType(@Observes final AddNewProviderTypeEvent event) { providerTypeService.call((Map<ProviderType, ProviderTypeStatus> result) -> { enableProviderTypeWizard.start(buildProviderStatusList(result)); }).getProviderTypesStatus(); } @Inject ProvisioningManagementPerspective(final Caller<ProviderTypeService> providerTypeService,
final Caller<RuntimeService> runtimeService,
final EnableProviderTypeWizard enableProviderTypeWizard,
final NewProviderWizard newProviderWizard,
final NewDeployWizard newDeployWizard,
final ClientProviderHandlerRegistry handlerRegistry); }
|
ProvisioningManagementPerspective { protected void onAddNewProviderType(@Observes final AddNewProviderTypeEvent event) { providerTypeService.call((Map<ProviderType, ProviderTypeStatus> result) -> { enableProviderTypeWizard.start(buildProviderStatusList(result)); }).getProviderTypesStatus(); } @Inject ProvisioningManagementPerspective(final Caller<ProviderTypeService> providerTypeService,
final Caller<RuntimeService> runtimeService,
final EnableProviderTypeWizard enableProviderTypeWizard,
final NewProviderWizard newProviderWizard,
final NewDeployWizard newDeployWizard,
final ClientProviderHandlerRegistry handlerRegistry); @Perspective PerspectiveDefinition buildPerspective(); }
|
ProvisioningManagementPerspective { protected void onAddNewProviderType(@Observes final AddNewProviderTypeEvent event) { providerTypeService.call((Map<ProviderType, ProviderTypeStatus> result) -> { enableProviderTypeWizard.start(buildProviderStatusList(result)); }).getProviderTypesStatus(); } @Inject ProvisioningManagementPerspective(final Caller<ProviderTypeService> providerTypeService,
final Caller<RuntimeService> runtimeService,
final EnableProviderTypeWizard enableProviderTypeWizard,
final NewProviderWizard newProviderWizard,
final NewDeployWizard newDeployWizard,
final ClientProviderHandlerRegistry handlerRegistry); @Perspective PerspectiveDefinition buildPerspective(); static final String IDENTIFIER; }
|
@Test public void testAddNewProvider() { ProviderType providerType = mockProviderType(""); perspective.onAddNewProvider(new AddNewProviderEvent(providerType)); verify(newProviderWizard, times(1)).start(providerType); }
|
protected void onAddNewProvider(@Observes final AddNewProviderEvent event) { if (event.getProviderType() != null && event.getProviderType().getKey() != null) { newProviderWizard.start(event.getProviderType()); } }
|
ProvisioningManagementPerspective { protected void onAddNewProvider(@Observes final AddNewProviderEvent event) { if (event.getProviderType() != null && event.getProviderType().getKey() != null) { newProviderWizard.start(event.getProviderType()); } } }
|
ProvisioningManagementPerspective { protected void onAddNewProvider(@Observes final AddNewProviderEvent event) { if (event.getProviderType() != null && event.getProviderType().getKey() != null) { newProviderWizard.start(event.getProviderType()); } } @Inject ProvisioningManagementPerspective(final Caller<ProviderTypeService> providerTypeService,
final Caller<RuntimeService> runtimeService,
final EnableProviderTypeWizard enableProviderTypeWizard,
final NewProviderWizard newProviderWizard,
final NewDeployWizard newDeployWizard,
final ClientProviderHandlerRegistry handlerRegistry); }
|
ProvisioningManagementPerspective { protected void onAddNewProvider(@Observes final AddNewProviderEvent event) { if (event.getProviderType() != null && event.getProviderType().getKey() != null) { newProviderWizard.start(event.getProviderType()); } } @Inject ProvisioningManagementPerspective(final Caller<ProviderTypeService> providerTypeService,
final Caller<RuntimeService> runtimeService,
final EnableProviderTypeWizard enableProviderTypeWizard,
final NewProviderWizard newProviderWizard,
final NewDeployWizard newDeployWizard,
final ClientProviderHandlerRegistry handlerRegistry); @Perspective PerspectiveDefinition buildPerspective(); }
|
ProvisioningManagementPerspective { protected void onAddNewProvider(@Observes final AddNewProviderEvent event) { if (event.getProviderType() != null && event.getProviderType().getKey() != null) { newProviderWizard.start(event.getProviderType()); } } @Inject ProvisioningManagementPerspective(final Caller<ProviderTypeService> providerTypeService,
final Caller<RuntimeService> runtimeService,
final EnableProviderTypeWizard enableProviderTypeWizard,
final NewProviderWizard newProviderWizard,
final NewDeployWizard newDeployWizard,
final ClientProviderHandlerRegistry handlerRegistry); @Perspective PerspectiveDefinition buildPerspective(); static final String IDENTIFIER; }
|
@Test public void testAddNewRuntime() { Provider provider = new Provider(mockProviderKey(mockProviderTypeKey(""), ""), mock(ProviderConfiguration.class)); @SuppressWarnings("unchecked") List<PipelineKey> pipelines = mock(List.class); when(runtimeService.getPipelines(provider.getKey().getProviderTypeKey())).thenReturn(pipelines); perspective.onAddNewRuntime(new AddNewRuntimeEvent(provider)); verify(newDeployWizard, times(1)).start(provider, pipelines); }
|
protected void onAddNewRuntime(@Observes final AddNewRuntimeEvent event) { if (event.getProvider() != null) { runtimeService.call((Collection<PipelineKey> result) -> { newDeployWizard.start(event.getProvider(), result); }).getPipelines(event.getProvider().getKey().getProviderTypeKey()); } }
|
ProvisioningManagementPerspective { protected void onAddNewRuntime(@Observes final AddNewRuntimeEvent event) { if (event.getProvider() != null) { runtimeService.call((Collection<PipelineKey> result) -> { newDeployWizard.start(event.getProvider(), result); }).getPipelines(event.getProvider().getKey().getProviderTypeKey()); } } }
|
ProvisioningManagementPerspective { protected void onAddNewRuntime(@Observes final AddNewRuntimeEvent event) { if (event.getProvider() != null) { runtimeService.call((Collection<PipelineKey> result) -> { newDeployWizard.start(event.getProvider(), result); }).getPipelines(event.getProvider().getKey().getProviderTypeKey()); } } @Inject ProvisioningManagementPerspective(final Caller<ProviderTypeService> providerTypeService,
final Caller<RuntimeService> runtimeService,
final EnableProviderTypeWizard enableProviderTypeWizard,
final NewProviderWizard newProviderWizard,
final NewDeployWizard newDeployWizard,
final ClientProviderHandlerRegistry handlerRegistry); }
|
ProvisioningManagementPerspective { protected void onAddNewRuntime(@Observes final AddNewRuntimeEvent event) { if (event.getProvider() != null) { runtimeService.call((Collection<PipelineKey> result) -> { newDeployWizard.start(event.getProvider(), result); }).getPipelines(event.getProvider().getKey().getProviderTypeKey()); } } @Inject ProvisioningManagementPerspective(final Caller<ProviderTypeService> providerTypeService,
final Caller<RuntimeService> runtimeService,
final EnableProviderTypeWizard enableProviderTypeWizard,
final NewProviderWizard newProviderWizard,
final NewDeployWizard newDeployWizard,
final ClientProviderHandlerRegistry handlerRegistry); @Perspective PerspectiveDefinition buildPerspective(); }
|
ProvisioningManagementPerspective { protected void onAddNewRuntime(@Observes final AddNewRuntimeEvent event) { if (event.getProvider() != null) { runtimeService.call((Collection<PipelineKey> result) -> { newDeployWizard.start(event.getProvider(), result); }).getPipelines(event.getProvider().getKey().getProviderTypeKey()); } } @Inject ProvisioningManagementPerspective(final Caller<ProviderTypeService> providerTypeService,
final Caller<RuntimeService> runtimeService,
final EnableProviderTypeWizard enableProviderTypeWizard,
final NewProviderWizard newProviderWizard,
final NewDeployWizard newDeployWizard,
final ClientProviderHandlerRegistry handlerRegistry); @Perspective PerspectiveDefinition buildPerspective(); static final String IDENTIFIER; }
|
@Test public void testShowInformationPopup() { popupHelper.showInformationPopup(MESSAGE); verify(popupHelper, times(1)).newNotificationPopup(CommonConstants.INSTANCE.Information(), MESSAGE); verifyPopupWasShown(yesNoCancelPopup); }
|
public void showInformationPopup(final String message) { showNotificationPopup(CommonConstants.INSTANCE.Information(), message); }
|
PopupHelper implements HasBusyIndicator { public void showInformationPopup(final String message) { showNotificationPopup(CommonConstants.INSTANCE.Information(), message); } }
|
PopupHelper implements HasBusyIndicator { public void showInformationPopup(final String message) { showNotificationPopup(CommonConstants.INSTANCE.Information(), message); } @Inject PopupHelper(final ErrorPopup errorPopup); }
|
PopupHelper implements HasBusyIndicator { public void showInformationPopup(final String message) { showNotificationPopup(CommonConstants.INSTANCE.Information(), message); } @Inject PopupHelper(final ErrorPopup errorPopup); void showInformationPopup(final String message); void showErrorPopup(final String message); void showErrorPopup(final String message,
final String detail); void showYesNoPopup(final String title,
final String message,
final Command yesCommand,
final Command noCommand); @Override void showBusyIndicator(final String message); @Override void hideBusyIndicator(); ErrorCallback<Message> getPopupErrorCallback(); }
|
PopupHelper implements HasBusyIndicator { public void showInformationPopup(final String message) { showNotificationPopup(CommonConstants.INSTANCE.Information(), message); } @Inject PopupHelper(final ErrorPopup errorPopup); void showInformationPopup(final String message); void showErrorPopup(final String message); void showErrorPopup(final String message,
final String detail); void showYesNoPopup(final String title,
final String message,
final Command yesCommand,
final Command noCommand); @Override void showBusyIndicator(final String message); @Override void hideBusyIndicator(); ErrorCallback<Message> getPopupErrorCallback(); }
|
@Test public void checkGetTitleWithoutHasName() { hasName = Optional.empty(); assertEquals("", header.getTitle()); }
|
@Override public String getTitle() { return titleGetter.get(); }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public String getTitle() { return titleGetter.get(); } }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public String getTitle() { return titleGetter.get(); } EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory); EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory,
final String columnGroup); }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public String getTitle() { return titleGetter.get(); } EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory); EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory,
final String columnGroup); @Override String getTitle(); @Override void setTitle(final String title); @Override String getColumnGroup(); @Override void setColumnGroup(final String columnGroup); @Override void destroyResources(); @Override void edit(final GridBodyCellEditContext context); @Override GridCellEditAction getSupportedEditAction(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public String getTitle() { return titleGetter.get(); } EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory); EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory,
final String columnGroup); @Override String getTitle(); @Override void setTitle(final String title); @Override String getColumnGroup(); @Override void setColumnGroup(final String columnGroup); @Override void destroyResources(); @Override void edit(final GridBodyCellEditContext context); @Override GridCellEditAction getSupportedEditAction(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testShowErrorPopup() { popupHelper.showErrorPopup(MESSAGE); errorPopup.showError(MESSAGE); }
|
public void showErrorPopup(final String message) { errorPopup.showError(message, STANDARD); }
|
PopupHelper implements HasBusyIndicator { public void showErrorPopup(final String message) { errorPopup.showError(message, STANDARD); } }
|
PopupHelper implements HasBusyIndicator { public void showErrorPopup(final String message) { errorPopup.showError(message, STANDARD); } @Inject PopupHelper(final ErrorPopup errorPopup); }
|
PopupHelper implements HasBusyIndicator { public void showErrorPopup(final String message) { errorPopup.showError(message, STANDARD); } @Inject PopupHelper(final ErrorPopup errorPopup); void showInformationPopup(final String message); void showErrorPopup(final String message); void showErrorPopup(final String message,
final String detail); void showYesNoPopup(final String title,
final String message,
final Command yesCommand,
final Command noCommand); @Override void showBusyIndicator(final String message); @Override void hideBusyIndicator(); ErrorCallback<Message> getPopupErrorCallback(); }
|
PopupHelper implements HasBusyIndicator { public void showErrorPopup(final String message) { errorPopup.showError(message, STANDARD); } @Inject PopupHelper(final ErrorPopup errorPopup); void showInformationPopup(final String message); void showErrorPopup(final String message); void showErrorPopup(final String message,
final String detail); void showYesNoPopup(final String title,
final String message,
final Command yesCommand,
final Command noCommand); @Override void showBusyIndicator(final String message); @Override void hideBusyIndicator(); ErrorCallback<Message> getPopupErrorCallback(); }
|
@Test public void testShowErrorPopupWithDetail() { popupHelper.showErrorPopup(MESSAGE, DETAIL); errorPopup.showError(MESSAGE, DETAIL); }
|
public void showErrorPopup(final String message) { errorPopup.showError(message, STANDARD); }
|
PopupHelper implements HasBusyIndicator { public void showErrorPopup(final String message) { errorPopup.showError(message, STANDARD); } }
|
PopupHelper implements HasBusyIndicator { public void showErrorPopup(final String message) { errorPopup.showError(message, STANDARD); } @Inject PopupHelper(final ErrorPopup errorPopup); }
|
PopupHelper implements HasBusyIndicator { public void showErrorPopup(final String message) { errorPopup.showError(message, STANDARD); } @Inject PopupHelper(final ErrorPopup errorPopup); void showInformationPopup(final String message); void showErrorPopup(final String message); void showErrorPopup(final String message,
final String detail); void showYesNoPopup(final String title,
final String message,
final Command yesCommand,
final Command noCommand); @Override void showBusyIndicator(final String message); @Override void hideBusyIndicator(); ErrorCallback<Message> getPopupErrorCallback(); }
|
PopupHelper implements HasBusyIndicator { public void showErrorPopup(final String message) { errorPopup.showError(message, STANDARD); } @Inject PopupHelper(final ErrorPopup errorPopup); void showInformationPopup(final String message); void showErrorPopup(final String message); void showErrorPopup(final String message,
final String detail); void showYesNoPopup(final String title,
final String message,
final Command yesCommand,
final Command noCommand); @Override void showBusyIndicator(final String message); @Override void hideBusyIndicator(); ErrorCallback<Message> getPopupErrorCallback(); }
|
@Test public void testShowYesNoPopup() { Command yesCommand = mock(Command.class); Command noCommand = mock(Command.class); popupHelper.showYesNoPopup(TITLE, MESSAGE, yesCommand, noCommand); verify(popupHelper, times(1)).newYesNoPopup(TITLE, MESSAGE, yesCommand, noCommand); verifyPopupWasShown(yesNoCancelPopup); }
|
public void showYesNoPopup(final String title, final String message, final Command yesCommand, final Command noCommand) { YesNoCancelPopup popup = newYesNoPopup(title, message, yesCommand, noCommand); popup.setClosable(false); popup.clearScrollHeight(); popup.show(); }
|
PopupHelper implements HasBusyIndicator { public void showYesNoPopup(final String title, final String message, final Command yesCommand, final Command noCommand) { YesNoCancelPopup popup = newYesNoPopup(title, message, yesCommand, noCommand); popup.setClosable(false); popup.clearScrollHeight(); popup.show(); } }
|
PopupHelper implements HasBusyIndicator { public void showYesNoPopup(final String title, final String message, final Command yesCommand, final Command noCommand) { YesNoCancelPopup popup = newYesNoPopup(title, message, yesCommand, noCommand); popup.setClosable(false); popup.clearScrollHeight(); popup.show(); } @Inject PopupHelper(final ErrorPopup errorPopup); }
|
PopupHelper implements HasBusyIndicator { public void showYesNoPopup(final String title, final String message, final Command yesCommand, final Command noCommand) { YesNoCancelPopup popup = newYesNoPopup(title, message, yesCommand, noCommand); popup.setClosable(false); popup.clearScrollHeight(); popup.show(); } @Inject PopupHelper(final ErrorPopup errorPopup); void showInformationPopup(final String message); void showErrorPopup(final String message); void showErrorPopup(final String message,
final String detail); void showYesNoPopup(final String title,
final String message,
final Command yesCommand,
final Command noCommand); @Override void showBusyIndicator(final String message); @Override void hideBusyIndicator(); ErrorCallback<Message> getPopupErrorCallback(); }
|
PopupHelper implements HasBusyIndicator { public void showYesNoPopup(final String title, final String message, final Command yesCommand, final Command noCommand) { YesNoCancelPopup popup = newYesNoPopup(title, message, yesCommand, noCommand); popup.setClosable(false); popup.clearScrollHeight(); popup.show(); } @Inject PopupHelper(final ErrorPopup errorPopup); void showInformationPopup(final String message); void showErrorPopup(final String message); void showErrorPopup(final String message,
final String detail); void showYesNoPopup(final String title,
final String message,
final Command yesCommand,
final Command noCommand); @Override void showBusyIndicator(final String message); @Override void hideBusyIndicator(); ErrorCallback<Message> getPopupErrorCallback(); }
|
@Test public void testGetPopupErrorCallback() { Message message = mock(Message.class); popupHelper.getPopupErrorCallback().error(message, new Exception(MESSAGE)); verify(popupHelper, times(1)).showErrorPopup(MESSAGE); }
|
public ErrorCallback<Message> getPopupErrorCallback() { return (message, throwable) -> { showErrorPopup(throwable.getMessage()); return false; }; }
|
PopupHelper implements HasBusyIndicator { public ErrorCallback<Message> getPopupErrorCallback() { return (message, throwable) -> { showErrorPopup(throwable.getMessage()); return false; }; } }
|
PopupHelper implements HasBusyIndicator { public ErrorCallback<Message> getPopupErrorCallback() { return (message, throwable) -> { showErrorPopup(throwable.getMessage()); return false; }; } @Inject PopupHelper(final ErrorPopup errorPopup); }
|
PopupHelper implements HasBusyIndicator { public ErrorCallback<Message> getPopupErrorCallback() { return (message, throwable) -> { showErrorPopup(throwable.getMessage()); return false; }; } @Inject PopupHelper(final ErrorPopup errorPopup); void showInformationPopup(final String message); void showErrorPopup(final String message); void showErrorPopup(final String message,
final String detail); void showYesNoPopup(final String title,
final String message,
final Command yesCommand,
final Command noCommand); @Override void showBusyIndicator(final String message); @Override void hideBusyIndicator(); ErrorCallback<Message> getPopupErrorCallback(); }
|
PopupHelper implements HasBusyIndicator { public ErrorCallback<Message> getPopupErrorCallback() { return (message, throwable) -> { showErrorPopup(throwable.getMessage()); return false; }; } @Inject PopupHelper(final ErrorPopup errorPopup); void showInformationPopup(final String message); void showErrorPopup(final String message); void showErrorPopup(final String message,
final String detail); void showYesNoPopup(final String title,
final String message,
final Command yesCommand,
final Command noCommand); @Override void showBusyIndicator(final String message); @Override void hideBusyIndicator(); ErrorCallback<Message> getPopupErrorCallback(); }
|
@Test public void testSetupItems() { List<RuntimeListItem> items = mockItems(ITEMS_COUNT); presenter.setupItems(items); verify(runtimePresenterInstance, times(ITEMS_COUNT)).get(); verify(view, times(ITEMS_COUNT)).addListItem(any()); for (int i = 0; i < ITEMS_COUNT; i++) { verify(runtimePresenters.get(i), times(1)).setup(items.get(i)); verify(view, times(1)).addListItem(runtimePresenters.get(i).getView()); } }
|
public void setupItems(final Collection<RuntimeListItem> response) { clear(); response.forEach(item -> { final RuntimePresenter runtimePresenter = newRuntimePresenter(); runtimePresenter.setup(item); currentItems.add(runtimePresenter); view.addListItem(runtimePresenter.getView()); }); }
|
ProviderStatusPresenter { public void setupItems(final Collection<RuntimeListItem> response) { clear(); response.forEach(item -> { final RuntimePresenter runtimePresenter = newRuntimePresenter(); runtimePresenter.setup(item); currentItems.add(runtimePresenter); view.addListItem(runtimePresenter.getView()); }); } }
|
ProviderStatusPresenter { public void setupItems(final Collection<RuntimeListItem> response) { clear(); response.forEach(item -> { final RuntimePresenter runtimePresenter = newRuntimePresenter(); runtimePresenter.setup(item); currentItems.add(runtimePresenter); view.addListItem(runtimePresenter.getView()); }); } @Inject ProviderStatusPresenter(final View view,
final ManagedInstance<RuntimePresenter> runtimePresenterInstance); }
|
ProviderStatusPresenter { public void setupItems(final Collection<RuntimeListItem> response) { clear(); response.forEach(item -> { final RuntimePresenter runtimePresenter = newRuntimePresenter(); runtimePresenter.setup(item); currentItems.add(runtimePresenter); view.addListItem(runtimePresenter.getView()); }); } @Inject ProviderStatusPresenter(final View view,
final ManagedInstance<RuntimePresenter> runtimePresenterInstance); @PostConstruct void init(); void setupItems(final Collection<RuntimeListItem> response); boolean removeItem(final RuntimeKey runtimeKey); boolean removeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); boolean isEmpty(); void clear(); View getView(); }
|
ProviderStatusPresenter { public void setupItems(final Collection<RuntimeListItem> response) { clear(); response.forEach(item -> { final RuntimePresenter runtimePresenter = newRuntimePresenter(); runtimePresenter.setup(item); currentItems.add(runtimePresenter); view.addListItem(runtimePresenter.getView()); }); } @Inject ProviderStatusPresenter(final View view,
final ManagedInstance<RuntimePresenter> runtimePresenterInstance); @PostConstruct void init(); void setupItems(final Collection<RuntimeListItem> response); boolean removeItem(final RuntimeKey runtimeKey); boolean removeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); boolean isEmpty(); void clear(); View getView(); }
|
@Test public void testClear() { List<RuntimeListItem> items = mockItems(ITEMS_COUNT); presenter.setupItems(items); presenter.clear(); verify(view, times(2)).clear(); runtimePresenters.forEach(runtimePresenter -> verify(runtimePresenterInstance, times(1)).destroy(runtimePresenter)); verify(runtimePresenterInstance, times(ITEMS_COUNT)).destroy(any()); }
|
public void clear() { view.clear(); clearItems(); }
|
ProviderStatusPresenter { public void clear() { view.clear(); clearItems(); } }
|
ProviderStatusPresenter { public void clear() { view.clear(); clearItems(); } @Inject ProviderStatusPresenter(final View view,
final ManagedInstance<RuntimePresenter> runtimePresenterInstance); }
|
ProviderStatusPresenter { public void clear() { view.clear(); clearItems(); } @Inject ProviderStatusPresenter(final View view,
final ManagedInstance<RuntimePresenter> runtimePresenterInstance); @PostConstruct void init(); void setupItems(final Collection<RuntimeListItem> response); boolean removeItem(final RuntimeKey runtimeKey); boolean removeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); boolean isEmpty(); void clear(); View getView(); }
|
ProviderStatusPresenter { public void clear() { view.clear(); clearItems(); } @Inject ProviderStatusPresenter(final View view,
final ManagedInstance<RuntimePresenter> runtimePresenterInstance); @PostConstruct void init(); void setupItems(final Collection<RuntimeListItem> response); boolean removeItem(final RuntimeKey runtimeKey); boolean removeItem(final PipelineExecutionTraceKey pipelineExecutionTraceKey); boolean isEmpty(); void clear(); View getView(); }
|
@Test public void testGetView() { assertEquals(view, presenter.getView()); }
|
public View getView() { return view; }
|
ProviderStatusEmptyPresenter { public View getView() { return view; } }
|
ProviderStatusEmptyPresenter { public View getView() { return view; } @Inject ProviderStatusEmptyPresenter(final View view,
final Event<RefreshRuntimeEvent> refreshRuntimeEvent); }
|
ProviderStatusEmptyPresenter { public View getView() { return view; } @Inject ProviderStatusEmptyPresenter(final View view,
final Event<RefreshRuntimeEvent> refreshRuntimeEvent); @PostConstruct void init(); View getView(); void setup(final ProviderKey providerKey); void onRefresh(); }
|
ProviderStatusEmptyPresenter { public View getView() { return view; } @Inject ProviderStatusEmptyPresenter(final View view,
final Event<RefreshRuntimeEvent> refreshRuntimeEvent); @PostConstruct void init(); View getView(); void setup(final ProviderKey providerKey); void onRefresh(); }
|
@Test public void testOnRefresh() { presenter.onRefresh(); verify(refreshRuntimeEvent, times(1)).fire(new RefreshRuntimeEvent(providerKey)); }
|
public void onRefresh() { refreshRuntimeEvent.fire(new RefreshRuntimeEvent(providerKey)); }
|
ProviderStatusEmptyPresenter { public void onRefresh() { refreshRuntimeEvent.fire(new RefreshRuntimeEvent(providerKey)); } }
|
ProviderStatusEmptyPresenter { public void onRefresh() { refreshRuntimeEvent.fire(new RefreshRuntimeEvent(providerKey)); } @Inject ProviderStatusEmptyPresenter(final View view,
final Event<RefreshRuntimeEvent> refreshRuntimeEvent); }
|
ProviderStatusEmptyPresenter { public void onRefresh() { refreshRuntimeEvent.fire(new RefreshRuntimeEvent(providerKey)); } @Inject ProviderStatusEmptyPresenter(final View view,
final Event<RefreshRuntimeEvent> refreshRuntimeEvent); @PostConstruct void init(); View getView(); void setup(final ProviderKey providerKey); void onRefresh(); }
|
ProviderStatusEmptyPresenter { public void onRefresh() { refreshRuntimeEvent.fire(new RefreshRuntimeEvent(providerKey)); } @Inject ProviderStatusEmptyPresenter(final View view,
final Event<RefreshRuntimeEvent> refreshRuntimeEvent); @PostConstruct void init(); View getView(); void setup(final ProviderKey providerKey); void onRefresh(); }
|
@Test public void testBuildRuntimeStatus() { assertEquals(RuntimeStatus.UNKNOWN, RuntimePresenterHelper.buildRuntimeStatus(null)); assertEquals(RuntimeStatus.RUNNING, RuntimePresenterHelper.buildRuntimeStatus("RUNNING")); assertEquals(RuntimeStatus.STOPPED, RuntimePresenterHelper.buildRuntimeStatus("STOPPED")); assertEquals(RuntimeStatus.UNKNOWN, RuntimePresenterHelper.buildRuntimeStatus("UNKNOWN")); assertEquals(RuntimeStatus.UNKNOWN, RuntimePresenterHelper.buildRuntimeStatus("whatever value")); }
|
public static RuntimeStatus buildRuntimeStatus(String status) { if (status == null) { return RuntimeStatus.UNKNOWN; } switch (status) { case "READY": return RuntimeStatus.READY; case "RUNNING": return RuntimeStatus.RUNNING; case "STOPPED": return RuntimeStatus.STOPPED; case "UNKNOWN": return RuntimeStatus.UNKNOWN; default: return RuntimeStatus.UNKNOWN; } }
|
RuntimePresenterHelper { public static RuntimeStatus buildRuntimeStatus(String status) { if (status == null) { return RuntimeStatus.UNKNOWN; } switch (status) { case "READY": return RuntimeStatus.READY; case "RUNNING": return RuntimeStatus.RUNNING; case "STOPPED": return RuntimeStatus.STOPPED; case "UNKNOWN": return RuntimeStatus.UNKNOWN; default: return RuntimeStatus.UNKNOWN; } } }
|
RuntimePresenterHelper { public static RuntimeStatus buildRuntimeStatus(String status) { if (status == null) { return RuntimeStatus.UNKNOWN; } switch (status) { case "READY": return RuntimeStatus.READY; case "RUNNING": return RuntimeStatus.RUNNING; case "STOPPED": return RuntimeStatus.STOPPED; case "UNKNOWN": return RuntimeStatus.UNKNOWN; default: return RuntimeStatus.UNKNOWN; } } }
|
RuntimePresenterHelper { public static RuntimeStatus buildRuntimeStatus(String status) { if (status == null) { return RuntimeStatus.UNKNOWN; } switch (status) { case "READY": return RuntimeStatus.READY; case "RUNNING": return RuntimeStatus.RUNNING; case "STOPPED": return RuntimeStatus.STOPPED; case "UNKNOWN": return RuntimeStatus.UNKNOWN; default: return RuntimeStatus.UNKNOWN; } } static Collection<String> buildIconStyle(final PipelineStatus status); static RuntimeStatus buildRuntimeStatus(String status); static Collection<String> buildIconStyle(final RuntimeStatus status); static State buildStageState(final PipelineStatus stageStatus); }
|
RuntimePresenterHelper { public static RuntimeStatus buildRuntimeStatus(String status) { if (status == null) { return RuntimeStatus.UNKNOWN; } switch (status) { case "READY": return RuntimeStatus.READY; case "RUNNING": return RuntimeStatus.RUNNING; case "STOPPED": return RuntimeStatus.STOPPED; case "UNKNOWN": return RuntimeStatus.UNKNOWN; default: return RuntimeStatus.UNKNOWN; } } static Collection<String> buildIconStyle(final PipelineStatus status); static RuntimeStatus buildRuntimeStatus(String status); static Collection<String> buildIconStyle(final RuntimeStatus status); static State buildStageState(final PipelineStatus stageStatus); }
|
@Test public void testBuildStageState() { assertEquals(State.DONE, RuntimePresenterHelper.buildStageState(null)); assertEquals(State.EXECUTING, RuntimePresenterHelper.buildStageState(PipelineStatus.RUNNING)); assertEquals(State.ERROR, RuntimePresenterHelper.buildStageState(PipelineStatus.ERROR)); assertEquals(State.STOPPED, RuntimePresenterHelper.buildStageState(PipelineStatus.STOPPED)); }
|
public static State buildStageState(final PipelineStatus stageStatus) { if (stageStatus == null) { return State.DONE; } switch (stageStatus) { case RUNNING: return State.EXECUTING; case ERROR: return State.ERROR; case STOPPED: return State.STOPPED; default: return State.DONE; } }
|
RuntimePresenterHelper { public static State buildStageState(final PipelineStatus stageStatus) { if (stageStatus == null) { return State.DONE; } switch (stageStatus) { case RUNNING: return State.EXECUTING; case ERROR: return State.ERROR; case STOPPED: return State.STOPPED; default: return State.DONE; } } }
|
RuntimePresenterHelper { public static State buildStageState(final PipelineStatus stageStatus) { if (stageStatus == null) { return State.DONE; } switch (stageStatus) { case RUNNING: return State.EXECUTING; case ERROR: return State.ERROR; case STOPPED: return State.STOPPED; default: return State.DONE; } } }
|
RuntimePresenterHelper { public static State buildStageState(final PipelineStatus stageStatus) { if (stageStatus == null) { return State.DONE; } switch (stageStatus) { case RUNNING: return State.EXECUTING; case ERROR: return State.ERROR; case STOPPED: return State.STOPPED; default: return State.DONE; } } static Collection<String> buildIconStyle(final PipelineStatus status); static RuntimeStatus buildRuntimeStatus(String status); static Collection<String> buildIconStyle(final RuntimeStatus status); static State buildStageState(final PipelineStatus stageStatus); }
|
RuntimePresenterHelper { public static State buildStageState(final PipelineStatus stageStatus) { if (stageStatus == null) { return State.DONE; } switch (stageStatus) { case RUNNING: return State.EXECUTING; case ERROR: return State.ERROR; case STOPPED: return State.STOPPED; default: return State.DONE; } } static Collection<String> buildIconStyle(final PipelineStatus status); static RuntimeStatus buildRuntimeStatus(String status); static Collection<String> buildIconStyle(final RuntimeStatus status); static State buildStageState(final PipelineStatus stageStatus); }
|
@Test public void checkSetTitleWithHasName() { final HasName mockHasName = new MockHasName("name"); hasName = Optional.of(mockHasName); header.setTitle("new-name"); assertEquals("new-name", mockHasName.getName().getValue()); }
|
@Override public void setTitle(final String title) { titleSetter.accept(title); }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public void setTitle(final String title) { titleSetter.accept(title); } }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public void setTitle(final String title) { titleSetter.accept(title); } EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory); EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory,
final String columnGroup); }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public void setTitle(final String title) { titleSetter.accept(title); } EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory); EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory,
final String columnGroup); @Override String getTitle(); @Override void setTitle(final String title); @Override String getColumnGroup(); @Override void setColumnGroup(final String columnGroup); @Override void destroyResources(); @Override void edit(final GridBodyCellEditContext context); @Override GridCellEditAction getSupportedEditAction(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public void setTitle(final String title) { titleSetter.accept(title); } EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory); EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory,
final String columnGroup); @Override String getTitle(); @Override void setTitle(final String title); @Override String getColumnGroup(); @Override void setColumnGroup(final String columnGroup); @Override void destroyResources(); @Override void edit(final GridBodyCellEditContext context); @Override GridCellEditAction getSupportedEditAction(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testGetPMMLDocuments() { final Path dmnModelPath = mock(Path.class); final Metadata metadata = mock(Metadata.class); final PMMLDocumentMetadata pmmlDocument = mock(PMMLDocumentMetadata.class); final Import import1 = mock(Import.class); final List<Import> imports = singletonList(import1); final Path path1 = mock(Path.class); final Path path2 = mock(Path.class); final List<Path> paths = asList(path1, path2); when(metadata.getPath()).thenReturn(dmnModelPath); when(import1.getLocationURI()).thenReturn("document1.pmml"); when(pathsHelper.getRelativeURI(dmnModelPath, path1)).thenReturn("document1.pmml"); when(pathsHelper.getRelativeURI(dmnModelPath, path2)).thenReturn("document2.pmml"); when(pmmlDocumentFactory.getDocumentByPath(path1)).thenReturn(pmmlDocument); doReturn(paths).when(helper).getPMMLDocumentPaths(metadata); final Map<Import, PMMLDocumentMetadata> importDefinitions = helper.getPMMLDocuments(metadata, imports); assertEquals(1, importDefinitions.size()); assertEquals(pmmlDocument, importDefinitions.get(import1)); }
|
@Override public Map<Import, PMMLDocumentMetadata> getPMMLDocuments(final Metadata metadata, final List<Import> imports) { final Map<Import, PMMLDocumentMetadata> pmmlDocuments = new HashMap<>(); if (imports.size() > 0) { for (final Path pmmlDocumentPath : getPMMLDocumentPaths(metadata)) { findImportByPMMLDocument(metadata.getPath(), pmmlDocumentPath, imports).ifPresent(anImport -> { pmmlDocuments.put(anImport, pmmlDocumentFactory.getDocumentByPath(pmmlDocumentPath)); }); } } return pmmlDocuments; }
|
DMNMarshallerImportsHelperStandaloneImpl implements DMNMarshallerImportsHelperStandalone { @Override public Map<Import, PMMLDocumentMetadata> getPMMLDocuments(final Metadata metadata, final List<Import> imports) { final Map<Import, PMMLDocumentMetadata> pmmlDocuments = new HashMap<>(); if (imports.size() > 0) { for (final Path pmmlDocumentPath : getPMMLDocumentPaths(metadata)) { findImportByPMMLDocument(metadata.getPath(), pmmlDocumentPath, imports).ifPresent(anImport -> { pmmlDocuments.put(anImport, pmmlDocumentFactory.getDocumentByPath(pmmlDocumentPath)); }); } } return pmmlDocuments; } }
|
DMNMarshallerImportsHelperStandaloneImpl implements DMNMarshallerImportsHelperStandalone { @Override public Map<Import, PMMLDocumentMetadata> getPMMLDocuments(final Metadata metadata, final List<Import> imports) { final Map<Import, PMMLDocumentMetadata> pmmlDocuments = new HashMap<>(); if (imports.size() > 0) { for (final Path pmmlDocumentPath : getPMMLDocumentPaths(metadata)) { findImportByPMMLDocument(metadata.getPath(), pmmlDocumentPath, imports).ifPresent(anImport -> { pmmlDocuments.put(anImport, pmmlDocumentFactory.getDocumentByPath(pmmlDocumentPath)); }); } } return pmmlDocuments; } DMNMarshallerImportsHelperStandaloneImpl(); @Inject DMNMarshallerImportsHelperStandaloneImpl(final DMNPathsHelper pathsHelper,
final WorkspaceProjectService projectService,
final DMNMarshaller marshaller,
final DMNIOHelper dmnIOHelper,
final PMMLIncludedDocumentFactory pmmlDocumentFactory,
final @Named("ioStrategy") IOService ioService); }
|
DMNMarshallerImportsHelperStandaloneImpl implements DMNMarshallerImportsHelperStandalone { @Override public Map<Import, PMMLDocumentMetadata> getPMMLDocuments(final Metadata metadata, final List<Import> imports) { final Map<Import, PMMLDocumentMetadata> pmmlDocuments = new HashMap<>(); if (imports.size() > 0) { for (final Path pmmlDocumentPath : getPMMLDocumentPaths(metadata)) { findImportByPMMLDocument(metadata.getPath(), pmmlDocumentPath, imports).ifPresent(anImport -> { pmmlDocuments.put(anImport, pmmlDocumentFactory.getDocumentByPath(pmmlDocumentPath)); }); } } return pmmlDocuments; } DMNMarshallerImportsHelperStandaloneImpl(); @Inject DMNMarshallerImportsHelperStandaloneImpl(final DMNPathsHelper pathsHelper,
final WorkspaceProjectService projectService,
final DMNMarshaller marshaller,
final DMNIOHelper dmnIOHelper,
final PMMLIncludedDocumentFactory pmmlDocumentFactory,
final @Named("ioStrategy") IOService ioService); @Override Map<Import, Definitions> getImportDefinitions(final Metadata metadata,
final List<Import> imports); @Override Map<Import, PMMLDocumentMetadata> getPMMLDocuments(final Metadata metadata,
final List<Import> imports); @Override Map<Import, String> getImportXML(final Metadata metadata,
final List<Import> imports); @Override Path getDMNModelPath(final Metadata metadata,
final String modelNamespace,
final String modelName); @Override List<DRGElement> getImportedDRGElements(final Map<Import, Definitions> importDefinitions); @Override List<ItemDefinition> getImportedItemDefinitions(final Map<Import, Definitions> importDefinitions); @Override List<ItemDefinition> getImportedItemDefinitionsByNamespace(final WorkspaceProject workspaceProject,
final String modelName,
final String namespace); @Override Optional<InputStream> loadPath(final Path path); }
|
DMNMarshallerImportsHelperStandaloneImpl implements DMNMarshallerImportsHelperStandalone { @Override public Map<Import, PMMLDocumentMetadata> getPMMLDocuments(final Metadata metadata, final List<Import> imports) { final Map<Import, PMMLDocumentMetadata> pmmlDocuments = new HashMap<>(); if (imports.size() > 0) { for (final Path pmmlDocumentPath : getPMMLDocumentPaths(metadata)) { findImportByPMMLDocument(metadata.getPath(), pmmlDocumentPath, imports).ifPresent(anImport -> { pmmlDocuments.put(anImport, pmmlDocumentFactory.getDocumentByPath(pmmlDocumentPath)); }); } } return pmmlDocuments; } DMNMarshallerImportsHelperStandaloneImpl(); @Inject DMNMarshallerImportsHelperStandaloneImpl(final DMNPathsHelper pathsHelper,
final WorkspaceProjectService projectService,
final DMNMarshaller marshaller,
final DMNIOHelper dmnIOHelper,
final PMMLIncludedDocumentFactory pmmlDocumentFactory,
final @Named("ioStrategy") IOService ioService); @Override Map<Import, Definitions> getImportDefinitions(final Metadata metadata,
final List<Import> imports); @Override Map<Import, PMMLDocumentMetadata> getPMMLDocuments(final Metadata metadata,
final List<Import> imports); @Override Map<Import, String> getImportXML(final Metadata metadata,
final List<Import> imports); @Override Path getDMNModelPath(final Metadata metadata,
final String modelNamespace,
final String modelName); @Override List<DRGElement> getImportedDRGElements(final Map<Import, Definitions> importDefinitions); @Override List<ItemDefinition> getImportedItemDefinitions(final Map<Import, Definitions> importDefinitions); @Override List<ItemDefinition> getImportedItemDefinitionsByNamespace(final WorkspaceProject workspaceProject,
final String modelName,
final String namespace); @Override Optional<InputStream> loadPath(final Path path); static final QName NAMESPACE; }
|
@Test public void testGetValidatorImportReaderResolver() { final String modelNamespace = "0000-1111-2222-3333"; final String modelName = "model.dmn"; final String locationURI = "file.pmml"; final String pmmlXML = "<pmml/>"; final Path modelPath = mock(Path.class); final URI pmmlURI = URI.create(locationURI); final Path pmmlPath = mock(Path.class); final InputStream inputStream = mock(InputStream.class); when(importsHelper.getDMNModelPath(metadata, modelNamespace, modelName)).thenReturn(modelPath); when(importsHelper.loadPath(pmmlPath)).thenReturn(Optional.of(inputStream)); when(dmnIOHelper.isAsString(inputStream)).thenReturn(pmmlXML); doReturn(pmmlURI).when(domainValidator).getPMMLURI(modelPath, locationURI); doReturn(pmmlPath).when(domainValidator).getPath(pmmlURI); final Reader actualReader = domainValidator.getValidatorImportReaderResolver(metadata).newReader(modelNamespace, modelName, locationURI); final Reader expectedReader = new StringReader(pmmlXML); assertContent(expectedReader, actualReader); }
|
DMNValidator.ValidatorBuilder.ValidatorImportReaderResolver getValidatorImportReaderResolver(final Metadata metadata) { return (modelNamespace, modelName, locationURI) -> { final Path modelPath = importsHelper.getDMNModelPath(metadata, modelNamespace, modelName); final URI pmmlURI = getPMMLURI(modelPath, locationURI); final String pmmlXML = importsHelper.loadPath(getPath(pmmlURI)).map(dmnIOHelper::isAsString).orElse(""); return getStringReader(pmmlXML); }; }
|
DMNDomainValidatorImpl implements DMNDomainValidator { DMNValidator.ValidatorBuilder.ValidatorImportReaderResolver getValidatorImportReaderResolver(final Metadata metadata) { return (modelNamespace, modelName, locationURI) -> { final Path modelPath = importsHelper.getDMNModelPath(metadata, modelNamespace, modelName); final URI pmmlURI = getPMMLURI(modelPath, locationURI); final String pmmlXML = importsHelper.loadPath(getPath(pmmlURI)).map(dmnIOHelper::isAsString).orElse(""); return getStringReader(pmmlXML); }; } }
|
DMNDomainValidatorImpl implements DMNDomainValidator { DMNValidator.ValidatorBuilder.ValidatorImportReaderResolver getValidatorImportReaderResolver(final Metadata metadata) { return (modelNamespace, modelName, locationURI) -> { final Path modelPath = importsHelper.getDMNModelPath(metadata, modelNamespace, modelName); final URI pmmlURI = getPMMLURI(modelPath, locationURI); final String pmmlXML = importsHelper.loadPath(getPath(pmmlURI)).map(dmnIOHelper::isAsString).orElse(""); return getStringReader(pmmlXML); }; } @Inject DMNDomainValidatorImpl(final DMNMarshallerStandalone dmnMarshaller,
final DMNDiagramUtils dmnDiagramUtils,
final DMNMarshallerImportsHelperStandalone importsHelper,
final DMNIOHelper dmnIOHelper); }
|
DMNDomainValidatorImpl implements DMNDomainValidator { DMNValidator.ValidatorBuilder.ValidatorImportReaderResolver getValidatorImportReaderResolver(final Metadata metadata) { return (modelNamespace, modelName, locationURI) -> { final Path modelPath = importsHelper.getDMNModelPath(metadata, modelNamespace, modelName); final URI pmmlURI = getPMMLURI(modelPath, locationURI); final String pmmlXML = importsHelper.loadPath(getPath(pmmlURI)).map(dmnIOHelper::isAsString).orElse(""); return getStringReader(pmmlXML); }; } @Inject DMNDomainValidatorImpl(final DMNMarshallerStandalone dmnMarshaller,
final DMNDiagramUtils dmnDiagramUtils,
final DMNMarshallerImportsHelperStandalone importsHelper,
final DMNIOHelper dmnIOHelper); @PostConstruct void setupValidator(); @Override String getDefinitionSetId(); @Override @SuppressWarnings("unchecked") void validate(final Diagram diagram,
final Consumer<Collection<DomainViolation>> resultConsumer); @Override Collection<DomainViolation> validate(final Diagram diagram,
final String diagramXml); }
|
DMNDomainValidatorImpl implements DMNDomainValidator { DMNValidator.ValidatorBuilder.ValidatorImportReaderResolver getValidatorImportReaderResolver(final Metadata metadata) { return (modelNamespace, modelName, locationURI) -> { final Path modelPath = importsHelper.getDMNModelPath(metadata, modelNamespace, modelName); final URI pmmlURI = getPMMLURI(modelPath, locationURI); final String pmmlXML = importsHelper.loadPath(getPath(pmmlURI)).map(dmnIOHelper::isAsString).orElse(""); return getStringReader(pmmlXML); }; } @Inject DMNDomainValidatorImpl(final DMNMarshallerStandalone dmnMarshaller,
final DMNDiagramUtils dmnDiagramUtils,
final DMNMarshallerImportsHelperStandalone importsHelper,
final DMNIOHelper dmnIOHelper); @PostConstruct void setupValidator(); @Override String getDefinitionSetId(); @Override @SuppressWarnings("unchecked") void validate(final Diagram diagram,
final Consumer<Collection<DomainViolation>> resultConsumer); @Override Collection<DomainViolation> validate(final Diagram diagram,
final String diagramXml); }
|
@Test public void testDestroy() { presenter.destroy(); verify(actionItemPresenterInstance, times(1)).destroy(startActionPresenter); verify(actionItemPresenterInstance, times(1)).destroy(stopActionPresenter); verify(actionItemPresenterInstance, times(1)).destroy(deleteActionPresenter); verify(actionItemSeparatorPresenterInstance, times(1)).destroy(separatorPresenter); verify(actionItemSeparatorPresenterInstance, times(1)).destroy(secondarySeparatorPresenter); }
|
@PreDestroy public void destroy() { clearPipeline(); actionItemPresenterInstance.destroy(startAction); actionItemPresenterInstance.destroy(stopAction); actionItemPresenterInstance.destroy(deleteAction); actionItemSeparatorPresenterInstance.destroy(separator); actionItemSeparatorPresenterInstance.destroy(secondarySeparator); actionItemPresenterInstance.destroy(showErrorAction); }
|
RuntimePresenter { @PreDestroy public void destroy() { clearPipeline(); actionItemPresenterInstance.destroy(startAction); actionItemPresenterInstance.destroy(stopAction); actionItemPresenterInstance.destroy(deleteAction); actionItemSeparatorPresenterInstance.destroy(separator); actionItemSeparatorPresenterInstance.destroy(secondarySeparator); actionItemPresenterInstance.destroy(showErrorAction); } }
|
RuntimePresenter { @PreDestroy public void destroy() { clearPipeline(); actionItemPresenterInstance.destroy(startAction); actionItemPresenterInstance.destroy(stopAction); actionItemPresenterInstance.destroy(deleteAction); actionItemSeparatorPresenterInstance.destroy(separator); actionItemSeparatorPresenterInstance.destroy(secondarySeparator); actionItemPresenterInstance.destroy(showErrorAction); } @Inject RuntimePresenter(final View view,
final PipelinePresenter pipelinePresenter,
final ManagedInstance<StagePresenter> stagePresenterInstance,
final ManagedInstance<TransitionPresenter> transitionPresenterInstance,
final ManagedInstance<RuntimeActionItemPresenter> actionItemPresenterInstance,
final ManagedInstance<RuntimeActionItemSeparatorPresenter> actionItemSeparatorPresenterInstance,
final Caller<RuntimeService> runtimeService,
final Event<NotificationEvent> notification,
final PopupHelper popupHelper,
final TranslationService translationService); }
|
RuntimePresenter { @PreDestroy public void destroy() { clearPipeline(); actionItemPresenterInstance.destroy(startAction); actionItemPresenterInstance.destroy(stopAction); actionItemPresenterInstance.destroy(deleteAction); actionItemSeparatorPresenterInstance.destroy(separator); actionItemSeparatorPresenterInstance.destroy(secondarySeparator); actionItemPresenterInstance.destroy(showErrorAction); } @Inject RuntimePresenter(final View view,
final PipelinePresenter pipelinePresenter,
final ManagedInstance<StagePresenter> stagePresenterInstance,
final ManagedInstance<TransitionPresenter> transitionPresenterInstance,
final ManagedInstance<RuntimeActionItemPresenter> actionItemPresenterInstance,
final ManagedInstance<RuntimeActionItemSeparatorPresenter> actionItemSeparatorPresenterInstance,
final Caller<RuntimeService> runtimeService,
final Event<NotificationEvent> notification,
final PopupHelper popupHelper,
final TranslationService translationService); @PostConstruct void init(); @PreDestroy void destroy(); View getView(); void setup(final RuntimeListItem runtimeListItem); RuntimeListItem getItem(); void onStageStatusChange(@Observes final StageStatusChangeEvent event); void onPipelineStatusChange(@Observes final PipelineStatusChangeEvent event); void onPipelineExecutionChange(@Observes final PipelineExecutionChangeEvent event); void onRuntimeChangeEvent(@Observes final RuntimeChangeEvent event); }
|
RuntimePresenter { @PreDestroy public void destroy() { clearPipeline(); actionItemPresenterInstance.destroy(startAction); actionItemPresenterInstance.destroy(stopAction); actionItemPresenterInstance.destroy(deleteAction); actionItemSeparatorPresenterInstance.destroy(separator); actionItemSeparatorPresenterInstance.destroy(secondarySeparator); actionItemPresenterInstance.destroy(showErrorAction); } @Inject RuntimePresenter(final View view,
final PipelinePresenter pipelinePresenter,
final ManagedInstance<StagePresenter> stagePresenterInstance,
final ManagedInstance<TransitionPresenter> transitionPresenterInstance,
final ManagedInstance<RuntimeActionItemPresenter> actionItemPresenterInstance,
final ManagedInstance<RuntimeActionItemSeparatorPresenter> actionItemSeparatorPresenterInstance,
final Caller<RuntimeService> runtimeService,
final Event<NotificationEvent> notification,
final PopupHelper popupHelper,
final TranslationService translationService); @PostConstruct void init(); @PreDestroy void destroy(); View getView(); void setup(final RuntimeListItem runtimeListItem); RuntimeListItem getItem(); void onStageStatusChange(@Observes final StageStatusChangeEvent event); void onPipelineStatusChange(@Observes final PipelineStatusChangeEvent event); void onPipelineExecutionChange(@Observes final PipelineExecutionChangeEvent event); void onRuntimeChangeEvent(@Observes final RuntimeChangeEvent event); }
|
@Test public void testGetView() { assertEquals(view, presenter.getView()); }
|
public View getView() { return view; }
|
RuntimePresenter { public View getView() { return view; } }
|
RuntimePresenter { public View getView() { return view; } @Inject RuntimePresenter(final View view,
final PipelinePresenter pipelinePresenter,
final ManagedInstance<StagePresenter> stagePresenterInstance,
final ManagedInstance<TransitionPresenter> transitionPresenterInstance,
final ManagedInstance<RuntimeActionItemPresenter> actionItemPresenterInstance,
final ManagedInstance<RuntimeActionItemSeparatorPresenter> actionItemSeparatorPresenterInstance,
final Caller<RuntimeService> runtimeService,
final Event<NotificationEvent> notification,
final PopupHelper popupHelper,
final TranslationService translationService); }
|
RuntimePresenter { public View getView() { return view; } @Inject RuntimePresenter(final View view,
final PipelinePresenter pipelinePresenter,
final ManagedInstance<StagePresenter> stagePresenterInstance,
final ManagedInstance<TransitionPresenter> transitionPresenterInstance,
final ManagedInstance<RuntimeActionItemPresenter> actionItemPresenterInstance,
final ManagedInstance<RuntimeActionItemSeparatorPresenter> actionItemSeparatorPresenterInstance,
final Caller<RuntimeService> runtimeService,
final Event<NotificationEvent> notification,
final PopupHelper popupHelper,
final TranslationService translationService); @PostConstruct void init(); @PreDestroy void destroy(); View getView(); void setup(final RuntimeListItem runtimeListItem); RuntimeListItem getItem(); void onStageStatusChange(@Observes final StageStatusChangeEvent event); void onPipelineStatusChange(@Observes final PipelineStatusChangeEvent event); void onPipelineExecutionChange(@Observes final PipelineExecutionChangeEvent event); void onRuntimeChangeEvent(@Observes final RuntimeChangeEvent event); }
|
RuntimePresenter { public View getView() { return view; } @Inject RuntimePresenter(final View view,
final PipelinePresenter pipelinePresenter,
final ManagedInstance<StagePresenter> stagePresenterInstance,
final ManagedInstance<TransitionPresenter> transitionPresenterInstance,
final ManagedInstance<RuntimeActionItemPresenter> actionItemPresenterInstance,
final ManagedInstance<RuntimeActionItemSeparatorPresenter> actionItemSeparatorPresenterInstance,
final Caller<RuntimeService> runtimeService,
final Event<NotificationEvent> notification,
final PopupHelper popupHelper,
final TranslationService translationService); @PostConstruct void init(); @PreDestroy void destroy(); View getView(); void setup(final RuntimeListItem runtimeListItem); RuntimeListItem getItem(); void onStageStatusChange(@Observes final StageStatusChangeEvent event); void onPipelineStatusChange(@Observes final PipelineStatusChangeEvent event); void onPipelineExecutionChange(@Observes final PipelineExecutionChangeEvent event); void onRuntimeChangeEvent(@Observes final RuntimeChangeEvent event); }
|
@Test public void testGetView() { assertEquals(view, presenter.getView()); }
|
public View getView() { return view; }
|
RuntimeActionItemSeparatorPresenter { public View getView() { return view; } }
|
RuntimeActionItemSeparatorPresenter { public View getView() { return view; } @Inject RuntimeActionItemSeparatorPresenter(final View view); }
|
RuntimeActionItemSeparatorPresenter { public View getView() { return view; } @Inject RuntimeActionItemSeparatorPresenter(final View view); @PostConstruct void init(); View getView(); }
|
RuntimeActionItemSeparatorPresenter { public View getView() { return view; } @Inject RuntimeActionItemSeparatorPresenter(final View view); @PostConstruct void init(); View getView(); }
|
@Test public void testSetup() { presenter.setup(LABEL, command); verify(view, times(1)).setLabel(LABEL); presenter.onActionClick(); verify(command, times(1)).execute(); }
|
public void setup(final String label, final Command command) { view.setLabel(label); this.command = command; }
|
RuntimeActionItemPresenter { public void setup(final String label, final Command command) { view.setLabel(label); this.command = command; } }
|
RuntimeActionItemPresenter { public void setup(final String label, final Command command) { view.setLabel(label); this.command = command; } @Inject RuntimeActionItemPresenter(final View view); }
|
RuntimeActionItemPresenter { public void setup(final String label, final Command command) { view.setLabel(label); this.command = command; } @Inject RuntimeActionItemPresenter(final View view); @PostConstruct void init(); void setup(final String label,
final Command command); void setEnabled(final boolean enabled); View getView(); }
|
RuntimeActionItemPresenter { public void setup(final String label, final Command command) { view.setLabel(label); this.command = command; } @Inject RuntimeActionItemPresenter(final View view); @PostConstruct void init(); void setup(final String label,
final Command command); void setEnabled(final boolean enabled); View getView(); }
|
@Test public void testSetEnabledTrue() { presenter.setEnabled(true); verify(view, times(1)).setEnabled(true); }
|
public void setEnabled(final boolean enabled) { view.setEnabled(enabled); }
|
RuntimeActionItemPresenter { public void setEnabled(final boolean enabled) { view.setEnabled(enabled); } }
|
RuntimeActionItemPresenter { public void setEnabled(final boolean enabled) { view.setEnabled(enabled); } @Inject RuntimeActionItemPresenter(final View view); }
|
RuntimeActionItemPresenter { public void setEnabled(final boolean enabled) { view.setEnabled(enabled); } @Inject RuntimeActionItemPresenter(final View view); @PostConstruct void init(); void setup(final String label,
final Command command); void setEnabled(final boolean enabled); View getView(); }
|
RuntimeActionItemPresenter { public void setEnabled(final boolean enabled) { view.setEnabled(enabled); } @Inject RuntimeActionItemPresenter(final View view); @PostConstruct void init(); void setup(final String label,
final Command command); void setEnabled(final boolean enabled); View getView(); }
|
@Test public void testSetEnabledFalse() { presenter.setEnabled(false); verify(view, times(1)).setEnabled(false); }
|
public void setEnabled(final boolean enabled) { view.setEnabled(enabled); }
|
RuntimeActionItemPresenter { public void setEnabled(final boolean enabled) { view.setEnabled(enabled); } }
|
RuntimeActionItemPresenter { public void setEnabled(final boolean enabled) { view.setEnabled(enabled); } @Inject RuntimeActionItemPresenter(final View view); }
|
RuntimeActionItemPresenter { public void setEnabled(final boolean enabled) { view.setEnabled(enabled); } @Inject RuntimeActionItemPresenter(final View view); @PostConstruct void init(); void setup(final String label,
final Command command); void setEnabled(final boolean enabled); View getView(); }
|
RuntimeActionItemPresenter { public void setEnabled(final boolean enabled) { view.setEnabled(enabled); } @Inject RuntimeActionItemPresenter(final View view); @PostConstruct void init(); void setup(final String label,
final Command command); void setEnabled(final boolean enabled); View getView(); }
|
@Test public void testGetView() { assertEquals(view, presenter.getView()); }
|
public View getView() { return view; }
|
RuntimeActionItemPresenter { public View getView() { return view; } }
|
RuntimeActionItemPresenter { public View getView() { return view; } @Inject RuntimeActionItemPresenter(final View view); }
|
RuntimeActionItemPresenter { public View getView() { return view; } @Inject RuntimeActionItemPresenter(final View view); @PostConstruct void init(); void setup(final String label,
final Command command); void setEnabled(final boolean enabled); View getView(); }
|
RuntimeActionItemPresenter { public View getView() { return view; } @Inject RuntimeActionItemPresenter(final View view); @PostConstruct void init(); void setup(final String label,
final Command command); void setEnabled(final boolean enabled); View getView(); }
|
@Test public void testOnProviderSelectedWithRuntimes() { prepareRuntimesInfo(); when(runtimeItems.isEmpty()).thenReturn(false); presenter.onProviderSelected(new ProviderSelectedEvent(providerKey)); verifyUILoadedWithItems(1); verifyRuntimesInfoLoaded(1); }
|
public void onProviderSelected(@Observes final ProviderSelectedEvent event) { if (event.getProviderKey() != null) { load(event.getProviderKey()); } }
|
ProviderPresenter { public void onProviderSelected(@Observes final ProviderSelectedEvent event) { if (event.getProviderKey() != null) { load(event.getProviderKey()); } } }
|
ProviderPresenter { public void onProviderSelected(@Observes final ProviderSelectedEvent event) { if (event.getProviderKey() != null) { load(event.getProviderKey()); } } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); }
|
ProviderPresenter { public void onProviderSelected(@Observes final ProviderSelectedEvent event) { if (event.getProviderKey() != null) { load(event.getProviderKey()); } } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); @PostConstruct void init(); void onProviderSelected(@Observes final ProviderSelectedEvent event); void onRefreshRuntime(@Observes final RefreshRuntimeEvent event); void refresh(); void onRemoveProvider(); void removeProvider(); void deploy(); IsElement getView(); }
|
ProviderPresenter { public void onProviderSelected(@Observes final ProviderSelectedEvent event) { if (event.getProviderKey() != null) { load(event.getProviderKey()); } } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); @PostConstruct void init(); void onProviderSelected(@Observes final ProviderSelectedEvent event); void onRefreshRuntime(@Observes final RefreshRuntimeEvent event); void refresh(); void onRemoveProvider(); void removeProvider(); void deploy(); IsElement getView(); }
|
@Test public void testOnProviderSelectedWithNoRuntimes() { prepareRuntimesInfo(); when(runtimeItems.isEmpty()).thenReturn(true); presenter.onProviderSelected(new ProviderSelectedEvent(providerKey)); verifyUILoadedWithNoItems(1); verifyRuntimesInfoLoaded(1); }
|
public void onProviderSelected(@Observes final ProviderSelectedEvent event) { if (event.getProviderKey() != null) { load(event.getProviderKey()); } }
|
ProviderPresenter { public void onProviderSelected(@Observes final ProviderSelectedEvent event) { if (event.getProviderKey() != null) { load(event.getProviderKey()); } } }
|
ProviderPresenter { public void onProviderSelected(@Observes final ProviderSelectedEvent event) { if (event.getProviderKey() != null) { load(event.getProviderKey()); } } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); }
|
ProviderPresenter { public void onProviderSelected(@Observes final ProviderSelectedEvent event) { if (event.getProviderKey() != null) { load(event.getProviderKey()); } } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); @PostConstruct void init(); void onProviderSelected(@Observes final ProviderSelectedEvent event); void onRefreshRuntime(@Observes final RefreshRuntimeEvent event); void refresh(); void onRemoveProvider(); void removeProvider(); void deploy(); IsElement getView(); }
|
ProviderPresenter { public void onProviderSelected(@Observes final ProviderSelectedEvent event) { if (event.getProviderKey() != null) { load(event.getProviderKey()); } } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); @PostConstruct void init(); void onProviderSelected(@Observes final ProviderSelectedEvent event); void onRefreshRuntime(@Observes final RefreshRuntimeEvent event); void refresh(); void onRemoveProvider(); void removeProvider(); void deploy(); IsElement getView(); }
|
@Test public void testOnRefreshRuntimesWithItems() { prepareRefreshWithItems(); presenter.onRefreshRuntime(new RefreshRuntimeEvent(providerKey)); verify(providerStatusPresenter, times(2)).setupItems(runtimeItems); verify(view, times(2)).setStatus(providerStatusPresenterView); verifyRuntimesInfoLoaded(2); }
|
public void onRefreshRuntime(@Observes final RefreshRuntimeEvent event) { if (event.getProviderKey() != null && event.getProviderKey().equals(provider.getKey())) { load(event.getProviderKey()); } }
|
ProviderPresenter { public void onRefreshRuntime(@Observes final RefreshRuntimeEvent event) { if (event.getProviderKey() != null && event.getProviderKey().equals(provider.getKey())) { load(event.getProviderKey()); } } }
|
ProviderPresenter { public void onRefreshRuntime(@Observes final RefreshRuntimeEvent event) { if (event.getProviderKey() != null && event.getProviderKey().equals(provider.getKey())) { load(event.getProviderKey()); } } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); }
|
ProviderPresenter { public void onRefreshRuntime(@Observes final RefreshRuntimeEvent event) { if (event.getProviderKey() != null && event.getProviderKey().equals(provider.getKey())) { load(event.getProviderKey()); } } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); @PostConstruct void init(); void onProviderSelected(@Observes final ProviderSelectedEvent event); void onRefreshRuntime(@Observes final RefreshRuntimeEvent event); void refresh(); void onRemoveProvider(); void removeProvider(); void deploy(); IsElement getView(); }
|
ProviderPresenter { public void onRefreshRuntime(@Observes final RefreshRuntimeEvent event) { if (event.getProviderKey() != null && event.getProviderKey().equals(provider.getKey())) { load(event.getProviderKey()); } } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); @PostConstruct void init(); void onProviderSelected(@Observes final ProviderSelectedEvent event); void onRefreshRuntime(@Observes final RefreshRuntimeEvent event); void refresh(); void onRemoveProvider(); void removeProvider(); void deploy(); IsElement getView(); }
|
@Test public void checkSetTitleWithoutHasName() { final HasName mockHasName = new MockHasName("name"); hasName = Optional.empty(); header.setTitle("new-name"); assertEquals("name", mockHasName.getName().getValue()); }
|
@Override public void setTitle(final String title) { titleSetter.accept(title); }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public void setTitle(final String title) { titleSetter.accept(title); } }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public void setTitle(final String title) { titleSetter.accept(title); } EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory); EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory,
final String columnGroup); }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public void setTitle(final String title) { titleSetter.accept(title); } EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory); EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory,
final String columnGroup); @Override String getTitle(); @Override void setTitle(final String title); @Override String getColumnGroup(); @Override void setColumnGroup(final String columnGroup); @Override void destroyResources(); @Override void edit(final GridBodyCellEditContext context); @Override GridCellEditAction getSupportedEditAction(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public void setTitle(final String title) { titleSetter.accept(title); } EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory); EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory,
final String columnGroup); @Override String getTitle(); @Override void setTitle(final String title); @Override String getColumnGroup(); @Override void setColumnGroup(final String columnGroup); @Override void destroyResources(); @Override void edit(final GridBodyCellEditContext context); @Override GridCellEditAction getSupportedEditAction(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
@Test public void testOnRefreshRuntimesWithNoItems() { prepareRefreshWithNoItems(); presenter.onRefreshRuntime(new RefreshRuntimeEvent(providerKey)); verifyUILoadedWithNoItems(2); verifyRuntimesInfoLoaded(2); }
|
public void onRefreshRuntime(@Observes final RefreshRuntimeEvent event) { if (event.getProviderKey() != null && event.getProviderKey().equals(provider.getKey())) { load(event.getProviderKey()); } }
|
ProviderPresenter { public void onRefreshRuntime(@Observes final RefreshRuntimeEvent event) { if (event.getProviderKey() != null && event.getProviderKey().equals(provider.getKey())) { load(event.getProviderKey()); } } }
|
ProviderPresenter { public void onRefreshRuntime(@Observes final RefreshRuntimeEvent event) { if (event.getProviderKey() != null && event.getProviderKey().equals(provider.getKey())) { load(event.getProviderKey()); } } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); }
|
ProviderPresenter { public void onRefreshRuntime(@Observes final RefreshRuntimeEvent event) { if (event.getProviderKey() != null && event.getProviderKey().equals(provider.getKey())) { load(event.getProviderKey()); } } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); @PostConstruct void init(); void onProviderSelected(@Observes final ProviderSelectedEvent event); void onRefreshRuntime(@Observes final RefreshRuntimeEvent event); void refresh(); void onRemoveProvider(); void removeProvider(); void deploy(); IsElement getView(); }
|
ProviderPresenter { public void onRefreshRuntime(@Observes final RefreshRuntimeEvent event) { if (event.getProviderKey() != null && event.getProviderKey().equals(provider.getKey())) { load(event.getProviderKey()); } } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); @PostConstruct void init(); void onProviderSelected(@Observes final ProviderSelectedEvent event); void onRefreshRuntime(@Observes final RefreshRuntimeEvent event); void refresh(); void onRemoveProvider(); void removeProvider(); void deploy(); IsElement getView(); }
|
@Test public void testRefreshWithItems() { prepareRefreshWithItems(); presenter.refresh(); verify(providerStatusPresenter, times(2)).setupItems(runtimeItems); verify(view, times(2)).setStatus(providerStatusPresenterView); verifyRuntimesInfoLoaded(2); }
|
public void refresh() { load(provider.getKey()); }
|
ProviderPresenter { public void refresh() { load(provider.getKey()); } }
|
ProviderPresenter { public void refresh() { load(provider.getKey()); } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); }
|
ProviderPresenter { public void refresh() { load(provider.getKey()); } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); @PostConstruct void init(); void onProviderSelected(@Observes final ProviderSelectedEvent event); void onRefreshRuntime(@Observes final RefreshRuntimeEvent event); void refresh(); void onRemoveProvider(); void removeProvider(); void deploy(); IsElement getView(); }
|
ProviderPresenter { public void refresh() { load(provider.getKey()); } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); @PostConstruct void init(); void onProviderSelected(@Observes final ProviderSelectedEvent event); void onRefreshRuntime(@Observes final RefreshRuntimeEvent event); void refresh(); void onRemoveProvider(); void removeProvider(); void deploy(); IsElement getView(); }
|
@Test public void testRefreshWithNoItems() { prepareRefreshWithNoItems(); presenter.refresh(); verifyUILoadedWithNoItems(2); verifyRuntimesInfoLoaded(2); }
|
public void refresh() { load(provider.getKey()); }
|
ProviderPresenter { public void refresh() { load(provider.getKey()); } }
|
ProviderPresenter { public void refresh() { load(provider.getKey()); } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); }
|
ProviderPresenter { public void refresh() { load(provider.getKey()); } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); @PostConstruct void init(); void onProviderSelected(@Observes final ProviderSelectedEvent event); void onRefreshRuntime(@Observes final RefreshRuntimeEvent event); void refresh(); void onRemoveProvider(); void removeProvider(); void deploy(); IsElement getView(); }
|
ProviderPresenter { public void refresh() { load(provider.getKey()); } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); @PostConstruct void init(); void onProviderSelected(@Observes final ProviderSelectedEvent event); void onRefreshRuntime(@Observes final RefreshRuntimeEvent event); void refresh(); void onRemoveProvider(); void removeProvider(); void deploy(); IsElement getView(); }
|
@Test public void testDeploy() { prepareRuntimesInfo(); presenter.onProviderSelected(new ProviderSelectedEvent(providerKey)); presenter.deploy(); verify(addNewRuntimeEvent, times(1)).fire(new AddNewRuntimeEvent(provider)); }
|
public void deploy() { addNewRuntimeEvent.fire(new AddNewRuntimeEvent(provider)); }
|
ProviderPresenter { public void deploy() { addNewRuntimeEvent.fire(new AddNewRuntimeEvent(provider)); } }
|
ProviderPresenter { public void deploy() { addNewRuntimeEvent.fire(new AddNewRuntimeEvent(provider)); } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); }
|
ProviderPresenter { public void deploy() { addNewRuntimeEvent.fire(new AddNewRuntimeEvent(provider)); } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); @PostConstruct void init(); void onProviderSelected(@Observes final ProviderSelectedEvent event); void onRefreshRuntime(@Observes final RefreshRuntimeEvent event); void refresh(); void onRemoveProvider(); void removeProvider(); void deploy(); IsElement getView(); }
|
ProviderPresenter { public void deploy() { addNewRuntimeEvent.fire(new AddNewRuntimeEvent(provider)); } @Inject ProviderPresenter(final View view,
final Caller<ProviderService> providerService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final ProviderStatusEmptyPresenter providerStatusEmptyPresenter,
final ProviderStatusPresenter providerStatusPresenter,
final ProviderConfigEmptyPresenter providerConfigEmptyPresenter,
final ClientProviderHandlerRegistry providerHandlerRegistry,
final Event<NotificationEvent> notification,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent,
final Event<AddNewRuntimeEvent> addNewRuntimeEvent); @PostConstruct void init(); void onProviderSelected(@Observes final ProviderSelectedEvent event); void onRefreshRuntime(@Observes final RefreshRuntimeEvent event); void refresh(); void onRemoveProvider(); void removeProvider(); void deploy(); IsElement getView(); }
|
@Test public void onAddProviderTypeTest() { presenter.onAddProviderType(); verify(addNewProviderTypeEvent, times(1)).fire(any(AddNewProviderTypeEvent.class)); }
|
public void onAddProviderType() { addNewProviderTypeEvent.fire(new AddNewProviderTypeEvent()); }
|
ProviderTypeEmptyPresenter { public void onAddProviderType() { addNewProviderTypeEvent.fire(new AddNewProviderTypeEvent()); } }
|
ProviderTypeEmptyPresenter { public void onAddProviderType() { addNewProviderTypeEvent.fire(new AddNewProviderTypeEvent()); } @Inject ProviderTypeEmptyPresenter(final View view,
final Event<AddNewProviderTypeEvent> addNewProviderTypeEvent); }
|
ProviderTypeEmptyPresenter { public void onAddProviderType() { addNewProviderTypeEvent.fire(new AddNewProviderTypeEvent()); } @Inject ProviderTypeEmptyPresenter(final View view,
final Event<AddNewProviderTypeEvent> addNewProviderTypeEvent); @PostConstruct void init(); View getView(); void onAddProviderType(); }
|
ProviderTypeEmptyPresenter { public void onAddProviderType() { addNewProviderTypeEvent.fire(new AddNewProviderTypeEvent()); } @Inject ProviderTypeEmptyPresenter(final View view,
final Event<AddNewProviderTypeEvent> addNewProviderTypeEvent); @PostConstruct void init(); View getView(); void onAddProviderType(); }
|
@Test public void testGetTitle() { when(view.getTitle()).thenReturn(TITLE); assertEquals(TITLE, presenter.getTitle()); verify(view, times(1)).getTitle(); }
|
@WorkbenchPartTitle public String getTitle() { return view.getTitle(); }
|
ProvisioningManagementBrowserPresenter { @WorkbenchPartTitle public String getTitle() { return view.getTitle(); } }
|
ProvisioningManagementBrowserPresenter { @WorkbenchPartTitle public String getTitle() { return view.getTitle(); } @Inject ProvisioningManagementBrowserPresenter(final ProvisioningManagementBrowserPresenter.View view,
final ProviderTypeNavigationPresenter providerTypeNavigationPresenter,
final ProviderTypePresenter providerTypePresenter,
final ProviderTypeEmptyPresenter providerTypeEmptyPresenter,
final ProviderEmptyPresenter providerEmptyPresenter,
final ProviderPresenter providerPresenter,
final Caller<ProviderTypeService> providerTypeService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); }
|
ProvisioningManagementBrowserPresenter { @WorkbenchPartTitle public String getTitle() { return view.getTitle(); } @Inject ProvisioningManagementBrowserPresenter(final ProvisioningManagementBrowserPresenter.View view,
final ProviderTypeNavigationPresenter providerTypeNavigationPresenter,
final ProviderTypePresenter providerTypePresenter,
final ProviderTypeEmptyPresenter providerTypeEmptyPresenter,
final ProviderEmptyPresenter providerEmptyPresenter,
final ProviderPresenter providerPresenter,
final Caller<ProviderTypeService> providerTypeService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); @PostConstruct void init(); @OnOpen void onOpen(); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView IsElement getView(); }
|
ProvisioningManagementBrowserPresenter { @WorkbenchPartTitle public String getTitle() { return view.getTitle(); } @Inject ProvisioningManagementBrowserPresenter(final ProvisioningManagementBrowserPresenter.View view,
final ProviderTypeNavigationPresenter providerTypeNavigationPresenter,
final ProviderTypePresenter providerTypePresenter,
final ProviderTypeEmptyPresenter providerTypeEmptyPresenter,
final ProviderEmptyPresenter providerEmptyPresenter,
final ProviderPresenter providerPresenter,
final Caller<ProviderTypeService> providerTypeService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); @PostConstruct void init(); @OnOpen void onOpen(); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView IsElement getView(); static final String IDENTIFIER; }
|
@Test public void testGetView() { assertEquals(view, presenter.getView()); }
|
@WorkbenchPartView public IsElement getView() { return view; }
|
ProvisioningManagementBrowserPresenter { @WorkbenchPartView public IsElement getView() { return view; } }
|
ProvisioningManagementBrowserPresenter { @WorkbenchPartView public IsElement getView() { return view; } @Inject ProvisioningManagementBrowserPresenter(final ProvisioningManagementBrowserPresenter.View view,
final ProviderTypeNavigationPresenter providerTypeNavigationPresenter,
final ProviderTypePresenter providerTypePresenter,
final ProviderTypeEmptyPresenter providerTypeEmptyPresenter,
final ProviderEmptyPresenter providerEmptyPresenter,
final ProviderPresenter providerPresenter,
final Caller<ProviderTypeService> providerTypeService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); }
|
ProvisioningManagementBrowserPresenter { @WorkbenchPartView public IsElement getView() { return view; } @Inject ProvisioningManagementBrowserPresenter(final ProvisioningManagementBrowserPresenter.View view,
final ProviderTypeNavigationPresenter providerTypeNavigationPresenter,
final ProviderTypePresenter providerTypePresenter,
final ProviderTypeEmptyPresenter providerTypeEmptyPresenter,
final ProviderEmptyPresenter providerEmptyPresenter,
final ProviderPresenter providerPresenter,
final Caller<ProviderTypeService> providerTypeService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); @PostConstruct void init(); @OnOpen void onOpen(); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView IsElement getView(); }
|
ProvisioningManagementBrowserPresenter { @WorkbenchPartView public IsElement getView() { return view; } @Inject ProvisioningManagementBrowserPresenter(final ProvisioningManagementBrowserPresenter.View view,
final ProviderTypeNavigationPresenter providerTypeNavigationPresenter,
final ProviderTypePresenter providerTypePresenter,
final ProviderTypeEmptyPresenter providerTypeEmptyPresenter,
final ProviderEmptyPresenter providerEmptyPresenter,
final ProviderPresenter providerPresenter,
final Caller<ProviderTypeService> providerTypeService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); @PostConstruct void init(); @OnOpen void onOpen(); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView IsElement getView(); static final String IDENTIFIER; }
|
@Test public void testOnRefreshProviderTypesWithEnabledProviderTypes() { when(providerTypeService.getEnabledProviderTypes()).thenReturn(providerTypes); ProviderType selectedProviderType = providerTypes.iterator().next(); presenter.onRefreshProviderTypes(new ProviderTypeListRefreshEvent(selectedProviderType.getKey())); verify(providerTypeNavigationPresenter, times(1)).setup(selectedProviderType, providerTypes); verify(providerTypeSelectedEvent, times(1)).fire(new ProviderTypeSelectedEvent(selectedProviderType.getKey())); }
|
protected void onRefreshProviderTypes(@Observes final ProviderTypeListRefreshEvent event) { refreshProviderTypes(event.getProviderTypeKey()); }
|
ProvisioningManagementBrowserPresenter { protected void onRefreshProviderTypes(@Observes final ProviderTypeListRefreshEvent event) { refreshProviderTypes(event.getProviderTypeKey()); } }
|
ProvisioningManagementBrowserPresenter { protected void onRefreshProviderTypes(@Observes final ProviderTypeListRefreshEvent event) { refreshProviderTypes(event.getProviderTypeKey()); } @Inject ProvisioningManagementBrowserPresenter(final ProvisioningManagementBrowserPresenter.View view,
final ProviderTypeNavigationPresenter providerTypeNavigationPresenter,
final ProviderTypePresenter providerTypePresenter,
final ProviderTypeEmptyPresenter providerTypeEmptyPresenter,
final ProviderEmptyPresenter providerEmptyPresenter,
final ProviderPresenter providerPresenter,
final Caller<ProviderTypeService> providerTypeService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); }
|
ProvisioningManagementBrowserPresenter { protected void onRefreshProviderTypes(@Observes final ProviderTypeListRefreshEvent event) { refreshProviderTypes(event.getProviderTypeKey()); } @Inject ProvisioningManagementBrowserPresenter(final ProvisioningManagementBrowserPresenter.View view,
final ProviderTypeNavigationPresenter providerTypeNavigationPresenter,
final ProviderTypePresenter providerTypePresenter,
final ProviderTypeEmptyPresenter providerTypeEmptyPresenter,
final ProviderEmptyPresenter providerEmptyPresenter,
final ProviderPresenter providerPresenter,
final Caller<ProviderTypeService> providerTypeService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); @PostConstruct void init(); @OnOpen void onOpen(); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView IsElement getView(); }
|
ProvisioningManagementBrowserPresenter { protected void onRefreshProviderTypes(@Observes final ProviderTypeListRefreshEvent event) { refreshProviderTypes(event.getProviderTypeKey()); } @Inject ProvisioningManagementBrowserPresenter(final ProvisioningManagementBrowserPresenter.View view,
final ProviderTypeNavigationPresenter providerTypeNavigationPresenter,
final ProviderTypePresenter providerTypePresenter,
final ProviderTypeEmptyPresenter providerTypeEmptyPresenter,
final ProviderEmptyPresenter providerEmptyPresenter,
final ProviderPresenter providerPresenter,
final Caller<ProviderTypeService> providerTypeService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); @PostConstruct void init(); @OnOpen void onOpen(); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView IsElement getView(); static final String IDENTIFIER; }
|
@Test public void testOnRefreshProviderTypesWithNOEnabledProviderTypes() { providerTypes.clear(); when(providerTypeService.getEnabledProviderTypes()).thenReturn(providerTypes); presenter.onRefreshProviderTypes(new ProviderTypeListRefreshEvent()); verify(view, times(1)).setEmptyView(providerTypeEmptyPresenterView); verify(providerTypeNavigationPresenter, times(1)).clear(); verify(providerTypeNavigationPresenter, times(0)).setup(any(ProviderType.class), anyCollectionOf(ProviderType.class)); }
|
protected void onRefreshProviderTypes(@Observes final ProviderTypeListRefreshEvent event) { refreshProviderTypes(event.getProviderTypeKey()); }
|
ProvisioningManagementBrowserPresenter { protected void onRefreshProviderTypes(@Observes final ProviderTypeListRefreshEvent event) { refreshProviderTypes(event.getProviderTypeKey()); } }
|
ProvisioningManagementBrowserPresenter { protected void onRefreshProviderTypes(@Observes final ProviderTypeListRefreshEvent event) { refreshProviderTypes(event.getProviderTypeKey()); } @Inject ProvisioningManagementBrowserPresenter(final ProvisioningManagementBrowserPresenter.View view,
final ProviderTypeNavigationPresenter providerTypeNavigationPresenter,
final ProviderTypePresenter providerTypePresenter,
final ProviderTypeEmptyPresenter providerTypeEmptyPresenter,
final ProviderEmptyPresenter providerEmptyPresenter,
final ProviderPresenter providerPresenter,
final Caller<ProviderTypeService> providerTypeService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); }
|
ProvisioningManagementBrowserPresenter { protected void onRefreshProviderTypes(@Observes final ProviderTypeListRefreshEvent event) { refreshProviderTypes(event.getProviderTypeKey()); } @Inject ProvisioningManagementBrowserPresenter(final ProvisioningManagementBrowserPresenter.View view,
final ProviderTypeNavigationPresenter providerTypeNavigationPresenter,
final ProviderTypePresenter providerTypePresenter,
final ProviderTypeEmptyPresenter providerTypeEmptyPresenter,
final ProviderEmptyPresenter providerEmptyPresenter,
final ProviderPresenter providerPresenter,
final Caller<ProviderTypeService> providerTypeService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); @PostConstruct void init(); @OnOpen void onOpen(); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView IsElement getView(); }
|
ProvisioningManagementBrowserPresenter { protected void onRefreshProviderTypes(@Observes final ProviderTypeListRefreshEvent event) { refreshProviderTypes(event.getProviderTypeKey()); } @Inject ProvisioningManagementBrowserPresenter(final ProvisioningManagementBrowserPresenter.View view,
final ProviderTypeNavigationPresenter providerTypeNavigationPresenter,
final ProviderTypePresenter providerTypePresenter,
final ProviderTypeEmptyPresenter providerTypeEmptyPresenter,
final ProviderEmptyPresenter providerEmptyPresenter,
final ProviderPresenter providerPresenter,
final Caller<ProviderTypeService> providerTypeService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); @PostConstruct void init(); @OnOpen void onOpen(); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView IsElement getView(); static final String IDENTIFIER; }
|
@Test public void testOnProviderTypeSelectedWithProviders() { ProviderType selectedProviderType = providerTypes.iterator().next(); ProviderTypeKey selectedProviderTypeKey = selectedProviderType.getKey(); List<ProviderKey> providerKeys = mockProviderKeyList(selectedProviderType.getKey(), PROVIDER_TYPES_SIZE); ProviderKey selectedProviderKey = providerKeys.iterator().next(); ProvidersInfo providersInfo = mock(ProvidersInfo.class); when(providersInfo.getProviderType()).thenReturn(selectedProviderType); when(providersInfo.getProvidersKey()).thenReturn(providerKeys); when(providerTypeService.getProviderType(selectedProviderTypeKey)).thenReturn(selectedProviderType); when(provisioningScreensService.getProvidersInfo(selectedProviderTypeKey)).thenReturn(providersInfo); presenter.onProviderTypeSelected(new ProviderTypeSelectedEvent(selectedProviderType.getKey(), selectedProviderKey.getId())); verify(providerTypePresenter, times(1)).setup(selectedProviderType, providerKeys, selectedProviderKey); }
|
protected void onProviderTypeSelected(@Observes final ProviderTypeSelectedEvent event) { if (event.getProviderTypeKey() != null) { selectProviderType(event.getProviderTypeKey(), event.getProviderId()); } }
|
ProvisioningManagementBrowserPresenter { protected void onProviderTypeSelected(@Observes final ProviderTypeSelectedEvent event) { if (event.getProviderTypeKey() != null) { selectProviderType(event.getProviderTypeKey(), event.getProviderId()); } } }
|
ProvisioningManagementBrowserPresenter { protected void onProviderTypeSelected(@Observes final ProviderTypeSelectedEvent event) { if (event.getProviderTypeKey() != null) { selectProviderType(event.getProviderTypeKey(), event.getProviderId()); } } @Inject ProvisioningManagementBrowserPresenter(final ProvisioningManagementBrowserPresenter.View view,
final ProviderTypeNavigationPresenter providerTypeNavigationPresenter,
final ProviderTypePresenter providerTypePresenter,
final ProviderTypeEmptyPresenter providerTypeEmptyPresenter,
final ProviderEmptyPresenter providerEmptyPresenter,
final ProviderPresenter providerPresenter,
final Caller<ProviderTypeService> providerTypeService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); }
|
ProvisioningManagementBrowserPresenter { protected void onProviderTypeSelected(@Observes final ProviderTypeSelectedEvent event) { if (event.getProviderTypeKey() != null) { selectProviderType(event.getProviderTypeKey(), event.getProviderId()); } } @Inject ProvisioningManagementBrowserPresenter(final ProvisioningManagementBrowserPresenter.View view,
final ProviderTypeNavigationPresenter providerTypeNavigationPresenter,
final ProviderTypePresenter providerTypePresenter,
final ProviderTypeEmptyPresenter providerTypeEmptyPresenter,
final ProviderEmptyPresenter providerEmptyPresenter,
final ProviderPresenter providerPresenter,
final Caller<ProviderTypeService> providerTypeService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); @PostConstruct void init(); @OnOpen void onOpen(); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView IsElement getView(); }
|
ProvisioningManagementBrowserPresenter { protected void onProviderTypeSelected(@Observes final ProviderTypeSelectedEvent event) { if (event.getProviderTypeKey() != null) { selectProviderType(event.getProviderTypeKey(), event.getProviderId()); } } @Inject ProvisioningManagementBrowserPresenter(final ProvisioningManagementBrowserPresenter.View view,
final ProviderTypeNavigationPresenter providerTypeNavigationPresenter,
final ProviderTypePresenter providerTypePresenter,
final ProviderTypeEmptyPresenter providerTypeEmptyPresenter,
final ProviderEmptyPresenter providerEmptyPresenter,
final ProviderPresenter providerPresenter,
final Caller<ProviderTypeService> providerTypeService,
final Caller<ProvisioningScreensService> provisioningScreensService,
final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); @PostConstruct void init(); @OnOpen void onOpen(); @WorkbenchPartTitle String getTitle(); @WorkbenchPartView IsElement getView(); static final String IDENTIFIER; }
|
@Test public void checkFactoryResourcesAreDestroyed() { header.destroyResources(); verify(factory).destroyResources(); }
|
@Override public void destroyResources() { factory.destroyResources(); }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public void destroyResources() { factory.destroyResources(); } }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public void destroyResources() { factory.destroyResources(); } EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory); EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory,
final String columnGroup); }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public void destroyResources() { factory.destroyResources(); } EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory); EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory,
final String columnGroup); @Override String getTitle(); @Override void setTitle(final String title); @Override String getColumnGroup(); @Override void setColumnGroup(final String columnGroup); @Override void destroyResources(); @Override void edit(final GridBodyCellEditContext context); @Override GridCellEditAction getSupportedEditAction(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
EditableTextHeaderMetaData implements EditableHeaderMetaData { @Override public void destroyResources() { factory.destroyResources(); } EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory); EditableTextHeaderMetaData(final Supplier<String> titleGetter,
final Consumer<String> titleSetter,
final SingletonDOMElementFactory<W, E> factory,
final String columnGroup); @Override String getTitle(); @Override void setTitle(final String title); @Override String getColumnGroup(); @Override void setColumnGroup(final String columnGroup); @Override void destroyResources(); @Override void edit(final GridBodyCellEditContext context); @Override GridCellEditAction getSupportedEditAction(); @Override boolean equals(final Object o); @Override int hashCode(); }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.