Adding REST test to delete and re-harvest tiff mosaic granules

This commit is contained in:
Daniele Romagnoli 2013-05-09 11:36:33 +02:00
parent 715fb71508
commit c3a437de20
8 changed files with 308 additions and 170 deletions

View File

@ -26,6 +26,7 @@ package it.geosolutions.geoserver.rest;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTAbstractManager;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStoreManager;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStructuredGridCoverageReaderManager;
import java.net.MalformedURLException;
import java.net.URL;
@ -51,6 +52,8 @@ public class GeoServerRESTManager extends GeoServerRESTAbstractManager {
private final GeoServerRESTStoreManager store;
private final GeoServerRESTStructuredGridCoverageReaderManager structuredGridCoverageReader;
/**
* Default constructor.
*
@ -69,6 +72,7 @@ public class GeoServerRESTManager extends GeoServerRESTAbstractManager {
// Internal publisher and reader, provide simple access methods.
publisher = new GeoServerRESTPublisher(restURL.toString(), username, password);
reader = new GeoServerRESTReader(restURL, username, password);
structuredGridCoverageReader = new GeoServerRESTStructuredGridCoverageReaderManager(restURL, username, password);
store = new GeoServerRESTStoreManager(restURL, gsuser, gspass);
}
@ -84,4 +88,8 @@ public class GeoServerRESTManager extends GeoServerRESTAbstractManager {
return store;
}
public GeoServerRESTStructuredGridCoverageReaderManager getStructuredGridCoverageReader() {
return structuredGridCoverageReader;
}
}

View File

@ -38,7 +38,7 @@ import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy
import it.geosolutions.geoserver.rest.encoder.GSWorkspaceEncoder;
import it.geosolutions.geoserver.rest.encoder.coverage.GSCoverageEncoder;
import it.geosolutions.geoserver.rest.encoder.feature.GSFeatureTypeEncoder;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStructuredCoverageGridReaderManager;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStructuredGridCoverageReaderManager;
import java.io.File;
import java.io.FileNotFoundException;
@ -2665,8 +2665,8 @@ public class GeoServerRESTPublisher {
*/
public boolean createOrHarvestExternal(String workspace, String coverageStore, String format, String path) {
try {
GeoServerRESTStructuredCoverageGridReaderManager manager =
new GeoServerRESTStructuredCoverageGridReaderManager(new URL(restURL), gsuser, gspass);
GeoServerRESTStructuredGridCoverageReaderManager manager =
new GeoServerRESTStructuredGridCoverageReaderManager(new URL(restURL), gsuser, gspass);
return manager.createOrHarvestExternal(workspace, coverageStore, format, path);
} catch (IllegalArgumentException e) {
if(LOGGER.isInfoEnabled()){
@ -2695,8 +2695,8 @@ public class GeoServerRESTPublisher {
*/
public boolean removeGranuleById(final String workspace, String coverageStore, String coverage, String granuleId) {
try {
GeoServerRESTStructuredCoverageGridReaderManager manager =
new GeoServerRESTStructuredCoverageGridReaderManager(new URL(restURL), gsuser, gspass);
GeoServerRESTStructuredGridCoverageReaderManager manager =
new GeoServerRESTStructuredGridCoverageReaderManager(new URL(restURL), gsuser, gspass);
return manager.removeGranuleById(workspace, coverageStore, coverage, granuleId);
} catch (IllegalArgumentException e) {
if(LOGGER.isInfoEnabled()){
@ -2724,8 +2724,8 @@ public class GeoServerRESTPublisher {
*/
public boolean removeGranulesByCQL(final String workspace, String coverageStore,String coverage, String filter) throws UnsupportedEncodingException{
try {
GeoServerRESTStructuredCoverageGridReaderManager manager =
new GeoServerRESTStructuredCoverageGridReaderManager(new URL(restURL), gsuser, gspass);
GeoServerRESTStructuredGridCoverageReaderManager manager =
new GeoServerRESTStructuredGridCoverageReaderManager(new URL(restURL), gsuser, gspass);
return manager.removeGranulesByCQL(workspace, coverageStore, coverage, filter);
} catch (IllegalArgumentException e) {
if(LOGGER.isInfoEnabled()){

View File

@ -43,7 +43,7 @@ import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageGranulesList
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageIndexSchema;
import it.geosolutions.geoserver.rest.decoder.RESTStyleList;
import it.geosolutions.geoserver.rest.decoder.RESTWorkspaceList;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStructuredCoverageGridReaderManager;
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStructuredGridCoverageReaderManager;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
@ -52,7 +52,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -597,8 +596,8 @@ public class GeoServerRESTReader {
String coverageStore, String coverage, String id) throws MalformedURLException,
UnsupportedEncodingException {
try {
GeoServerRESTStructuredCoverageGridReaderManager manager =
new GeoServerRESTStructuredCoverageGridReaderManager(new URL(baseurl), username, password);
GeoServerRESTStructuredGridCoverageReaderManager manager =
new GeoServerRESTStructuredGridCoverageReaderManager(new URL(baseurl), username, password);
return manager.getGranuleById(workspace, coverageStore, coverage, id);
} catch (IllegalArgumentException e) {
if(LOGGER.isInfoEnabled()){
@ -624,11 +623,10 @@ public class GeoServerRESTReader {
* @throws MalformedURLException
* @throws UnsupportedEncodingException
*/
@Test
public RESTStructuredCoverageIndexSchema getGranuleIndexSchema(final String workspace, String coverageStore, String coverage) throws MalformedURLException {
try {
GeoServerRESTStructuredCoverageGridReaderManager manager =
new GeoServerRESTStructuredCoverageGridReaderManager(new URL(baseurl), username, password);
GeoServerRESTStructuredGridCoverageReaderManager manager =
new GeoServerRESTStructuredGridCoverageReaderManager(new URL(baseurl), username, password);
return manager.getGranuleIndexSchema(workspace, coverageStore, coverage);
} catch (IllegalArgumentException e) {
if(LOGGER.isInfoEnabled()){
@ -657,12 +655,11 @@ public class GeoServerRESTReader {
* @throws MalformedURLException
* @throws UnsupportedEncodingException
*/
@Test
public RESTStructuredCoverageGranulesList getGranules(final String workspace, String coverageStore, String coverage, String filter, String offset, String limit)
throws MalformedURLException, UnsupportedEncodingException {
try {
GeoServerRESTStructuredCoverageGridReaderManager manager =
new GeoServerRESTStructuredCoverageGridReaderManager(new URL(baseurl), username, password);
GeoServerRESTStructuredGridCoverageReaderManager manager =
new GeoServerRESTStructuredGridCoverageReaderManager(new URL(baseurl), username, password);
return manager.getGranules(workspace, coverageStore, coverage, filter, offset, limit);
} catch (IllegalArgumentException e) {
if(LOGGER.isInfoEnabled()){

View File

@ -86,6 +86,14 @@ public class RESTCoverageStore {
return cs.getChild("workspace").getChildText("name");
}
public String getURL() {
return cs.getChildText("url");
}
public String getType() {
return cs.getChildText("type");
}
public String toString() {
StringBuilder sb = new StringBuilder(getClass().getSimpleName())
.append('[');

View File

@ -34,23 +34,22 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Manage GeoTools StructuredCoverageGridReader. It allows to create a store from a file or harvest
* Manage GeoTools StructuredGridCoverageReader. It allows to create a store from a file or harvest
* the coverages contained in a file, to delete granules from an existing coverage and eventually
* to get information about the granules insi a StructuredCoverageGridReader.
* to get information about the granules inside a StructuredGridCoverageReader.
*
* @author Simone Giannecchini, GeoSolutions
*/
public class GeoServerRESTStructuredCoverageGridReaderManager extends GeoServerRESTAbstractManager {
public class GeoServerRESTStructuredGridCoverageReaderManager extends GeoServerRESTAbstractManager {
/**
* Default logger
*/
private final static Logger LOGGER = LoggerFactory.getLogger(GeoServerRESTStructuredCoverageGridReaderManager.class);
private final static Logger LOGGER = LoggerFactory.getLogger(GeoServerRESTStructuredGridCoverageReaderManager.class);
/**
* Default constructor.
@ -60,7 +59,7 @@ public class GeoServerRESTStructuredCoverageGridReaderManager extends GeoServerR
* @param password GeoServer REST API password for the former username
* @throws IllegalArgumentException
*/
public GeoServerRESTStructuredCoverageGridReaderManager(URL restURL, String username, String password) throws IllegalArgumentException, MalformedURLException{
public GeoServerRESTStructuredGridCoverageReaderManager(URL restURL, String username, String password) throws IllegalArgumentException, MalformedURLException{
super(restURL, username, password);
}
@ -253,7 +252,6 @@ public class GeoServerRESTStructuredCoverageGridReaderManager extends GeoServerR
* @throws MalformedURLException
* @throws UnsupportedEncodingException
*/
@Test
public RESTStructuredCoverageIndexSchema getGranuleIndexSchema(final String workspace, String coverageStore, String coverage) throws MalformedURLException {
// checks
checkString(workspace);
@ -284,7 +282,6 @@ public class GeoServerRESTStructuredCoverageGridReaderManager extends GeoServerR
* @throws MalformedURLException
* @throws UnsupportedEncodingException
*/
@Test
public RESTStructuredCoverageGranulesList getGranules(final String workspace, String coverageStore, String coverage, String filter, String offset, String limit)
throws MalformedURLException, UnsupportedEncodingException {
// checks
@ -328,7 +325,6 @@ public class GeoServerRESTStructuredCoverageGridReaderManager extends GeoServerR
* @throws MalformedURLException
* @throws UnsupportedEncodingException
*/
@Test
public RESTStructuredCoverageGranulesList getGranuleById(final String workspace,
String coverageStore, String coverage, String id) throws MalformedURLException,
UnsupportedEncodingException {

View File

@ -0,0 +1,265 @@
/*
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2002-2011, Open Source Geospatial Foundation (OSGeo)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package it.geosolutions.geoserver.rest.manager;
import it.geosolutions.geoserver.rest.GeoServerRESTReader;
import it.geosolutions.geoserver.rest.datastore.StoreIntegrationTest;
import it.geosolutions.geoserver.rest.decoder.RESTCoverageStore;
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageGranulesList;
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageGranulesList.RESTStructuredCoverageGranule;
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageIndexSchema;
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageIndexSchema.RESTStructuredCoverageIndexAttribute;
import it.geosolutions.geoserver.rest.encoder.GSAbstractStoreEncoder;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLDecoder;
import java.util.Iterator;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* In order to test that class, make sure to configure a geoserver with a "mosaic" store.
*
* 1) take the mosaic.zip archive contained on src/test/resources/testdata.granules
* 2) extract it on disk
* 3) configure an ImageMosaic store on geoserver (name the store as "mosaic"), use the "it.geosolutions" workspace
* 4) configure a layer on that store (name the coverage as "mosaic" again).
* 5) on dimensions configuration tab, make sure to enable custom depth and date dimensions.
* 6) publish it.
*
*
* @author Simone Giannecchini, simone.giannecchini@geo-solutions.it
* @author Daniele Romagnoli, GeoSolutions SAS
*
*/
public class GeoServerRESTImageMosaicManagerTest extends StoreIntegrationTest {
private final static Logger LOGGER = LoggerFactory.getLogger(GeoServerRESTImageMosaicManagerTest.class);
/**
* @param ignore
* @throws IllegalArgumentException
* @throws MalformedURLException
*/
public GeoServerRESTImageMosaicManagerTest()
throws IllegalArgumentException, MalformedURLException {
super(true);
}
@Override
public GSAbstractStoreEncoder getStoreEncoderTest() {
return null;
}
@Test
public void createAndDelete() throws IllegalArgumentException, MalformedURLException, UnsupportedEncodingException{
GeoServerRESTStructuredGridCoverageReaderManager manager =
new GeoServerRESTStructuredGridCoverageReaderManager(new URL(RESTURL), RESTUSER, RESTPW);
GeoServerRESTReader reader = new GeoServerRESTReader(new URL(RESTURL), RESTUSER, RESTPW);
// check index format
RESTStructuredCoverageIndexSchema indexFormat = manager.getGranuleIndexSchema("it.geosolutions", "mosaic","mosaic");
if (indexFormat == null) {
if (LOGGER.isWarnEnabled()) {
LOGGER.warn("sample coverage hasn't been found. Make sure to configure the layer before running this test");
return;
}
}
assertNotNull(indexFormat);
assertFalse(indexFormat.isEmpty());
assertEquals(5, indexFormat.size());
Iterator<RESTStructuredCoverageIndexAttribute> iterator = indexFormat.iterator();
while (iterator.hasNext()) {
final RESTStructuredCoverageIndexAttribute element = iterator.next();
final String elementName = element.getName();
if (elementName.equals("location")) {
assertEquals("0", element.getMinOccurs());
assertEquals("1", element.getMaxOccurs());
assertEquals("true", element.getNillable());
assertEquals("java.lang.String", element.getBinding());
} else if (elementName.equals("time")) {
assertEquals("0", element.getMinOccurs());
assertEquals("1", element.getMaxOccurs());
assertEquals("true", element.getNillable());
assertEquals("java.sql.Timestamp", element.getBinding());
} else if (elementName.equals("date")) {
assertEquals("0", element.getMinOccurs());
assertEquals("1", element.getMaxOccurs());
assertEquals("true", element.getNillable());
assertEquals("java.lang.String", element.getBinding());
} else if (elementName.equals("depth")) {
assertEquals("0", element.getMinOccurs());
assertEquals("1", element.getMaxOccurs());
assertEquals("true", element.getNillable());
assertEquals("java.lang.Integer", element.getBinding());
}
}
RESTStructuredCoverageGranulesList granulesList = null;
RESTStructuredCoverageGranule granule = null;
// get some granules by id
// manager.getGranuleById("it.geosolutions", "mosaic","mosaic","2");
// assertNotNull(granulesList);
// assertSame(1, granulesList.size());
// assertFalse(granulesList.isEmpty());
// RESTStructuredCoverageGranule granule = granulesList.get(0);
// assertNotNull(granule);
// assertEquals(granule.getAttributeByIndex(4), "1250.0");
// assertEquals(granule.getAttributeByName("elevation"), "1250.0");
// get with paging
granulesList = manager.getGranules("it.geosolutions", "mosaic", "mosaic" , null, "0", "1");
assertNotNull(granulesList);
assertEquals(1, granulesList.size());
assertFalse(granulesList.isEmpty());
granule = granulesList.get(0);
assertNotNull(granule);
granulesList = manager.getGranules("it.geosolutions", "mosaic", "mosaic", null, null, "2");
assertNotNull(granulesList);
assertEquals(2, granulesList.size());
assertFalse(granulesList.isEmpty());
granule = granulesList.get(0);
assertNotNull(granule);
granulesList = manager.getGranules("it.geosolutions", "mosaic", "mosaic", null, null, null);
assertNotNull(granulesList);
assertEquals(4, granulesList.size());
assertFalse(granulesList.isEmpty());
granule = granulesList.get(0);
assertNotNull(granule);
granulesList = manager.getGranules("it.geosolutions", "mosaic", "mosaic", "depth = 100", null, null);
assertNotNull(granulesList);
assertEquals(2, granulesList.size());
assertFalse(granulesList.isEmpty());
granule = granulesList.get(0);
assertNotNull(granule);
granulesList = manager.getGranules("it.geosolutions", "mosaic", "mosaic", "depth = 100 AND date='20081101T0000000'", null, null);
assertNotNull(granulesList);
assertEquals(1, granulesList.size());
assertFalse(granulesList.isEmpty());
granule = granulesList.get(0);
assertNotNull(granule);
// remove by filter
final String fileLocation = "NCOM_wattemp_100_20081101T0000000_12.tiff";
boolean result = manager.removeGranulesByCQL("it.geosolutions", "mosaic", "mosaic", "location = '" + fileLocation + "'");
Assert.assertTrue(result);
granulesList = manager.getGranules("it.geosolutions", "mosaic", "mosaic", null, null, null);
assertNotNull(granulesList);
assertEquals(3, granulesList.size());
assertFalse(granulesList.isEmpty());
granule = granulesList.get(0);
assertNotNull(granule);
// Readding that granule
RESTCoverageStore store = reader.getCoverageStore("it.geosolutions", "mosaic");
final String urlString = store.getURL();
final URL url = new URL(urlString);
final File file = urlToFile(url);
final String filePath = file.getAbsolutePath();
int i=0;
i++;
// use reflection to get the store URL since coveragestore only returns name and workspace
result = manager.createOrHarvestExternal("it.geosolutions", "mosaic", "imagemosaic", filePath + File.separatorChar + fileLocation );
Assert.assertTrue(result);
granulesList = manager.getGranules("it.geosolutions", "mosaic", "mosaic", null, null, null);
assertNotNull(granulesList);
assertEquals(4, granulesList.size());
assertFalse(granulesList.isEmpty());
granule = granulesList.get(0);
assertNotNull(granule);
}
/**
* This method has been copied from org.geotools.data.DataUtilities
*
* Takes a URL and converts it to a File. The attempts to deal with Windows UNC format specific
* problems, specifically files located on network shares and different drives.
*
* If the URL.getAuthority() returns null or is empty, then only the url's path property is used
* to construct the file. Otherwise, the authority is prefixed before the path.
*
* It is assumed that url.getProtocol returns "file".
*
* Authority is the drive or network share the file is located on. Such as "C:", "E:",
* "\\fooServer"
*
* @param url
* a URL object that uses protocol "file"
* @return a File that corresponds to the URL's location
*/
private static File urlToFile(URL url) {
if (!"file".equals(url.getProtocol())) {
return null; // not a File URL
}
String string = url.toExternalForm();
if (string.contains("+")) {
// this represents an invalid URL created using either
// file.toURL(); or
// file.toURI().toURL() on a specific version of Java 5 on Mac
string = string.replace("+", "%2B");
}
try {
string = URLDecoder.decode(string, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("Could not decode the URL to UTF-8 format", e);
}
String path3;
String simplePrefix = "file:/";
String standardPrefix = "file://";
String os = System.getProperty("os.name");
if (os.toUpperCase().contains("WINDOWS") && string.startsWith(standardPrefix)) {
// win32: host/share reference
path3 = string.substring(standardPrefix.length() - 2);
} else if (string.startsWith(standardPrefix)) {
path3 = string.substring(standardPrefix.length());
} else if (string.startsWith(simplePrefix)) {
path3 = string.substring(simplePrefix.length() - 1);
} else {
String auth = url.getAuthority();
String path2 = url.getPath().replace("%20", " ");
if (auth != null && !auth.equals("")) {
path3 = "//" + auth + path2;
} else {
path3 = path2;
}
}
return new File(path3);
}
}

View File

@ -1,136 +0,0 @@
/*
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2002-2011, Open Source Geospatial Foundation (OSGeo)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/
package it.geosolutions.geoserver.rest.manager;
import it.geosolutions.geoserver.rest.datastore.StoreIntegrationTest;
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageGranulesList;
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageGranulesList.RESTStructuredCoverageGranule;
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageIndexSchema;
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageIndexSchema.RESTStructuredCoverageIndexAttribute;
import it.geosolutions.geoserver.rest.encoder.GSAbstractStoreEncoder;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Iterator;
import junit.framework.Assert;
import org.junit.Test;
/**
* @author Simone Giannecchini, simone.giannecchini@geo-solutions.it
*
*/
public class GeoServerRESTStructuredCoverageGridReaderManagerTest extends StoreIntegrationTest {
/**
* @param ignore
* @throws IllegalArgumentException
* @throws MalformedURLException
*/
public GeoServerRESTStructuredCoverageGridReaderManagerTest()
throws IllegalArgumentException, MalformedURLException {
super(true);
}
@Override
public GSAbstractStoreEncoder getStoreEncoderTest() {
// TODO Auto-generated method stub
return null;
}
@Test
public void createAndDelete() throws IllegalArgumentException, MalformedURLException, UnsupportedEncodingException{
GeoServerRESTStructuredCoverageGridReaderManager manager =
new GeoServerRESTStructuredCoverageGridReaderManager(new URL("http://localhost:8080/geoserver"), "admin", "geoserver");
// boolean result=manager.createOrHarvestExternal("it.geosolutions", "polyphemus", "imagemosaic", "D:\\DLR\\Geoserver-MD\\polyphemus\\polyphemus_20130301.nc");
// Assert.assertTrue(result);
// check index format
RESTStructuredCoverageIndexSchema indexFormat = manager.getGranuleIndexSchema("it.geosolutions", "polyphemus","V");
assertNotNull(indexFormat);
assertFalse(indexFormat.isEmpty());
assertEquals(7, indexFormat.size());
Iterator<RESTStructuredCoverageIndexAttribute> iterator = indexFormat.iterator();
while(iterator.hasNext()){
final RESTStructuredCoverageIndexAttribute element = iterator.next();
if(element.getName().equals("location")){
assertEquals("0", element.getMinOccurs());
assertEquals("1", element.getMaxOccurs());
assertEquals("true", element.getNillable());
assertEquals("java.lang.String", element.getBinding());
break;
}
}
// get some granules by id
RESTStructuredCoverageGranulesList granulesList = manager.getGranuleById("it.geosolutions", "polyphemus","V","348");
assertNotNull(granulesList);
assertSame(1, granulesList.size());
assertFalse(granulesList.isEmpty());
RESTStructuredCoverageGranule granule = granulesList.get(0);
assertNotNull(granule);
assertEquals(granule.getAttributeByIndex(4), "1250.0");
assertEquals(granule.getAttributeByName("elevation"), "1250.0");
// get with paging
granulesList = manager.getGranules("it.geosolutions", "polyphemus","V",null,"0","10");
assertNotNull(granulesList);
assertEquals(10, granulesList.size());
assertFalse(granulesList.isEmpty());
granule = granulesList.get(0);
assertNotNull(granule);
granulesList = manager.getGranules("it.geosolutions", "polyphemus","V",null,null,"10");
assertNotNull(granulesList);
assertEquals(10, granulesList.size());
assertFalse(granulesList.isEmpty());
granule = granulesList.get(0);
assertNotNull(granule);
granulesList = manager.getGranules("it.geosolutions", "polyphemus","V",null,null,null);
assertNotNull(granulesList);
assertEquals(1007, granulesList.size());
assertFalse(granulesList.isEmpty());
granule = granulesList.get(0);
assertNotNull(granule);
granulesList = manager.getGranules("it.geosolutions", "polyphemus","V","elevation = 10",null,null);
assertNotNull(granulesList);
assertEquals(72, granulesList.size());
assertFalse(granulesList.isEmpty());
granule = granulesList.get(0);
assertNotNull(granule);
granulesList = manager.getGranules("it.geosolutions", "polyphemus","V","elevation = 10","0","10");
assertNotNull(granulesList);
assertEquals(10, granulesList.size());
assertFalse(granulesList.isEmpty());
granule = granulesList.get(0);
assertNotNull(granule);
// remove by id
boolean result = manager.removeGranuleById("it.geosolutions", "polyphemus","V", "349");
assertTrue(result);
// remove by filter
result = manager.removeGranulesByCQL("it.geosolutions", "polyphemus","V", "location = 'polyphemus_20130301.nc'");
Assert.assertTrue(result);
}
}

Binary file not shown.