use of org.eclipse.n4js.utils.process.ProcessResult in project n4js by eclipse.
the class RunExternalLibrariesPluginTest method runClientWithAllDeletedWorkspaceProjects.
/**
*/
@Test
public void runClientWithAllDeletedWorkspaceProjects() throws CoreException {
for (final String libProjectName : LIB_PROJECT_IDS) {
getProjectByName(libProjectName).delete(true, new NullProgressMonitor());
waitForAutoBuildCheckIndexRigid();
}
final ProcessResult result = runClient();
// @formatter:off
assertEquals("Unexpected output after running the client module: " + result, "External A<init>" + NL + "External B<init>" + NL + "External C<init>" + NL + "External D<init>" + NL, result.getStdOut());
// @formatter:on
}
use of org.eclipse.n4js.utils.process.ProcessResult in project n4js by eclipse.
the class RunExternalLibrariesPluginTest method runClient.
private ProcessResult runClient() {
final String pathToModuleToRun = getResourceName(CLIENT, CLIENT_MODULE);
final org.eclipse.emf.common.util.URI moduleToRun = createPlatformResourceURI(pathToModuleToRun, true);
final RunConfiguration config = runnerFrontEnd.createConfiguration(ID, null, moduleToRun);
final Process process = runnerFrontEndUI.runInUI(config);
final ProcessResult result = processExecutor.execute(process, "", OutputRedirection.REDIRECT);
if (result.isOK())
return result;
throw new RuntimeException("Client exited with error.\n" + result);
}
use of org.eclipse.n4js.utils.process.ProcessResult in project n4js by eclipse.
the class RunExternalLibrariesPluginTest method runClientWithAllOpenedWorkspaceProjects.
/**
*/
@Test
public void runClientWithAllOpenedWorkspaceProjects() throws CoreException {
waitForAutoBuildCheckIndexRigid();
final ProcessResult result = runClient();
// @formatter:off
assertEquals("Unexpected output after running the client module: " + result, "Workspace A<init>" + NL + "Workspace B<init>" + NL + "Workspace C<init>" + NL + "Workspace D<init>" + NL, result.getStdOut());
// @formatter:on
}
use of org.eclipse.n4js.utils.process.ProcessResult in project n4js by eclipse.
the class NodeVersionTest method testNodeJsVersion.
/**
* Simply checks if the node version found by default matches the required version. Prints out path if this fails.
*/
@Test
public void testNodeJsVersion() {
final ProcessResult result = commandFactory.checkBinaryVersionCommand(nodeJsBinary).execute();
final Version currentVersion = Version.createFromString(result.getStdOut().trim());
assertTrue("Version of node in " + nodeJsBinary.getBinaryAbsolutePath() + ": " + currentVersion + ", need at least " + NodeBinariesConstants.NODE_MIN_VERSION, currentVersion.compareTo(NodeBinariesConstants.NODE_MIN_VERSION) >= 0);
}
use of org.eclipse.n4js.utils.process.ProcessResult in project n4js by eclipse.
the class NodeVersionTest method testNPMVersion.
/**
* Simply checks if the npm version found by default matches the required version. Prints out path if this fails.
*/
@Test
public void testNPMVersion() {
final ProcessResult result = commandFactory.checkBinaryVersionCommand(npmBinary).execute();
final Version currentVersion = Version.createFromString(result.getStdOut().trim());
assertTrue("Version of node in " + npmBinary.getBinaryAbsolutePath() + ": " + currentVersion + ", need at least " + NodeBinariesConstants.NPM_MIN_VERSION, currentVersion.compareTo(NodeBinariesConstants.NPM_MIN_VERSION) >= 0);
}
Aggregations