diff --git a/src/test/java/teetime/stage/opad/filter/AnomalyDetectionFilterTest.java b/src/test/java/teetime/stage/opad/filter/AnomalyDetectionFilterTest.java index 3fffb0bcaac89ef128b2c6f348533522dfa39a53..a8eef115f45ebb6827f550f3e56156360674bcac 100644 --- a/src/test/java/teetime/stage/opad/filter/AnomalyDetectionFilterTest.java +++ b/src/test/java/teetime/stage/opad/filter/AnomalyDetectionFilterTest.java @@ -24,12 +24,15 @@ import static org.junit.Assert.assertThat; import static teetime.framework.test.StageTester.test; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; +import teetime.util.Pair; + import kieker.tools.opad.record.StorableDetectionResult; /** @@ -72,21 +75,31 @@ public class AnomalyDetectionFilterTest { @Test @Ignore("maybe a problem in; org.hamcrest.collection.IsIterableContainingInOrder.contains") public void OutputPortAnnormalShouldForwardElements() { - test(adf).and().send(input3, input4).to(adf.getInputPort()).and().receive(resultsNormalPort).from(adf.getOutputPortNormal()).start(); + test(adf).and().send(input3, input4).to(adf.getInputPort()) + .and().receive(resultsNormalPort).from(adf.getOutputPortNormal()) + .start(); assertEquals(0, resultsAnnormalPort.size()); - test(adf).and().send(input3, input4).to(adf.getInputPort()).and().receive(resultsAnnormalPort).from(adf.getOutputPortAnnormal()).start(); + test(adf).and().send(input3, input4).to(adf.getInputPort()) + .and().receive(resultsAnnormalPort).from(adf.getOutputPortAnnormal()) + .start(); assertThat(resultsAnnormalPort, contains(input3, input4)); } @Test public void bothOutputPortsShouldForwardElements() { - test(adf).and().send(input1, input2, input3, input4).to(adf.getInputPort()).and().receive(resultsNormalPort).from(adf.getOutputPortNormal()).start(); + Collection<Pair<Thread, Throwable>> exceptions; + exceptions = test(adf).and().send(input1, input2, input3, input4).to(adf.getInputPort()) + .and().receive(resultsNormalPort).from(adf.getOutputPortNormal()) + .start(); + assertThat(exceptions, is(empty())); assertThat(resultsNormalPort, is(not(empty()))); assertThat(resultsNormalPort, contains(input1, input2)); - test(adf).and().send(input1, input2, input3, input4, input5).to(adf.getInputPort()).and().receive(resultsAnnormalPort).from(adf.getOutputPortAnnormal()) + exceptions = test(adf).and().send(input1, input2, input3, input4, input5).to(adf.getInputPort()) + .and().receive(resultsAnnormalPort).from(adf.getOutputPortAnnormal()) .start(); + assertThat(exceptions, is(empty())); assertThat(resultsAnnormalPort, is(not(empty()))); assertThat(resultsAnnormalPort, contains(input3, input4, input5)); }