use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class StructWithPrivateFieldsNegativeTest method testPrivateStructAccess2.
@Test(description = "Test private struct access in public functions")
public void testPrivateStructAccess2() {
CompileResult compileResult = BCompileUtil.compile(this, "test-src/structs", "private-field2");
Assert.assertEquals(compileResult.getErrorCount(), 4);
String expectedErrMsg = "attempt to refer to non-public symbol ";
BAssertUtil.validateError(compileResult, 0, expectedErrMsg + "'address'", 15, 13);
BAssertUtil.validateError(compileResult, 2, expectedErrMsg + "'FooFamily'", 5, 13);
BAssertUtil.validateError(compileResult, 3, expectedErrMsg + "'FooFamily'", 10, 13);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class StructWithPrivateFieldsNegativeTest method testPrivateFieldAccess.
@Test(description = "Test private field access")
public void testPrivateFieldAccess() {
CompileResult compileResult = BCompileUtil.compile("test-src/structs/struct-private-fields-02-negative.bal");
BAssertUtil.validateError(compileResult, 0, "attempt to refer to non-public symbol 'ssn'", 9, 18);
BAssertUtil.validateError(compileResult, 1, "undefined field 'ssn' in struct 'org.foo:person'", 9, 18);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class AnnotationTest method testSensitiveNegative.
@Test
public void testSensitiveNegative() {
CompileResult result = BCompileUtil.compile("test-src/taintchecking/annotations/sensitive-negative.bal");
Assert.assertTrue(result.getDiagnostics().length == 2);
BAssertUtil.validateError(result, 0, "tainted value passed to sensitive parameter 'secureIn'", 2, 39);
BAssertUtil.validateError(result, 1, "tainted value passed to sensitive parameter 'secureIn'", 3, 50);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class AnnotationTest method testSensitiveRestArgs.
@Test
public void testSensitiveRestArgs() {
CompileResult result = BCompileUtil.compile("test-src/taintchecking/annotations/sensitive-rest-args.bal");
Assert.assertTrue(result.getDiagnostics().length == 0);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class AnnotationTest method testSensitiveDefaultArgs.
@Test
public void testSensitiveDefaultArgs() {
CompileResult result = BCompileUtil.compile("test-src/taintchecking/annotations/sensitive-default-args.bal");
Assert.assertTrue(result.getDiagnostics().length == 0);
}
Aggregations