Java源码示例:org.apache.flink.streaming.util.SourceFunctionUtil
示例1
@Test
public void fromElementsTest() throws Exception {
List<Integer> expectedList = Arrays.asList(1, 2, 3);
List<Integer> actualList = SourceFunctionUtil.runSourceFunction(CommonTestUtils.createCopySerializable(
new FromElementsFunction<Integer>(
IntSerializer.INSTANCE,
1,
2,
3)));
assertEquals(expectedList, actualList);
}
示例2
@Test
public void fromCollectionTest() throws Exception {
List<Integer> expectedList = Arrays.asList(1, 2, 3);
List<Integer> actualList = SourceFunctionUtil.runSourceFunction(
CommonTestUtils.createCopySerializable(new FromElementsFunction<Integer>(
IntSerializer.INSTANCE,
Arrays.asList(1, 2, 3))));
assertEquals(expectedList, actualList);
}
示例3
@Test
public void fromElementsTest() throws Exception {
List<Integer> expectedList = Arrays.asList(1, 2, 3);
List<Integer> actualList = SourceFunctionUtil.runSourceFunction(CommonTestUtils.createCopySerializable(
new FromElementsFunction<Integer>(
IntSerializer.INSTANCE,
1,
2,
3)));
assertEquals(expectedList, actualList);
}
示例4
@Test
public void fromCollectionTest() throws Exception {
List<Integer> expectedList = Arrays.asList(1, 2, 3);
List<Integer> actualList = SourceFunctionUtil.runSourceFunction(
CommonTestUtils.createCopySerializable(new FromElementsFunction<Integer>(
IntSerializer.INSTANCE,
Arrays.asList(1, 2, 3))));
assertEquals(expectedList, actualList);
}
示例5
@Test
public void fromElementsTest() throws Exception {
List<Integer> expectedList = Arrays.asList(1, 2, 3);
List<Integer> actualList = SourceFunctionUtil.runSourceFunction(CommonTestUtils.createCopySerializable(
new FromElementsFunction<Integer>(
IntSerializer.INSTANCE,
1,
2,
3)));
assertEquals(expectedList, actualList);
}
示例6
@Test
public void fromCollectionTest() throws Exception {
List<Integer> expectedList = Arrays.asList(1, 2, 3);
List<Integer> actualList = SourceFunctionUtil.runSourceFunction(
CommonTestUtils.createCopySerializable(new FromElementsFunction<Integer>(
IntSerializer.INSTANCE,
Arrays.asList(1, 2, 3))));
assertEquals(expectedList, actualList);
}