Skip to content
Snippets Groups Projects
Commit af2976c2 authored by Nelson Tavares de Sousa's avatar Nelson Tavares de Sousa
Browse files

added test for roundrobin2

parent 0b461065
No related branches found
No related tags found
No related merge requests found
...@@ -74,6 +74,29 @@ public class DistributorTest { ...@@ -74,6 +74,29 @@ public class DistributorTest {
assertThat(this.secondIntegers, is(empty())); assertThat(this.secondIntegers, is(empty()));
} }
@Test
public void roundRobin2ShouldWork() {
distributor.setStrategy(new RoundRobinStrategy2());
test(distributor).and().send(1, 2, 3, 4, 5).to(distributor.getInputPort()).and().receive(firstIntegers).from(distributor.getNewOutputPort()).and()
.receive(secondIntegers).from(distributor.getNewOutputPort()).start();
assertThat(this.firstIntegers, contains(1, 3, 5));
assertThat(this.secondIntegers, contains(2, 4));
}
@Test
public void singleElementRoundRobin2ShouldWork() {
distributor.setStrategy(new RoundRobinStrategy2());
test(distributor).and().send(1).to(distributor.getInputPort()).and().receive(firstIntegers).from(distributor.getNewOutputPort()).and()
.receive(secondIntegers)
.from(distributor.getNewOutputPort()).start();
assertThat(this.firstIntegers, contains(1));
assertThat(this.secondIntegers, is(empty()));
}
@Test @Test
public void copyByReferenceShouldWork() { public void copyByReferenceShouldWork() {
distributor.setStrategy(new CopyByReferenceStrategy()); distributor.setStrategy(new CopyByReferenceStrategy());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment