Search in sources :

Example 11 with CompileResult

use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.

the class TaintedStatusPropagationTest method testTupleReturn.

@Test
public void testTupleReturn() {
    CompileResult result = BCompileUtil.compile("test-src/taintchecking/propagation/tuple-return.bal");
    Assert.assertTrue(result.getDiagnostics().length == 0);
}
Also used : CompileResult(org.ballerinalang.launcher.util.CompileResult) Test(org.testng.annotations.Test)

Example 12 with CompileResult

use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.

the class TaintedStatusPropagationTest method testStringTemplate.

@Test
public void testStringTemplate() {
    CompileResult result = BCompileUtil.compile("test-src/taintchecking/propagation/string-template.bal");
    Assert.assertTrue(result.getDiagnostics().length == 0);
}
Also used : CompileResult(org.ballerinalang.launcher.util.CompileResult) Test(org.testng.annotations.Test)

Example 13 with CompileResult

use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.

the class TaintedStatusPropagationTest method testArray.

@Test
public void testArray() {
    CompileResult result = BCompileUtil.compile("test-src/taintchecking/propagation/array.bal");
    Assert.assertTrue(result.getDiagnostics().length == 0);
}
Also used : CompileResult(org.ballerinalang.launcher.util.CompileResult) Test(org.testng.annotations.Test)

Example 14 with CompileResult

use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.

the class TaintedStatusPropagationTest method testWithoutUserDataNegative.

@Test
public void testWithoutUserDataNegative() {
    CompileResult result = BCompileUtil.compile("test-src/taintchecking/propagation/without-user-data-negative.bal");
    Assert.assertTrue(result.getDiagnostics().length == 1);
    BAssertUtil.validateError(result, 0, "tainted value passed to sensitive parameter 'secureIn'", 7, 20);
}
Also used : CompileResult(org.ballerinalang.launcher.util.CompileResult) Test(org.testng.annotations.Test)

Example 15 with CompileResult

use of org.ballerinalang.launcher.util.CompileResult in project ballerina by ballerina-lang.

the class TaintedStatusPropagationTest method testChainedInvocationsNegative.

@Test
public void testChainedInvocationsNegative() {
    CompileResult result = BCompileUtil.compile("test-src/taintchecking/propagation/chained-invocations-negative.bal");
    Assert.assertTrue(result.getDiagnostics().length == 1);
    BAssertUtil.validateError(result, 0, "tainted value passed to sensitive parameter 'secureIn'", 2, 20);
}
Also used : CompileResult(org.ballerinalang.launcher.util.CompileResult) Test(org.testng.annotations.Test)

Aggregations

CompileResult (org.ballerinalang.launcher.util.CompileResult)291 Test (org.testng.annotations.Test)287 BValue (org.ballerinalang.model.values.BValue)60 PackageNode (org.ballerinalang.model.tree.PackageNode)16 BLangDocumentation (org.wso2.ballerinalang.compiler.tree.BLangDocumentation)14 BString (org.ballerinalang.model.values.BString)13 BInteger (org.ballerinalang.model.values.BInteger)12 Path (java.nio.file.Path)5 BLangVariable (org.wso2.ballerinalang.compiler.tree.BLangVariable)5 File (java.io.File)4 GrpcCmd (org.ballerinalang.protobuf.cmd.GrpcCmd)4 BStringArray (org.ballerinalang.model.values.BStringArray)3 BLangDeprecatedNode (org.wso2.ballerinalang.compiler.tree.BLangDeprecatedNode)3 BLangFunction (org.wso2.ballerinalang.compiler.tree.BLangFunction)3 BLangStruct (org.wso2.ballerinalang.compiler.tree.BLangStruct)3 BFloat (org.ballerinalang.model.values.BFloat)2 BIntArray (org.ballerinalang.model.values.BIntArray)2 BMap (org.ballerinalang.model.values.BMap)2 BeforeTest (org.testng.annotations.BeforeTest)2 BLangService (org.wso2.ballerinalang.compiler.tree.BLangService)2