use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class TaintedStatusPropagationTest method testServiceVariablesNegative.
@Test
public void testServiceVariablesNegative() {
CompileResult result = BCompileUtil.compile("test-src/taintchecking/propagation/service-level-variables-negative.bal");
Assert.assertTrue(result.getDiagnostics().length == 2);
BAssertUtil.validateError(result, 0, "tainted value passed to global variable 'serviceLevelVariable'", 19, 9);
BAssertUtil.validateError(result, 1, "tainted value passed to global variable 'globalLevelVariable'", 20, 9);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class TaintedStatusPropagationTest method testXMLNegative.
@Test
public void testXMLNegative() {
CompileResult result = BCompileUtil.compile("test-src/taintchecking/propagation/xml-negative.bal");
Assert.assertTrue(result.getDiagnostics().length == 4);
BAssertUtil.validateError(result, 0, "tainted value passed to sensitive parameter 'secureIn'", 7, 20);
BAssertUtil.validateError(result, 1, "tainted value passed to sensitive parameter 'secureIn'", 10, 20);
BAssertUtil.validateError(result, 2, "tainted value passed to sensitive parameter 'secureIn'", 13, 20);
BAssertUtil.validateError(result, 3, "tainted value passed to sensitive parameter 'secureIn'", 14, 20);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class TaintedStatusPropagationTest method testMultipleInvocationLevels.
@Test
public void testMultipleInvocationLevels() {
CompileResult result = BCompileUtil.compile("test-src/taintchecking/propagation/multiple-invocation-levels.bal");
Assert.assertTrue(result.getDiagnostics().length == 0);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class TaintedStatusPropagationTest method testReceiverNegative.
@Test
public void testReceiverNegative() {
CompileResult result = BCompileUtil.compile("test-src/taintchecking/propagation/receiver-negative.bal");
Assert.assertTrue(result.getDiagnostics().length == 1);
BAssertUtil.validateError(result, 0, "tainted value passed to sensitive parameter 'secureIn'", 3, 20);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class TaintedStatusPropagationTest method testXML.
@Test
public void testXML() {
CompileResult result = BCompileUtil.compile("test-src/taintchecking/propagation/xml.bal");
Assert.assertTrue(result.getDiagnostics().length == 0);
}
Aggregations