use of ubic.gemma.core.loader.expression.geo.service.GeoBrowser in project Gemma by PavlidisLab.
the class GeoBrowserTest method testGetGeoRecordsBySearchTerm.
@Test
public void testGetGeoRecordsBySearchTerm() throws Exception {
GeoBrowser b = new GeoBrowser();
try {
Collection<GeoRecord> res = b.getGeoRecordsBySearchTerm("Homo+sapiens[orgn]", 10, 10);
// Check that the search has returned at least one record
assertTrue(res.size() > 0);
// Print out accession numbers etc.; check that the records returned match the search term
for (GeoRecord record : res) {
System.out.println("Accession: " + record.getGeoAccession());
System.out.println("Title : " + record.getTitle());
System.out.println("Number of samples: " + record.getNumSamples());
System.out.println("Date: " + record.getReleaseDate());
assertTrue(record.getOrganisms().contains("Homo sapiens"));
}
} catch (IOException e) {
if (e.getMessage().contains("GEO returned an error")) {
GeoBrowserTest.log.warn("GEO returned an error, skipping test.");
return;
}
throw e;
}
}
use of ubic.gemma.core.loader.expression.geo.service.GeoBrowser in project Gemma by PavlidisLab.
the class GeoBrowserTest method testGetRecentGeoRecords.
@Test
public void testGetRecentGeoRecords() throws Exception {
GeoBrowser b = new GeoBrowser();
try {
Collection<GeoRecord> res = b.getRecentGeoRecords(10, 10);
assertTrue(res.size() > 0);
} catch (IOException e) {
if (e.getMessage().contains("GEO returned an error")) {
GeoBrowserTest.log.warn("GEO returned an error, skipping test.");
return;
}
throw e;
}
}
Aggregations