Search in sources :

Example 1 with StreamResource

use of com.runwaysdk.resource.StreamResource in project geoprism-registry by terraframe.

the class GeotoolsLoopTest method testQuerySorting.

@Test
public void testQuerySorting() throws Exception {
    String[] files = new String[] { "shapefile/ntd_zam_operational_28082020.zip.test", "shapefile/schs_voronoi_externalId.zip.test", "cb_2017_us_state_500k.zip.test" };
    for (String file : files) {
        String filename = file;
        if (file.endsWith(".test")) {
            filename = file.replace(".test", "");
        }
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(file);
        ApplicationResource res = new StreamResource(is, filename);
        Set<String> sorted = runInReq(res, true);
        InputStream is2 = Thread.currentThread().getContextClassLoader().getResourceAsStream(file);
        ApplicationResource res2 = new StreamResource(is2, filename);
        Set<String> unsorted = runInReq(res2, false);
        diff(unsorted, sorted);
        Assert.assertEquals(sorted.size(), unsorted.size());
    }
}
Also used : StreamResource(com.runwaysdk.resource.StreamResource) ApplicationResource(com.runwaysdk.resource.ApplicationResource) InputStream(java.io.InputStream) Test(org.junit.Test)

Aggregations

ApplicationResource (com.runwaysdk.resource.ApplicationResource)1 StreamResource (com.runwaysdk.resource.StreamResource)1 InputStream (java.io.InputStream)1 Test (org.junit.Test)1