changeset 458:570f01ef5c39

minor
author Devel 1
date Tue, 01 Aug 2017 12:46:57 +0200
parents 1a2b3b01b35c
children e7cf31ba49a2
files stress-tester-comparator/src/test/java/com/passus/st/comparator/ComparatorTest.java
diffstat 1 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester-comparator/src/test/java/com/passus/st/comparator/ComparatorTest.java	Tue Aug 01 12:46:20 2017 +0200
+++ b/stress-tester-comparator/src/test/java/com/passus/st/comparator/ComparatorTest.java	Tue Aug 01 12:46:57 2017 +0200
@@ -84,24 +84,27 @@
 
     // TODO: copy-pasted
     private static void checkReportables(List<Reportable> reportables) {
+        int i = 1;
         for (Reportable reportable : reportables) {
-            ReportablePair rp = (ReportablePair) reportable;
-            assertEmptyDiffOrMissingBoth(rp.request);
-            assertEmptyDiffOrMissingBoth(rp.response);
+            assertTrue(reportable instanceof ReportablePair);
+            ReportablePair rp = (Reportable.ReportablePair) reportable;
+            assertEmptyDiffOrMissingBoth(rp.request, "req " + i);
+            assertEmptyDiffOrMissingBoth(rp.response, "resp " + i);
+            i++;
         }
     }
 
     // TODO: copy-pasted
-    private static void assertEmptyDiffOrMissingBoth(Reportable r) {
+    private static void assertEmptyDiffOrMissingBoth(Reportable r, String s) {
         if (r instanceof Differences) {
             Differences<? extends HttpMessage> d = (Differences) r;
-            assertTrue(d.isEmpty());
+            assertTrue(d.isEmpty(), s);
         } else if (r instanceof MissingMessage) {
             MissingMessage m = (MissingMessage) r;
-            assertFalse(m.has1());
-            assertFalse(m.has2());
+            assertFalse(m.has1(), s);
+            assertFalse(m.has2(), s);
         } else {
-            fail("Should be empty diff or have both messages missing.");
+            fail("Should be empty diff or have both messages missing. (" + s + ")");
         }
     }