From 672c5f2d54a41b1146a28f56aa877faedafdfa86 Mon Sep 17 00:00:00 2001
From: jakubs <jakubs>
Date: Mon, 29 Sep 2014 11:50:10 +0000
Subject: [PATCH] SSDM-911 update tests

SVN: 32517
---
 .../systemsx/cisd/common/test/AssertionUtil.java | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/common/source/java/ch/systemsx/cisd/common/test/AssertionUtil.java b/common/source/java/ch/systemsx/cisd/common/test/AssertionUtil.java
index 513a9ef6469..9f65a027f1a 100644
--- a/common/source/java/ch/systemsx/cisd/common/test/AssertionUtil.java
+++ b/common/source/java/ch/systemsx/cisd/common/test/AssertionUtil.java
@@ -23,6 +23,7 @@ import static org.testng.AssertJUnit.fail;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -88,6 +89,19 @@ public class AssertionUtil
         assertTrue("Expected to contain lines:\n" + expected + "\nactual lines:\n" + actual, expectedLines.equals(actualLines));
     }
 
+    public static void assertContainsLinesInAnyOrder(String expected, String actual)
+    {
+        List<String> expectedLines = getLines(expected);
+        List<String> actualLines = getLines(actual);
+
+        actualLines.retainAll(expectedLines);
+
+        Collections.sort(expectedLines);
+        Collections.sort(actualLines);
+
+        assertTrue("Expected to contain lines:\n" + expected + "\nactual lines:\n" + actual, expectedLines.equals(actualLines));
+    }
+
     /** asserts that two int arrays are equal **/
     public static void assertArraysEqual(int[] a1, int[] a2)
     {
@@ -135,7 +149,7 @@ public class AssertionUtil
         return stringValues;
     }
 
-    private static Collection<String> getLines(String text)
+    private static List<String> getLines(String text)
     {
         if (text == null || text.isEmpty())
         {
-- 
GitLab