use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class TaintedStatusPropagationTest method testCompoundAssignmentNegative.
@Test
public void testCompoundAssignmentNegative() {
CompileResult result = BCompileUtil.compile("test-src/taintchecking/propagation/compound-assignment-negative.bal");
Assert.assertTrue(result.getDiagnostics().length == 3);
BAssertUtil.validateError(result, 0, "tainted value passed to sensitive parameter 'secureIn'", 5, 20);
BAssertUtil.validateError(result, 1, "tainted value passed to sensitive parameter 'secureIn'", 9, 20);
BAssertUtil.validateError(result, 2, "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 testIfConditionNegative.
@Test
public void testIfConditionNegative() {
CompileResult result = BCompileUtil.compile("test-src/taintchecking/propagation/if-condition-negative.bal");
Assert.assertTrue(result.getDiagnostics().length == 2);
BAssertUtil.validateError(result, 0, "tainted value passed to sensitive parameter 'secureIn'", 8, 20);
BAssertUtil.validateError(result, 1, "tainted value passed to sensitive parameter 'secureIn'", 16, 20);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class TaintedStatusPropagationTest method testCastNegative.
@Test
public void testCastNegative() {
CompileResult result = BCompileUtil.compile("test-src/taintchecking/propagation/cast-negative.bal");
Assert.assertTrue(result.getDiagnostics().length == 1);
BAssertUtil.validateError(result, 0, "tainted value passed to sensitive parameter 'secureIn'", 4, 20);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class IOTest method testFileIONegative.
@Test
public void testFileIONegative() {
CompileResult result = BCompileUtil.compile("test-src/taintchecking/connectors/file-read-negative.bal");
Assert.assertTrue(result.getDiagnostics().length == 3);
BAssertUtil.validateError(result, 0, "tainted value passed to sensitive parameter 'accessMode'", 6, 17);
BAssertUtil.validateError(result, 1, "tainted value passed to sensitive parameter 'accessMode'", 8, 50);
BAssertUtil.validateError(result, 2, "tainted value passed to sensitive parameter 'nBytes'", 11, 36);
// Blocked on return annotation support
// BAssertUtil.validateError(result, 3, "tainted value passed to sensitive parameter 'sensitiveValue'", 16, 18);
}
use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.
the class SQLTest method testSelectWithTaintedQueryNegative.
@Test
public void testSelectWithTaintedQueryNegative() {
CompileResult result = BCompileUtil.compile("test-src/taintchecking/connectors/sql-select-tainted-query-negative.bal");
Assert.assertTrue(result.getDiagnostics().length == 1);
BAssertUtil.validateError(result, 0, "tainted value passed to sensitive parameter 'sqlQuery'", 18, 31);
}
Aggregations