Search in sources :

Example 16 with BString

use of org.ballerinalang.model.values.BString in project ballerina by ballerina-lang.

the class SQLActionsTest method testGeneratedKeyOnInsert.

@Test(groups = "ConnectorTest")
public void testGeneratedKeyOnInsert() {
    BValue[] returns = BRunUtil.invoke(result, "testGeneratedKeyOnInsert");
    BString retValue = (BString) returns[0];
    Assert.assertTrue(Integer.parseInt(retValue.stringValue()) > 0);
}
Also used : BValue(org.ballerinalang.model.values.BValue) BString(org.ballerinalang.model.values.BString) Test(org.testng.annotations.Test)

Example 17 with BString

use of org.ballerinalang.model.values.BString in project ballerina by ballerina-lang.

the class SQLActionsTest method testCallProcedureWithMultipleResultSets.

@Test(groups = "ConnectorTest")
public void testCallProcedureWithMultipleResultSets() {
    BValue[] returns = BRunUtil.invoke(result, "testCallProcedureWithMultipleResultSets");
    BString retValue = (BString) returns[0];
    final String expected = "Peter";
    BString retValue2 = (BString) returns[1];
    final String expected2 = "John";
    Assert.assertEquals(retValue.stringValue(), expected);
    Assert.assertEquals(retValue2.stringValue(), expected2);
}
Also used : BValue(org.ballerinalang.model.values.BValue) BString(org.ballerinalang.model.values.BString) BString(org.ballerinalang.model.values.BString) Test(org.testng.annotations.Test)

Example 18 with BString

use of org.ballerinalang.model.values.BString in project ballerina by ballerina-lang.

the class SQLActionsTest method testGeneratedKeyWithColumn.

@Test(groups = "ConnectorTest")
public void testGeneratedKeyWithColumn() {
    BValue[] returns = BRunUtil.invoke(result, "testGeneratedKeyWithColumn");
    BString retValue = (BString) returns[0];
    Assert.assertTrue(Integer.parseInt(retValue.stringValue()) > 0);
}
Also used : BValue(org.ballerinalang.model.values.BValue) BString(org.ballerinalang.model.values.BString) Test(org.testng.annotations.Test)

Example 19 with BString

use of org.ballerinalang.model.values.BString in project ballerina by ballerina-lang.

the class SQLActionsTest method testQueryParameters.

@Test(groups = "ConnectorTest")
public void testQueryParameters() {
    BValue[] returns = BRunUtil.invoke(result, "testQueryParameters");
    BString retValue = (BString) returns[0];
    final String expected = "Peter";
    Assert.assertEquals(retValue.stringValue(), expected);
}
Also used : BValue(org.ballerinalang.model.values.BValue) BString(org.ballerinalang.model.values.BString) BString(org.ballerinalang.model.values.BString) Test(org.testng.annotations.Test)

Example 20 with BString

use of org.ballerinalang.model.values.BString in project ballerina by ballerina-lang.

the class SQLActionsTest method testStructOutParameters.

@Test(groups = "ConnectorTest")
public void testStructOutParameters() {
    BValue[] returns = BRunUtil.invoke(result, "testStructOutParameters");
    BString retValue = (BString) returns[0];
    String expected = "10";
    Assert.assertEquals(retValue.stringValue(), expected);
}
Also used : BValue(org.ballerinalang.model.values.BValue) BString(org.ballerinalang.model.values.BString) BString(org.ballerinalang.model.values.BString) Test(org.testng.annotations.Test)

Aggregations

BString (org.ballerinalang.model.values.BString)418 BValue (org.ballerinalang.model.values.BValue)339 Test (org.testng.annotations.Test)321 BInteger (org.ballerinalang.model.values.BInteger)77 BStruct (org.ballerinalang.model.values.BStruct)76 BMap (org.ballerinalang.model.values.BMap)37 BBoolean (org.ballerinalang.model.values.BBoolean)36 BFloat (org.ballerinalang.model.values.BFloat)34 BJSON (org.ballerinalang.model.values.BJSON)28 BallerinaException (org.ballerinalang.util.exceptions.BallerinaException)21 BRefValueArray (org.ballerinalang.model.values.BRefValueArray)18 DefaultHttpHeaders (io.netty.handler.codec.http.DefaultHttpHeaders)11 HttpHeaders (io.netty.handler.codec.http.HttpHeaders)11 CompileResult (org.ballerinalang.launcher.util.CompileResult)11 BBlob (org.ballerinalang.model.values.BBlob)11 BStringArray (org.ballerinalang.model.values.BStringArray)11 BType (org.ballerinalang.model.types.BType)10 BIntArray (org.ballerinalang.model.values.BIntArray)9 BRefType (org.ballerinalang.model.values.BRefType)9 UnsupportedEncodingException (java.io.UnsupportedEncodingException)7