Java Code Examples for org.apache.flink.util.StringValueUtils.WhitespaceTokenizer

The following examples show how to use org.apache.flink.util.StringValueUtils.WhitespaceTokenizer. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: Flink-CEPplus   Source File: StringValueUtilsTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testTokenizerOnStringWithoutNexToken() {
	StringValue testString = new StringValue("test");
	StringValueUtils.WhitespaceTokenizer tokenizer = new WhitespaceTokenizer();
	tokenizer.setStringToTokenize(testString);
	//first token
	tokenizer.next(testString);
	//next token is not exist
	assertFalse(tokenizer.next(testString));
}
 
Example 2
Source Project: Flink-CEPplus   Source File: StringValueUtilsTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testTokenizerOnStringWithNexToken() {
	StringValue testString = new StringValue("test test");
	StringValueUtils.WhitespaceTokenizer tokenizer = new WhitespaceTokenizer();
	tokenizer.setStringToTokenize(testString);
	assertTrue(tokenizer.next(testString));
}
 
Example 3
Source Project: Flink-CEPplus   Source File: StringValueUtilsTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testTokenizerOnStringOnlyWithDelimiter() {
	StringValue testString = new StringValue("    ");
	StringValueUtils.WhitespaceTokenizer tokenizer = new WhitespaceTokenizer();
	tokenizer.setStringToTokenize(testString);
	assertFalse(tokenizer.next(testString));
}
 
Example 4
Source Project: flink   Source File: StringValueUtilsTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testTokenizerOnStringWithoutNexToken() {
	StringValue testString = new StringValue("test");
	StringValueUtils.WhitespaceTokenizer tokenizer = new WhitespaceTokenizer();
	tokenizer.setStringToTokenize(testString);
	//first token
	tokenizer.next(testString);
	//next token is not exist
	assertFalse(tokenizer.next(testString));
}
 
Example 5
Source Project: flink   Source File: StringValueUtilsTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testTokenizerOnStringWithNexToken() {
	StringValue testString = new StringValue("test test");
	StringValueUtils.WhitespaceTokenizer tokenizer = new WhitespaceTokenizer();
	tokenizer.setStringToTokenize(testString);
	assertTrue(tokenizer.next(testString));
}
 
Example 6
Source Project: flink   Source File: StringValueUtilsTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testTokenizerOnStringOnlyWithDelimiter() {
	StringValue testString = new StringValue("    ");
	StringValueUtils.WhitespaceTokenizer tokenizer = new WhitespaceTokenizer();
	tokenizer.setStringToTokenize(testString);
	assertFalse(tokenizer.next(testString));
}
 
Example 7
Source Project: flink   Source File: StringValueUtilsTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testTokenizerOnStringWithoutNexToken() {
	StringValue testString = new StringValue("test");
	StringValueUtils.WhitespaceTokenizer tokenizer = new WhitespaceTokenizer();
	tokenizer.setStringToTokenize(testString);
	//first token
	tokenizer.next(testString);
	//next token is not exist
	assertFalse(tokenizer.next(testString));
}
 
Example 8
Source Project: flink   Source File: StringValueUtilsTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testTokenizerOnStringWithNexToken() {
	StringValue testString = new StringValue("test test");
	StringValueUtils.WhitespaceTokenizer tokenizer = new WhitespaceTokenizer();
	tokenizer.setStringToTokenize(testString);
	assertTrue(tokenizer.next(testString));
}
 
Example 9
Source Project: flink   Source File: StringValueUtilsTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testTokenizerOnStringOnlyWithDelimiter() {
	StringValue testString = new StringValue("    ");
	StringValueUtils.WhitespaceTokenizer tokenizer = new WhitespaceTokenizer();
	tokenizer.setStringToTokenize(testString);
	assertFalse(tokenizer.next(testString));
}