Skip to content
Snippets Groups Projects
Commit c277d90c authored by anttil's avatar anttil
Browse files

SWE-22 / SP-940: Try to stabilize datastore_server tests

SVN: 29991
parent 7f11bde8
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,8 @@
package ch.systemsx.cisd.common.logging;
import java.io.ByteArrayOutputStream;
import java.util.Arrays;
import java.util.List;
import org.apache.log4j.Layout;
import org.apache.log4j.Level;
......@@ -113,6 +115,10 @@ public final class BufferedAppender extends WriterAppender
{
return new String(logRecorder.toByteArray()).trim();
}
public List<String> getLogLines() {
return Arrays.asList(getLogContent().split("\n"));
}
public final void resetLogContent()
{
......
......@@ -16,6 +16,9 @@
package ch.systemsx.cisd.etlserver.path;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasItem;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -97,8 +100,9 @@ public class DataSetAndPathInfoDBConsistencyCheckTaskTest extends AssertJUnit
task.execute();
assertEquals("INFO OPERATION.DataSetAndPathInfoDBConsistencyCheckTask - "
+ "Check 1 data sets registered since 1970-01-01 01:00:00", logRecorder.getLogContent());
assertThat(logRecorder.getLogLines(), hasItem("INFO OPERATION.DataSetAndPathInfoDBConsistencyCheckTask - "
+ "Check 1 data sets registered since 1970-01-01 01:00:00"));
assertEquals(true, fileContent.isClosed());
assertEquals(true, pathInfoContent.isClosed());
context.assertIsSatisfied();
......
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