From 0a3aebb7747b67be43f3e169f25dfa835b09f3de Mon Sep 17 00:00:00 2001
From: jakubs <jakubs>
Date: Wed, 3 Oct 2012 12:48:30 +0000
Subject: [PATCH] slighlty improve the checking of the registration status in
 the transformed image representattions test

SVN: 26968
---
 .../systemtests/TransformedImageRepresentationsTest.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/screening/sourceTest/java/ch/systemsx/cisd/openbis/screening/systemtests/TransformedImageRepresentationsTest.java b/screening/sourceTest/java/ch/systemsx/cisd/openbis/screening/systemtests/TransformedImageRepresentationsTest.java
index 2f68cc7bd02..a8ac7a7fc32 100644
--- a/screening/sourceTest/java/ch/systemsx/cisd/openbis/screening/systemtests/TransformedImageRepresentationsTest.java
+++ b/screening/sourceTest/java/ch/systemsx/cisd/openbis/screening/systemtests/TransformedImageRepresentationsTest.java
@@ -22,6 +22,8 @@ import java.io.IOException;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import org.apache.commons.io.FileUtils;
 import org.springframework.mock.web.MockHttpServletRequest;
@@ -154,7 +156,11 @@ public class TransformedImageRepresentationsTest extends AbstractScreeningSystem
     @Override
     protected boolean checkLogContentForFinishedDataSetRegistration(String logContent)
     {
-        return logContent.contains("Post registration of 4. of 4 data sets");
+        String pattern = "Post registration of ([0-9]*)\\. of \\1 data sets";
+        // matches "Post registration of n. of n data sets"
+        Pattern p = Pattern.compile(pattern);
+        Matcher m = p.matcher(logContent);
+        return m.find();
     }
 
 }
-- 
GitLab