Search in sources :

Example 1 with GeoBrowser

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;
    }
}
Also used : GeoRecord(ubic.gemma.core.loader.expression.geo.model.GeoRecord) IOException(java.io.IOException) GeoBrowser(ubic.gemma.core.loader.expression.geo.service.GeoBrowser) Test(org.junit.Test)

Example 2 with GeoBrowser

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;
    }
}
Also used : GeoRecord(ubic.gemma.core.loader.expression.geo.model.GeoRecord) IOException(java.io.IOException) GeoBrowser(ubic.gemma.core.loader.expression.geo.service.GeoBrowser) Test(org.junit.Test)

Aggregations

IOException (java.io.IOException)2 Test (org.junit.Test)2 GeoRecord (ubic.gemma.core.loader.expression.geo.model.GeoRecord)2 GeoBrowser (ubic.gemma.core.loader.expression.geo.service.GeoBrowser)2