use of org.ballerinalang.model.values.BInteger in project ballerina by ballerina-lang.
the class BMapValueTest method testBMapClear.
@Test
public void testBMapClear() {
BMap<BString, BInteger> map = new BMap<>();
map.put(new BString("IS"), new BInteger(0));
map.put(new BString("ESB"), new BInteger(1));
map.put(new BString("APIM"), new BInteger(2));
assertEquals(map.size(), 3);
map.clear();
assertEquals(map.size(), 0);
}
use of org.ballerinalang.model.values.BInteger in project ballerina by ballerina-lang.
the class BMapValueTest method testBMapToString.
@Test(description = "Testing convert map values to string")
public void testBMapToString() {
BMap<String, BRefType> map = new BMap<>();
map.put(new String("key1"), new BInteger(1));
map.put(new String("key2"), new BString("foo"));
map.put(new String("key3"), new BXMLItem("<bar>hello</bar>"));
Assert.assertEquals(map.stringValue(), "{\"key1\":1, \"key2\":\"foo\", \"key3\":<bar>hello</bar>}");
}
use of org.ballerinalang.model.values.BInteger in project ballerina by ballerina-lang.
the class BNullValueTest method testStructNull.
@Test(description = "Test null value of a struct")
public void testStructNull() {
BValue[] vals = BRunUtil.invoke(positiveCompileResult, "testStructNull", new BValue[] {});
Assert.assertEquals(vals[0], null);
Assert.assertEquals(vals[1], null);
Assert.assertEquals(vals[2], new BInteger(7));
}
use of org.ballerinalang.model.values.BInteger in project ballerina by ballerina-lang.
the class BNullValueTest method testXmlNull.
@Test(description = "Test null value of a xml")
public void testXmlNull() {
BValue[] vals = BRunUtil.invoke(positiveCompileResult, "testXmlNull", new BValue[] {});
Assert.assertEquals(vals[0], null);
Assert.assertEquals(vals[1], null);
Assert.assertEquals(vals[2], new BInteger(5));
}
use of org.ballerinalang.model.values.BInteger in project ballerina by ballerina-lang.
the class BNullValueTest method testJsonNull.
@Test(description = "Test null value of a json")
public void testJsonNull() {
BValue[] vals = BRunUtil.invoke(positiveCompileResult, "testJsonNull", new BValue[] {});
Assert.assertEquals(vals[0], null);
Assert.assertEquals(vals[1], null);
Assert.assertEquals(vals[2], new BInteger(6));
}
Aggregations