use of com.ibm.streamsx.rest.build.Toolkit in project streamsx.topology by IBMStreams.
the class ToolkitAPITest method testPostToolkit.
@Test
public void testPostToolkit() throws Exception {
Toolkit bingo = connection.uploadToolkit(bingo0Path);
assertNotNull(bingo);
assertEquals(bingo.getName(), bingoToolkitName);
assertEquals(bingo.getVersion(), bingo0Version);
assertEquals(bingo.getRequiredProductVersion(), "4.2");
assertEquals(bingo.getResourceType(), "toolkit");
// We don't know what the values the following attributes will have,
// but we verify that the expected attributes do at least have values
assertNotNull(bingo.getPath());
// Verify that the new toolkit is in the list of all toolkits
List<Toolkit> toolkits = connection.getToolkits();
waitForToolkit(bingoToolkitName);
assertTrue(bingo.delete());
}
use of com.ibm.streamsx.rest.build.Toolkit in project streamsx.topology by IBMStreams.
the class ToolkitAPITest method deleteToolkits.
@After
public void deleteToolkits() throws Exception {
Set<String> deleteNames = new HashSet();
deleteNames.add(gamesToolkitName);
deleteNames.add(cardsToolkitName);
deleteNames.add(bingoToolkitName);
List<Toolkit> deleteToolkits;
do {
List<Toolkit> toolkits = connection.getToolkits();
deleteToolkits = toolkits.stream().filter(tk -> deleteNames.contains(tk.getName())).collect(Collectors.toList());
for (Toolkit toolkit : deleteToolkits) {
toolkit.delete();
}
Thread.sleep(5000);
} while (!deleteToolkits.isEmpty());
}
Aggregations