use of org.ballerinalang.model.values.BValue in project ballerina by ballerina-lang.
the class AssertTest method testAssertStringArrayEquals3.
@Test(expectedExceptions = BLangRuntimeException.class, expectedExceptionsMessageRegExp = ".*expected " + "\\[\"A\", \"b\", \"C\"\\] but found \\[\"A\", \"B\", \"C\"\\].*")
public void testAssertStringArrayEquals3() {
BValue[] args = { new BInteger(3) };
BTestUtils.invoke(compileResult, "testAssertStringArrayEquals", args);
}
use of org.ballerinalang.model.values.BValue in project ballerina by ballerina-lang.
the class AssertTest method testNoAssertFail.
@Test
public void testNoAssertFail() {
BValue[] args = { new BBoolean(true) };
BTestUtils.invoke(compileResult, "testAssertFail", args);
}
use of org.ballerinalang.model.values.BValue in project ballerina by ballerina-lang.
the class AssertTest method testAssertBooleanEqualsFail.
@Test(expectedExceptions = BLangRuntimeException.class, expectedExceptionsMessageRegExp = ".*expected false but found true.*")
public void testAssertBooleanEqualsFail() {
BValue[] args = { new BBoolean(true), new BBoolean(false) };
BTestUtils.invoke(compileResult, "testAssertBooleanEquals", args);
}
use of org.ballerinalang.model.values.BValue in project ballerina by ballerina-lang.
the class ConfigTest method testGetAsStringNegative.
@Test(description = "test get global method with unavailable config")
public void testGetAsStringNegative() throws IOException {
BString key = new BString("ballerina.wso2");
BValue[] inputArg = { key };
registry.initRegistry(new HashMap<>(), null, ballerinaConfPath);
BValue[] returnVals = BRunUtil.invoke(compileResult, "testGetAsString", inputArg);
Assert.assertFalse(returnVals == null || returnVals.length == 0, "Invalid Return Values.");
Assert.assertTrue(returnVals[0] instanceof BString || returnVals[0] == null);
// Assert.assertNull(returnVals[0].stringValue());
}
use of org.ballerinalang.model.values.BValue in project ballerina by ballerina-lang.
the class ConfigTest method testGetInstanceValuesWithDefaultConfigFile.
@Test(description = "test instance method with default config file properties")
public void testGetInstanceValuesWithDefaultConfigFile() throws IOException {
BString key = new BString("http1.ballerina.http.port");
BValue[] inputArg = { key };
registry.initRegistry(new HashMap<>(), null, ballerinaConfPath);
BValue[] returnVals = BRunUtil.invoke(compileResult, "testGetAsString", inputArg);
Assert.assertFalse(returnVals == null || returnVals.length == 0 || returnVals[0] == null, "Invalid Return Values.");
Assert.assertTrue(returnVals[0] instanceof BString);
Assert.assertEquals(returnVals[0].stringValue(), "8085");
}
Aggregations