use of org.ballerinalang.model.values.BInteger in project carbon-apimgt by wso2.
the class WaitTestCase method testCacheDeleteOperation.
@Test
public void testCacheDeleteOperation() {
// Create arguments to initiate cache
BValue[] args = { new BInteger(15) };
// Test ballerina cache create, put and get
BValue[] returns = BLangFunctions.invokeNew(bLangProgram, "testWait", args);
// Assert if cache entry is BValue
Assert.assertTrue(returns[0] instanceof BValue);
}
use of org.ballerinalang.model.values.BInteger in project ballerina by ballerina-lang.
the class Length method execute.
@Override
public void execute(Context context) {
String param1 = context.getStringArgument(0);
BInteger intValue = new BInteger(param1.length());
context.setReturnValues(intValue);
}
use of org.ballerinalang.model.values.BInteger in project ballerina by ballerina-lang.
the class AssertTest method testAssertIntEquals.
@Test
public void testAssertIntEquals() {
BValue[] args = { new BInteger(3), new BInteger(5) };
BTestUtils.invoke(compileResult, "testAssertIntEquals", args);
}
use of org.ballerinalang.model.values.BInteger in project ballerina by ballerina-lang.
the class AssertTest method testAssertFloatArrayEquals1.
@Test(expectedExceptions = BLangRuntimeException.class, expectedExceptionsMessageRegExp = ".*expected \\[1.1, 2.2, 3.3\\] but found \\[1.1, 2.2, 3.3, " + "4.4\\].*")
public void testAssertFloatArrayEquals1() {
BValue[] args = { new BInteger(1) };
BTestUtils.invoke(compileResult, "testAssertFloatArrayEquals", args);
}
use of org.ballerinalang.model.values.BInteger in project ballerina by ballerina-lang.
the class AssertTest method testAssertStringArrayEquals0.
@Test
public void testAssertStringArrayEquals0() {
BValue[] args = { new BInteger(0) };
BTestUtils.invoke(compileResult, "testAssertStringArrayEquals", args);
}
Aggregations