Search in sources :

Example 46 with ProcessResult

use of org.eclipse.n4js.cli.helper.ProcessResult in project n4js by eclipse.

the class IncompleteApiImplementationTest method testConsumed_Members_of_Missing_Inteface_single_case.

/**
 * Testing the most simple case where client-code extends an API-interface with an default-initialized field (IA.f)
 * which is actually missing from the concrete implementation. Unfortunately fields behave very different form
 * getter/setter/methods, hence, in client code the generated get/set stub cannot be known and a raw-property access
 * on the JS-Object will be obtained. This results in access to 'undefined'
 */
@Ignore("Client side access to missing mixed-in-fields cannot be detected.")
@Test
public void testConsumed_Members_of_Missing_Inteface_single_case() {
    String expectedString = "Loaded Implementation one.x.impl::p.IF.n4js";
    String fileToRunName = fileToExecute_if("Exec_AT_IDE-1510_Consumed_Members_of_Missing_Inteface_single_case.js");
    ProcessResult nodejsResult = nodejsRun(workspace.toPath(), Path.of(fileToRunName));
    assertEquals(nodejsResult.toString(), expectedString, nodejsResult.getStdOut());
}
Also used : ProcessResult(org.eclipse.n4js.cli.helper.ProcessResult) Ignore(org.junit.Ignore) Test(org.junit.Test) AbstractCliCompileTest(org.eclipse.n4js.cli.helper.AbstractCliCompileTest)

Example 47 with ProcessResult

use of org.eclipse.n4js.cli.helper.ProcessResult in project n4js by eclipse.

the class IncompleteApiImplementationTest method testInterfaces_static_method.

/**
 */
@Test
public void testInterfaces_static_method() {
    String expectedString = "Loaded Implementation one.x.impl::p.A.n4js" + "\n" + "OK: holds not undefined";
    String fileToRunName = fileToExecute_direct("Exec_AT_IDE-1510_Interfaces_static_method.js");
    ProcessResult nodejsResult = nodejsRun(workspace.toPath(), Path.of(fileToRunName));
    assertEquals(nodejsResult.toString(), expectedString, nodejsResult.getStdOut());
}
Also used : ProcessResult(org.eclipse.n4js.cli.helper.ProcessResult) Test(org.junit.Test) AbstractCliCompileTest(org.eclipse.n4js.cli.helper.AbstractCliCompileTest)

Example 48 with ProcessResult

use of org.eclipse.n4js.cli.helper.ProcessResult in project n4js by eclipse.

the class IncompleteApiImplementationTest method testFunction_test_function.

// ++ ++ ++++++++ + + ++++ +++ + ++ +
// global function
// ++ ++ ++++++++ + + ++++ +++ + ++ +
/**
 */
@Test
public void testFunction_test_function() {
    String expectedString = "Loaded Implementation one.x.impl::p.VarFun.n4js";
    String fileToRunName = fileToExecute_var_and_fun("Exec_AT_IDE-1510_Variable_And_Function_test_function.js");
    ProcessResult nodejsResult = nodejsRun(workspace.toPath(), Path.of(fileToRunName));
    assertEquals(nodejsResult.toString(), expectedString, nodejsResult.getStdOut());
}
Also used : ProcessResult(org.eclipse.n4js.cli.helper.ProcessResult) Test(org.junit.Test) AbstractCliCompileTest(org.eclipse.n4js.cli.helper.AbstractCliCompileTest)

Example 49 with ProcessResult

use of org.eclipse.n4js.cli.helper.ProcessResult in project n4js by eclipse.

the class IncompleteApiImplementationTest method testfield_vs_getset_7.

/**
 */
@Test
public void testfield_vs_getset_7() {
    String expectedString = "Loaded Implementation one.x.impl::fields.F.n4js";
    String fileToRunName = fileToExecute_fields("Exec_AT_IDEBUG-505_field_vs_getset_7.js");
    ProcessResult nodejsResult = nodejsRun(workspace.toPath(), Path.of(fileToRunName));
    assertEquals(nodejsResult.toString(), expectedString, nodejsResult.getStdOut());
}
Also used : ProcessResult(org.eclipse.n4js.cli.helper.ProcessResult) Test(org.junit.Test) AbstractCliCompileTest(org.eclipse.n4js.cli.helper.AbstractCliCompileTest)

Example 50 with ProcessResult

use of org.eclipse.n4js.cli.helper.ProcessResult in project n4js by eclipse.

the class IncompleteApiImplementationTest method testfield_vs_getset_3.

/**
 */
@Test
public void testfield_vs_getset_3() {
    String expectedString = "Loaded Implementation one.x.impl::fields.F.n4js";
    String fileToRunName = fileToExecute_fields("Exec_AT_IDEBUG-505_field_vs_getset_4.js");
    ProcessResult nodejsResult = nodejsRun(workspace.toPath(), Path.of(fileToRunName));
    assertEquals(nodejsResult.toString(), expectedString, nodejsResult.getStdOut());
}
Also used : ProcessResult(org.eclipse.n4js.cli.helper.ProcessResult) Test(org.junit.Test) AbstractCliCompileTest(org.eclipse.n4js.cli.helper.AbstractCliCompileTest)

Aggregations

ProcessResult (org.eclipse.n4js.cli.helper.ProcessResult)64 Test (org.junit.Test)59 AbstractCliCompileTest (org.eclipse.n4js.cli.helper.AbstractCliCompileTest)55 Path (java.nio.file.Path)13 CliCompileResult (org.eclipse.n4js.cli.helper.CliCompileResult)12 Ignore (org.junit.Ignore)9 CliTools (org.eclipse.n4js.cli.helper.CliTools)5 N4jscOptions (org.eclipse.n4js.cli.N4jscOptions)4 N4jscTestOptions (org.eclipse.n4js.cli.N4jscTestOptions)4 File (java.io.File)3 AbstractCliJarTest (org.eclipse.n4js.cli.helper.AbstractCliJarTest)2 ArrayList (java.util.ArrayList)1 CliException (org.eclipse.n4js.cli.helper.CliTools.CliException)1 Project (org.eclipse.n4js.tests.codegen.Project)1 FileURI (org.eclipse.n4js.workspace.locations.FileURI)1 Xpect (org.eclipse.xpect.runner.Xpect)1