Search in sources :

Example 71 with BString

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

the class StringTest method testReplaceAllNull.

@Test(expectedExceptions = { BLangRuntimeException.class }, expectedExceptionsMessageRegExp = ".*error:.*NullReferenceException.*")
public void testReplaceAllNull() {
    BValue[] args = { new BString("abc is not abc as abc anymore"), new BString(null), new BString("xyz") };
    BRunUtil.invoke(result, "replaceAll", args);
}
Also used : BValue(org.ballerinalang.model.values.BValue) BString(org.ballerinalang.model.values.BString) Test(org.testng.annotations.Test)

Example 72 with BString

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

the class StringTest method testEqualsIgnoreCase.

@Test
public void testEqualsIgnoreCase() {
    BValue[] args = { new BString("WSO2"), new BString("wso2") };
    BRunUtil.invoke(result, "equalsIgnoreCase", args);
}
Also used : BValue(org.ballerinalang.model.values.BValue) BString(org.ballerinalang.model.values.BString) Test(org.testng.annotations.Test)

Example 73 with BString

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

the class StringTest method testReplaceAllByNull.

@Test(expectedExceptions = { BLangRuntimeException.class }, expectedExceptionsMessageRegExp = ".*error:.*NullReferenceException.*")
public void testReplaceAllByNull() {
    BValue[] args = { new BString("abc is not abc as abc anymore"), new BString("abc"), new BString(null) };
    BRunUtil.invoke(result, "replaceAll", args);
}
Also used : BValue(org.ballerinalang.model.values.BValue) BString(org.ballerinalang.model.values.BString) Test(org.testng.annotations.Test)

Example 74 with BString

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

the class StringTest method testContains.

@Test
public void testContains() {
    BValue[] args = { new BString(s1), new BString("WSO2") };
    BValue[] returns = BRunUtil.invoke(result, "contains", args);
}
Also used : BValue(org.ballerinalang.model.values.BValue) BString(org.ballerinalang.model.values.BString) Test(org.testng.annotations.Test)

Example 75 with BString

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

the class StringTest method testSplitByNull.

@Test(expectedExceptions = { BLangRuntimeException.class }, expectedExceptionsMessageRegExp = ".*error:.*NullReferenceException.*")
public void testSplitByNull() {
    BValue[] args = { new BString("name1 name2 name3"), new BString(null) };
    BRunUtil.invoke(result, "split", args);
}
Also used : BValue(org.ballerinalang.model.values.BValue) 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