提交 cd47b2b4 编写于 作者: M Márton Balassi 提交者: Stephan Ewen

[streaming] Added test package for Partitioners

上级 48ae7ca6
......@@ -82,8 +82,8 @@ public class StreamSource extends AbstractInputTask<RandIS> {
@Override
public void invoke() throws Exception {
userFunction.invoke();
log.debug("Invoking source: " + sourceInstanceID);
userFunction.invoke();
}
}
package eu.stratosphere.streaming.partitioner;
import static org.junit.Assert.assertArrayEquals;
import org.junit.Before;
import org.junit.Test;
import eu.stratosphere.streaming.api.streamrecord.StreamRecord;
import eu.stratosphere.types.StringValue;
public class BroadcastPartitionerTest {
private BroadcastPartitioner broadcastPartitioner;
private StreamRecord streamRecord = new StreamRecord(new StringValue());
@Before
public void setBroadcastPartitioner() {
broadcastPartitioner = new BroadcastPartitioner();
}
@Test
public void testSelectChannels() {
int[] first = new int[] { 0 };
int[] second = new int[] { 0, 1 };
int[] sixth = new int[] { 0, 1, 2, 3, 4, 5 };
assertArrayEquals(first, broadcastPartitioner.selectChannels(streamRecord, 1));
assertArrayEquals(second, broadcastPartitioner.selectChannels(streamRecord, 1));
assertArrayEquals(sixth, broadcastPartitioner.selectChannels(streamRecord, 1));
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册