From d78a1d8bde66d5b8467dc3bcb03075b54838506a Mon Sep 17 00:00:00 2001
From: anttil <anttil>
Date: Mon, 21 Oct 2013 11:08:06 +0000
Subject: [PATCH] SWE-22 / SP-940: Try to stabilize datastore_server tests

SVN: 29992
---
 ...AndPathInfoDBConsistencyCheckTaskTest.java | 23 +++++++++----------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/path/DataSetAndPathInfoDBConsistencyCheckTaskTest.java b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/path/DataSetAndPathInfoDBConsistencyCheckTaskTest.java
index e2b08661b57..1e0839567f4 100644
--- a/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/path/DataSetAndPathInfoDBConsistencyCheckTaskTest.java
+++ b/datastore_server/sourceTest/java/ch/systemsx/cisd/etlserver/path/DataSetAndPathInfoDBConsistencyCheckTaskTest.java
@@ -119,20 +119,19 @@ public class DataSetAndPathInfoDBConsistencyCheckTaskTest extends AssertJUnit
 
         task.execute();
 
-        assertEquals("INFO  OPERATION.DataSetAndPathInfoDBConsistencyCheckTask - "
-                + "Check 1 data sets registered since 1970-01-01 01:00:00\n"
-                + "ERROR OPERATION.DataSetAndPathInfoDBConsistencyChecker - "
+        assertThat(logRecorder.getLogLines(), hasItem("INFO  OPERATION.DataSetAndPathInfoDBConsistencyCheckTask - "
+                + "Check 1 data sets registered since 1970-01-01 01:00:00"));
+        assertThat(logRecorder.getLogLines(), hasItem("ERROR OPERATION.DataSetAndPathInfoDBConsistencyChecker - "
                 + "Couldn't check consistency of the file system and "
-                + "the path info database for a data set: ds1\n"
-                + "java.lang.RuntimeException: Oohps!\n"
-                + "ERROR NOTIFY.DataSetAndPathInfoDBConsistencyCheckTask - "
+                + "the path info database for a data set: ds1"));
+        assertThat(logRecorder.getLogLines(), hasItem("java.lang.RuntimeException: Oohps!"));
+        assertThat(logRecorder.getLogLines(), hasItem("ERROR NOTIFY.DataSetAndPathInfoDBConsistencyCheckTask - "
                 + "File system and path info DB consistency check report "
-                + "for all data sets since 1970-01-01 01:00:00\n\n"
-                + "Error when checking datasets:\n\n"
-                + "ERROR: \"Couldn't check consistency of the file system and "
-                + "the path info database for a data set: ds1 "
-                + "because of the following exception: Oohps!\"",
-                LogUtils.removeEmbeddedStackTrace(logRecorder.getLogContent()));
+                + "for all data sets since 1970-01-01 01:00:00"));
+        assertThat(logRecorder.getLogLines(), hasItem("Error when checking datasets:"));
+        assertThat(logRecorder.getLogLines(), hasItem("ERROR: \"Couldn't check consistency of the file system and "
+                + "the path info database for a data set: ds1 because of the following exception: Oohps!\""));
+
         assertEquals(true, fileContent.isClosed());
         context.assertIsSatisfied();
     }
-- 
GitLab