use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class FunctionPointersWithOptionalArgsTest method testFunctionPointersWithNamedArgs.
@Test
public void testFunctionPointersWithNamedArgs() {
CompileResult result = BCompileUtil.compile("test-src/expressions/lambda/function-pointers-with-named-args-negative.bal");
BAssertUtil.validateError(result, 0, "invalid token 'c'", 6, 29);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class ForkJoinInFunctionTest method testForkJoinAllOfSpecific.
@Test(description = "Test Fork Join All of specific")
public void testForkJoinAllOfSpecific() {
CompileResult result = BCompileUtil.compile("test-src/workers/fork-join-all-specific.bal");
BValue[] args = {};
BValue[] returns = BRunUtil.invoke(result, "testForkJoinAllOfSpecific", args);
Assert.assertEquals(returns.length, 1);
Assert.assertTrue(returns[0] instanceof BStringArray);
Assert.assertEquals(((BStringArray) returns[0]).size(), 2);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class ForkJoinInFunctionTest method testForkJoinWithWorkersInSameFunction.
@Test(description = "Test Fork Join With Workers in same function")
public void testForkJoinWithWorkersInSameFunction() {
CompileResult result = BCompileUtil.compile("test-src/workers/fork-join-and-workers-under-same-funtion.bal");
Assert.assertEquals(result.getErrorCount(), 0);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class ForkJoinInFunctionTest method testForkJoinAll.
@Test(description = "Test Fork Join All")
public void testForkJoinAll() {
CompileResult result = BCompileUtil.compile("test-src/workers/fork-join-in-all.bal");
BValue[] args = {};
BValue[] returns = BRunUtil.invoke(result, "testForkJoinAll", args);
Assert.assertEquals(returns.length, 1);
Assert.assertTrue(returns[0] instanceof BIntArray);
Assert.assertEquals(((BIntArray) returns[0]).size(), 2);
Assert.assertEquals(((BIntArray) returns[0]).get(0), 234);
Assert.assertEquals(((BIntArray) returns[0]).get(1), 500);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class PackageInitWorkerTest method testPackageInitWorkerTest.
@Test
public void testPackageInitWorkerTest() {
CompileResult result = BCompileUtil.compile("test-src/workers/package-init-worker.bal");
BValue[] vals = BRunUtil.invoke(result, "test", new BValue[0]);
Assert.assertEquals(vals.length, 1);
Assert.assertEquals(((BInteger) vals[0]).intValue(), 1);
}
Aggregations