use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.
the class ProcessIT method testGetProcessErrorMessageFromRuntime.
@Test
public void testGetProcessErrorMessageFromRuntime() throws Exception {
byte[] archive = archive(ProcessIT.class.getResource("throwRuntime").toURI());
// start the process
ConcordProcess proc = concord.processes().start(new Payload().archive(archive));
// wait for completion
ProcessEntry pe = proc.expectStatus(StatusEnum.FAILED);
assertProcessErrorMessage(pe, "BOOOM");
}
use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.
the class ProcessIT method testKillCascade.
@Test
public void testKillCascade() throws Exception {
byte[] archive = archive(ProcessIT.class.getResource("killCascade").toURI());
ConcordProcess proc = concord.processes().start(new Payload().archive(archive));
proc.waitForChildStatus(StatusEnum.ENQUEUED, StatusEnum.PREPARING, StatusEnum.STARTING, StatusEnum.RUNNING);
proc.killCascade();
proc.waitForChildStatus(StatusEnum.CANCELLED, StatusEnum.FINISHED, StatusEnum.FAILED);
List<ProcessEntry> processEntryList = proc.subprocesses();
for (ProcessEntry pe : processEntryList) {
assertEquals(StatusEnum.CANCELLED, pe.getStatus());
}
}
use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.
the class ProcessIT method testMetadataWithWithItems.
@Test
public void testMetadataWithWithItems() throws Exception {
ConcordProcess proc = concord.processes().start(new Payload().archive(resource("processMetadataWithItems")));
ProcessEntry pe = proc.expectStatus(StatusEnum.FINISHED);
assertNotNull(pe.getMeta());
assertEquals("c", pe.getMeta().get("var"));
}
use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.
the class ProcessIT method testInvalidEntryPointError.
@Test
public void testInvalidEntryPointError() throws Exception {
byte[] archive = archive(ProcessIT.class.getResource("multipart").toURI());
// ---
Payload payload = new Payload().archive(archive).entryPoint("not-found");
ConcordProcess proc = concord.processes().start(payload);
// wait for completion
ProcessEntry pe = proc.expectStatus(StatusEnum.FAILED);
assertProcessErrorMessage(pe, "Process 'not-found' not found");
}
use of com.walmartlabs.concord.client.ProcessEntry in project concord by walmartlabs.
the class ProcessIT method testOnFailureVariables.
/**
* Verifies that variables changed in runtime are available in onFailure flows.
*/
@Test
public void testOnFailureVariables() throws Exception {
ConcordProcess proc = concord.processes().start(new Payload().archive(resource("onFailureVars")));
proc.expectStatus(StatusEnum.FAILED);
// wait for the onFailure process
ConcordProcess onFailureProc;
while (true) {
List<ProcessEntry> l = proc.subprocesses();
if (!l.isEmpty()) {
onFailureProc = concord.processes().get(l.get(0).getInstanceId());
break;
}
Thread.sleep(1000);
}
onFailureProc.expectStatus(StatusEnum.FINISHED);
onFailureProc.assertLog(".*I've got xyz.*");
onFailureProc.assertLog(".*Last error was:.*Boom!.*");
}
Aggregations