Skip to content
Snippets Groups Projects
Commit 21a091b7 authored by felmer's avatar felmer
Browse files

making DssComponentTest more robust

SVN: 37743
parent 149819ac
No related branches found
No related tags found
No related merge requests found
...@@ -27,10 +27,12 @@ import java.util.ArrayList; ...@@ -27,10 +27,12 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.commons.lang.time.DateUtils; import org.apache.commons.lang.time.DateUtils;
import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test; import org.testng.annotations.Test;
...@@ -462,6 +464,7 @@ public class DssComponentTest extends SystemTestCase ...@@ -462,6 +464,7 @@ public class DssComponentTest extends SystemTestCase
{ {
IEncapsulatedOpenBISService openBISService = ServiceProvider.getOpenBISService(); IEncapsulatedOpenBISService openBISService = ServiceProvider.getOpenBISService();
List<SimpleDataSetInformationDTO> dataSets = openBISService.listPhysicalDataSets(); List<SimpleDataSetInformationDTO> dataSets = openBISService.listPhysicalDataSets();
final String prefix = DateFormatUtils.format(new Date(), "yyyyMMddHHmmssSSS").substring(0, 6);
Collections.sort(dataSets, new Comparator<SimpleDataSetInformationDTO>() Collections.sort(dataSets, new Comparator<SimpleDataSetInformationDTO>()
{ {
@Override @Override
...@@ -474,7 +477,7 @@ public class DssComponentTest extends SystemTestCase ...@@ -474,7 +477,7 @@ public class DssComponentTest extends SystemTestCase
private String normalize(String code) private String normalize(String code)
{ {
return code.startsWith("2") ? code : "0" + code; return code.startsWith(prefix) ? code : "0" + code;
} }
}); });
return dataSets.get(0); return dataSets.get(0);
......
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