Skip to content
Snippets Groups Projects
Commit 9575e447 authored by felmer's avatar felmer
Browse files

remove Sample comparators because Sample implements Comparable

SVN: 26432
parent 9da1824a
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,6 @@ import java.io.Serializable; ...@@ -20,7 +20,6 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -183,8 +182,11 @@ public class TableForUpdateExporter ...@@ -183,8 +182,11 @@ public class TableForUpdateExporter
{ {
builder.append("[").append(entry.getKey()).append("]").append(lineSeparator); builder.append("[").append(entry.getKey()).append("]").append(lineSeparator);
} }
builder.append(getTableForSamples(entry, lineSeparator, getAllPropertyTypes(rowMap builder.append(getTableForSamples(
.get(entry.getKey()), commonServer.listSampleTypes(sessionToken)))); entry,
lineSeparator,
getAllPropertyTypes(rowMap.get(entry.getKey()),
commonServer.listSampleTypes(sessionToken))));
} }
return builder.toString(); return builder.toString();
} }
...@@ -201,14 +203,7 @@ public class TableForUpdateExporter ...@@ -201,14 +203,7 @@ public class TableForUpdateExporter
builder.columnGroup("").addColumnsForPropertyTypesForUpdate(allPropertyTypes); builder.columnGroup("").addColumnsForPropertyTypesForUpdate(allPropertyTypes);
List<Sample> samples = entry.getValue(); List<Sample> samples = entry.getValue();
Collections.sort(samples, new Comparator<Sample>() Collections.sort(samples);
{
@Override
public int compare(Sample s1, Sample s2)
{
return s1.getIdentifier().compareTo(s2.getIdentifier());
}
});
for (Sample sample : samples) for (Sample sample : samples)
{ {
builder.addRow(sample); builder.addRow(sample);
......
...@@ -20,7 +20,6 @@ import static org.testng.AssertJUnit.assertEquals; ...@@ -20,7 +20,6 @@ import static org.testng.AssertJUnit.assertEquals;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.TreeSet; import java.util.TreeSet;
...@@ -69,14 +68,7 @@ public class SamplesListingTest extends SystemTestCase ...@@ -69,14 +68,7 @@ public class SamplesListingTest extends SystemTestCase
assertSamples(resultSet, "/CISD/CHILD-PLATE1", "/CISD/CHILD-PLATE2", assertSamples(resultSet, "/CISD/CHILD-PLATE1", "/CISD/CHILD-PLATE2",
"/CISD/PLATE-WITH_EXPERIMENT"); "/CISD/PLATE-WITH_EXPERIMENT");
List<Sample> samples = asList(resultSet); List<Sample> samples = asList(resultSet);
Collections.sort(samples, new Comparator<Sample>() Collections.sort(samples);
{
@Override
public int compare(Sample s1, Sample s2)
{
return s1.getIdentifier().compareTo(s2.getIdentifier());
}
});
assertEquals("[COMMENT: my plate child]", samples.get(0).getProperties().toString()); assertEquals("[COMMENT: my plate child]", samples.get(0).getProperties().toString());
assertEquals("/CISD/PLATE-WITH_EXPERIMENT", samples.get(0).getParents().iterator().next() assertEquals("/CISD/PLATE-WITH_EXPERIMENT", samples.get(0).getParents().iterator().next()
.getIdentifier()); .getIdentifier());
......
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