use of org.eclipse.n4js.cli.helper.ProcessResult in project n4js by eclipse.
the class IncompleteApiImplementationTest method testInternal_impl_Subclass_UsingDirectImplementation.
/**
*/
@Test
public void testInternal_impl_Subclass_UsingDirectImplementation() {
String expectedString = "Loaded Implementation one.x.impl::p.IF.n4js" + "\n" + "Loaded Implementation one.x.impl::p.IFuser.n4js" + "\n" + "OK: holds not undefined";
String fileToRunName = fileToExecute_routing("Exec_AT_IDE-1510_Internal_impl_Subclass_UsingDirectImplementation.js");
ProcessResult nodejsResult = nodejsRun(workspace.toPath(), Path.of(fileToRunName));
assertEquals(nodejsResult.toString(), expectedString, nodejsResult.getStdOut());
}
use of org.eclipse.n4js.cli.helper.ProcessResult in project n4js by eclipse.
the class IncompleteApiImplementationTest method testEnums_Literal_in_existing_Enum.
// ++ ++ ++++++++ + + ++++ +++ + ++ +
// Enums
// ++ ++ ++++++++ + + ++++ +++ + ++ +
/**
*/
@Test
public void testEnums_Literal_in_existing_Enum() {
String expectedString = "Loaded Implementation one.x.impl::p.A.n4js" + "\n" + "OK: holds not undefined" + "\n" + "OK: holds not undefined" + "\n" + "OK: holds not undefined";
String fileToRunName = fileToExecute_direct("Exec_AT_IDE_1510_Enums_Literal_in_existing_Enum.js");
ProcessResult nodejsResult = nodejsRun(workspace.toPath(), Path.of(fileToRunName));
assertEquals(nodejsResult.toString(), expectedString, nodejsResult.getStdOut());
}
use of org.eclipse.n4js.cli.helper.ProcessResult in project n4js by eclipse.
the class NodeVersionTest method testNodeVersion.
/**
*/
@Test
public void testNodeVersion() {
Path cwd = new File("").toPath().toAbsolutePath();
ProcessResult result = new CliTools().nodejsRun(cwd, Path.of("-v"));
Assert.assertEquals("bad exit code", 0, result.getExitCode());
String versionStr = result.getStdOut().trim();
if (!N4JSGlobals.isCompatibleNodeVersion(versionStr)) {
Assert.fail("tests are running with node version " + versionStr + " but this version is not compatible to version v" + N4JSGlobals.NODE_VERSION + " defined in " + N4JSGlobals.class.getSimpleName());
}
}
use of org.eclipse.n4js.cli.helper.ProcessResult in project n4js by eclipse.
the class AT_IDEBUG_654_MissingPolyfillImportsTest method compileCheckPolyfillImports_ExpectExist.
/**
*/
@Test
public void compileCheckPolyfillImports_ExpectExist() {
Path projectDir = workspace.toPath().resolve(WS_IDEBUG_654_2);
Path fileToRun = projectDir.resolve("src-gen/Main.js");
N4jscOptions options = COMPILE(workspace);
CliCompileResult cliResult = n4jsc(options, VALIDATION_ERRORS);
assertEquals(cliResult.toString(), 5, cliResult.getTranspiledFilesCount());
ProcessResult nodejsResult = nodejsRun(projectDir, fileToRun);
assertEquals(nodejsResult.toString(), "functionFromModuleA\n" + "variableFromModuleB\n" + "variableFromModuleC\n" + "variableFromModuleC", nodejsResult.getStdOut());
}
use of org.eclipse.n4js.cli.helper.ProcessResult in project n4js by eclipse.
the class N4jscBasicTest method testCompileP1_And_Run_A_WithNodeRunner.
/**
* Basic compile and run test.
*/
@Test
public void testCompileP1_And_Run_A_WithNodeRunner() throws Exception {
CliCompileResult cliResult = n4jsc(COMPILE(workspace), SUCCESS);
assertEquals(cliResult.toString(), 20, cliResult.getTranspiledFilesCount());
Path fileA = proot.toPath().resolve("P1/src-gen/A.js");
ProcessResult nodejsResult = nodejsRun(workspace.toPath(), fileA);
assertEquals(nodejsResult.toString(), "A", nodejsResult.getStdOut());
}
Aggregations