Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test for issue #210 #212

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,42 @@ public void testGeotiff() throws FileNotFoundException, IOException {
// Test not exists
assertFalse(reader.existsCoveragestore(DEFAULT_WS, storeName));
}

@Test
public void testGeotiffWithEmptyCoverageName() throws FileNotFoundException, IOException {
if (!enabled()) return;
deleteAll();

File geotiff = new ClassPathResource("testdata/resttestdem.tif").getFile();

assertTrue(reader.getWorkspaces().isEmpty());
assertTrue(publisher.createWorkspace(DEFAULT_WS));

// known state?
assertFalse("Cleanup failed", existsLayer(layerName));

// test insert
boolean pub = publisher.publishGeoTIFF(DEFAULT_WS, storeName, geotiff);

assertNotNull("publish() failed", pub);
// Test exists
assertTrue(reader.existsCoveragestore(DEFAULT_WS, storeName));
assertTrue(reader.existsCoverage(DEFAULT_WS, storeName, storeName));

pub = publisher.publishGeoTIFF(DEFAULT_WS, storeName+"another", "", geotiff);

assertTrue("publish() with empty string coverageName failed", pub);

double[] bbox = {-103.85, 44.38, -103.62, 44.50};
pub = publisher.publishGeoTIFF(DEFAULT_WS, storeName+"another_complex", "", geotiff, "EPSG:4326", ProjectionPolicy.REPROJECT_TO_DECLARED, "raster", bbox);

assertTrue("publish() ith empty string coverageName failed", pub);

//delete
assertTrue("Unpublish() failed", publisher.removeCoverageStore(DEFAULT_WS, storeName,true));
// Test not exists
assertFalse(reader.existsCoveragestore(DEFAULT_WS, storeName));
}

@Test
public void testGeoTiffWithStyleInWorkspace() throws IOException
Expand Down