use of org.eclipse.che.api.machine.shared.dto.execagent.event.DtoWithPid in project che by eclipse.
the class TestServiceClientTest method sucessfulTestsAfterCompilation.
@Test
public void sucessfulTestsAfterCompilation() {
Promise<CommandImpl> compileCommandPromise = createCommandPromise(new CommandImpl("test-compile", "mvn test-compile -f ${current.project.path}", "mvn"));
when(devMachine.getDescriptor()).thenReturn(machine);
Promise<TestResult> resultPromise = testServiceClient.runTestsAfterCompilation(projectPath, testFramework, parameters, statusNotification, compileCommandPromise);
triggerProcessEvents(processStartResponse(true), processStarted(), processStdErr("A small warning"), processStdOut("BUILD SUCCESS"), processDied());
verify(testServiceClient).sendTests(projectPath, testFramework, parameters);
verify(statusNotification).setContent("Compiling the project before starting the test session.");
verify(execAgentCommandManager).startProcess("DevMachineId", new CommandImpl("test-compile", "mvn test-compile -f " + rootOfProjects + "/" + projectPath, "mvn"));
verify(statusNotification).setContent(TestServiceClient.EXECUTING_TESTS_MESSAGE);
resultPromise.then(testResult -> {
Assert.assertNotNull(testResult);
});
ArrayList<String> eventStrings = new ArrayList<>();
for (DtoWithPid event : consoleEvents) {
eventStrings.add(event.toString());
}
Assert.assertEquals(eventStrings, Arrays.asList("Started", "StdErr - A small warning", "StdOut - BUILD SUCCESS", "Died"));
}
Aggregations