use of org.ballerinalang.model.values.BInteger in project ballerina by ballerina-lang.
the class BNullValueTest method testArrayNull.
@Test(description = "Test null value of a array")
public void testArrayNull() {
BValue[] vals = BRunUtil.invoke(positiveCompileResult, "testArrayNull", new BValue[] {});
Assert.assertEquals(vals[0], null);
Assert.assertEquals(vals[1], null);
Assert.assertEquals(vals[2], new BInteger(9));
}
use of org.ballerinalang.model.values.BInteger in project ballerina by ballerina-lang.
the class StringTest method testLength.
@Test
public void testLength() {
BValue[] args = { new BString("Bandwagon") };
BValue[] returns = BRunUtil.invoke(result, "length", args);
Assert.assertTrue(returns[0] instanceof BInteger);
Assert.assertEquals(((BInteger) returns[0]).intValue(), 9);
}
use of org.ballerinalang.model.values.BInteger in project ballerina by ballerina-lang.
the class StringTest method testSubString.
@Test
public void testSubString() {
BValue[] args = { new BString("testValues"), new BInteger(0), new BInteger(9) };
BValue[] returns = BRunUtil.invoke(result, "subString", args);
Assert.assertTrue(returns[0] instanceof BString);
Assert.assertEquals(returns[0].stringValue(), "testValue");
}
use of org.ballerinalang.model.values.BInteger in project ballerina by ballerina-lang.
the class TableIterationTest method testCloseConnectionPool.
@Test(dependsOnGroups = "TableIterTest")
public void testCloseConnectionPool() {
BValue[] returns = BRunUtil.invoke(result, "testCloseConnectionPool");
BInteger retValue = (BInteger) returns[0];
Assert.assertEquals(retValue.intValue(), 1);
}
use of org.ballerinalang.model.values.BInteger in project ballerina by ballerina-lang.
the class TableTest method testCloseConnectionPool.
@Test(dependsOnGroups = "TableTest", description = "Check whether all sql connectors are closed properly.")
public void testCloseConnectionPool() {
BValue[] returns = BRunUtil.invoke(result, "testCloseConnectionPool");
BInteger retValue = (BInteger) returns[0];
Assert.assertEquals(retValue.intValue(), 1);
}
Aggregations