Skip to content
Snippets Groups Projects
Commit 5dc5ea63 authored by cramakri's avatar cramakri
Browse files

MINOR: Fixing screening integration tests.

SVN: 20010
parent 0e2a9c4d
No related branches found
No related tags found
No related merge requests found
...@@ -96,25 +96,31 @@ public class ScreeningClientApiTest ...@@ -96,25 +96,31 @@ public class ScreeningClientApiTest
plateWells = facade.listPlateWells(experimentIdentifer, gene, true); plateWells = facade.listPlateWells(experimentIdentifer, gene, true);
print(String.format("Wells with gene '%s' in experiment '%s': %s", gene, print(String.format("Wells with gene '%s' in experiment '%s': %s", gene,
experimentIdentifer, plateWells)); experimentIdentifer, plateWells));
featuresForPlateWells = facade.loadFeaturesForPlateWells(experimentIdentifer, gene, null); featuresForPlateWells =
facade.loadFeaturesForPlateWells(experimentIdentifer, gene, null);
print("Features for wells: " + featuresForPlateWells); print("Features for wells: " + featuresForPlateWells);
featuresForPlateWellsCheck = facade.loadFeaturesForDatasetWellReferences( featuresForPlateWellsCheck =
facade.convertToFeatureVectorDatasetWellIdentifier(plateWells), null); facade.loadFeaturesForDatasetWellReferences(
facade.convertToFeatureVectorDatasetWellIdentifier(plateWells), null);
} catch (Exception e) } catch (Exception e)
{ {
print(e.toString()); print(e.toString());
} }
if (featuresForPlateWells != null && featuresForPlateWells.equals(featuresForPlateWellsCheck) == false) if (featuresForPlateWells != null
&& featuresForPlateWells.equals(featuresForPlateWellsCheck) == false)
{ {
throw new IllegalStateException(String.format( throw new IllegalStateException(String.format(
"Inconsistent results to fetch feature vectors, expected:\n%s\nbut got:\n%s", "Inconsistent results to fetch feature vectors, expected:\n%s\nbut got:\n%s",
featuresForPlateWells, featuresForPlateWellsCheck)); featuresForPlateWells, featuresForPlateWellsCheck));
} }
List<Plate> plates = facade.listPlates(); List<Plate> plates = facade.listPlates();
print("Plates: " + plates); print("Plates: " + plates);
List<ImageDatasetReference> imageDatasets = facade.listRawImageDatasets(plates); @SuppressWarnings("deprecation")
// TODO 2011-02-16, CR, There is no non-deprecated method to get all data sets.
// In the Test, Plate1 has a raw image data set, plates 2 and 3 have overlay image data
// sets. There is no other way to get the overlay image data sets.
List<ImageDatasetReference> imageDatasets = facade.listImageDatasets(plates);
Collections.sort(imageDatasets, new Comparator<ImageDatasetReference>() Collections.sort(imageDatasets, new Comparator<ImageDatasetReference>()
{ {
public int compare(ImageDatasetReference r1, ImageDatasetReference r2) public int compare(ImageDatasetReference r1, ImageDatasetReference r2)
...@@ -127,13 +133,15 @@ public class ScreeningClientApiTest ...@@ -127,13 +133,15 @@ public class ScreeningClientApiTest
List<FeatureVectorDatasetReference> featureVectorDatasets = List<FeatureVectorDatasetReference> featureVectorDatasets =
facade.listFeatureVectorDatasets(plates); facade.listFeatureVectorDatasets(plates);
Collections.sort(featureVectorDatasets, new Comparator<FeatureVectorDatasetReference>() Collections.sort(featureVectorDatasets, new Comparator<FeatureVectorDatasetReference>()
{
public int compare(FeatureVectorDatasetReference r1,
FeatureVectorDatasetReference r2)
{ {
public int compare(FeatureVectorDatasetReference r1, FeatureVectorDatasetReference r2) return r2.getPlate().getPlateCode().compareTo(r1.getPlate().getPlateCode());
{ }
return r2.getPlate().getPlateCode().compareTo(r1.getPlate().getPlateCode()); });
} print("Feature vector datasets: "
}); + featureVectorDatasets.subList(0, Math.min(5, featureVectorDatasets.size())));
print("Feature vector datasets: " + featureVectorDatasets.subList(0, Math.min(5, featureVectorDatasets.size())));
List<String> featureCodes = facade.listAvailableFeatureCodes(featureVectorDatasets); List<String> featureCodes = facade.listAvailableFeatureCodes(featureVectorDatasets);
Collections.sort(featureCodes); Collections.sort(featureCodes);
...@@ -141,12 +149,13 @@ public class ScreeningClientApiTest ...@@ -141,12 +149,13 @@ public class ScreeningClientApiTest
List<FeatureVectorDataset> features = List<FeatureVectorDataset> features =
facade.loadFeatures(featureVectorDatasets, featureCodes); facade.loadFeatures(featureVectorDatasets, featureCodes);
Collections.sort(features, new Comparator<FeatureVectorDataset>() Collections.sort(features, new Comparator<FeatureVectorDataset>()
{
public int compare(FeatureVectorDataset f1, FeatureVectorDataset f2)
{ {
public int compare(FeatureVectorDataset f1, FeatureVectorDataset f2) return f2.getDataset().getPlate().getPlateCode()
{ .compareTo(f1.getDataset().getPlate().getPlateCode());
return f2.getDataset().getPlate().getPlateCode().compareTo(f1.getDataset().getPlate().getPlateCode()); }
} });
});
print("Loaded feature datasets: " + features.size()); print("Loaded feature datasets: " + features.size());
if (features.size() > 0) if (features.size() > 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