Merge 4dac450327 into 205cd75285
This commit is contained in:
commit
c1c17dbce2
@ -39,15 +39,18 @@ import it.geosolutions.geoserver.rest.encoder.GSWorkspaceEncoder;
|
|||||||
import it.geosolutions.geoserver.rest.encoder.coverage.GSCoverageEncoder;
|
import it.geosolutions.geoserver.rest.encoder.coverage.GSCoverageEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.feature.GSFeatureTypeEncoder;
|
import it.geosolutions.geoserver.rest.encoder.feature.GSFeatureTypeEncoder;
|
||||||
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStructuredGridCoverageReaderManager;
|
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStructuredGridCoverageReaderManager;
|
||||||
|
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStructuredGridCoverageReaderManager.ConfigureCoveragesOption;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.zip.ZipFile;
|
||||||
|
|
||||||
import org.apache.commons.httpclient.NameValuePair;
|
import org.apache.commons.httpclient.NameValuePair;
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
@ -2640,12 +2643,12 @@ public class GeoServerRESTPublisher {
|
|||||||
*
|
*
|
||||||
* @return <code>true</code> if the call succeeds or <code>false</code> otherwise.
|
* @return <code>true</code> if the call succeeds or <code>false</code> otherwise.
|
||||||
*/
|
*/
|
||||||
public boolean createOrHarvestExternal(String workspace, String coverageStore, String format,
|
public boolean harvestExternal(String workspace, String coverageStore, String format,
|
||||||
String path) {
|
String path) {
|
||||||
try {
|
try {
|
||||||
GeoServerRESTStructuredGridCoverageReaderManager manager = new GeoServerRESTStructuredGridCoverageReaderManager(
|
GeoServerRESTStructuredGridCoverageReaderManager manager = new GeoServerRESTStructuredGridCoverageReaderManager(
|
||||||
new URL(restURL), gsuser, gspass);
|
new URL(restURL), gsuser, gspass);
|
||||||
return manager.createOrHarvestExternal(workspace, coverageStore, format, path);
|
return manager.harvestExternal(workspace, coverageStore, format, path);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
if (LOGGER.isInfoEnabled()) {
|
if (LOGGER.isInfoEnabled()) {
|
||||||
LOGGER.info(e.getLocalizedMessage(), e);
|
LOGGER.info(e.getLocalizedMessage(), e);
|
||||||
@ -2658,6 +2661,84 @@ public class GeoServerRESTPublisher {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new ImageMosaic with the provided configuration provided as a zip file.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This call configures all the coverages contained in the ImageMosaic.
|
||||||
|
*
|
||||||
|
* @param workspace the GeoServer workspace
|
||||||
|
* @param coverageStore the GeoServer coverageStore
|
||||||
|
* @param the absolute path to the file to upload
|
||||||
|
*
|
||||||
|
* @return <code>true</code> if the call succeeds or <code>false</code> otherwise.
|
||||||
|
* @since geoserver-2.4.0, geoserver-mng-1.6.0
|
||||||
|
*/
|
||||||
|
public boolean createImageMosaic(String workspace, String coverageStore, String path) {
|
||||||
|
return createImageMosaic(workspace, coverageStore, path, ConfigureCoveragesOption.ALL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new ImageMosaic with the provided configuration provided as a zip file.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* With the options configure we can decide whether or not to configure or not the coverages contained in the ImageMosaic.
|
||||||
|
*
|
||||||
|
* @param workspace the GeoServer workspace
|
||||||
|
* @param coverageStore the GeoServer coverageStore
|
||||||
|
* @param the absolute path to the file to upload
|
||||||
|
* @param configureOpt tells GeoServer whether to configure all coverages in this mosaic (ALL) or none of them (NONE).
|
||||||
|
*
|
||||||
|
* @return <code>true</code> if the call succeeds or <code>false</code> otherwise.
|
||||||
|
* @since geoserver-2.4.0, geoserver-mng-1.6.0
|
||||||
|
*/
|
||||||
|
public boolean createImageMosaic(String workspace, String coverageStore, String path, ConfigureCoveragesOption configureOpt) {
|
||||||
|
// checks
|
||||||
|
checkString(workspace);
|
||||||
|
checkString(coverageStore);
|
||||||
|
checkString(path);
|
||||||
|
final File zipFile= new File(path);
|
||||||
|
if(!zipFile.exists()||!zipFile.isFile()||!zipFile.canRead()){
|
||||||
|
throw new IllegalArgumentException("The provided pathname does not point to a valide zip file: "+path);
|
||||||
|
}
|
||||||
|
// is it a zip?
|
||||||
|
ZipFile zip=null;
|
||||||
|
try{
|
||||||
|
zip= new ZipFile(zipFile);
|
||||||
|
zip.getName();
|
||||||
|
}catch (Exception e) {
|
||||||
|
LOGGER.trace(e.getLocalizedMessage(),e.getStackTrace());
|
||||||
|
throw new IllegalArgumentException("The provided pathname does not point to a valide zip file: "+path);
|
||||||
|
}finally{
|
||||||
|
if(zip!=null){
|
||||||
|
try {
|
||||||
|
zip.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
// swallow
|
||||||
|
LOGGER.trace(e.getLocalizedMessage(),e.getStackTrace());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// create URL
|
||||||
|
StringBuilder ss=HTTPUtils.append(restURL, "/rest/workspaces/", workspace, "/coveragestores/",
|
||||||
|
coverageStore, "/", UploadMethod.EXTERNAL.toString(), ".imagemosaic");
|
||||||
|
switch(configureOpt){
|
||||||
|
case ALL:
|
||||||
|
break;
|
||||||
|
case NONE:
|
||||||
|
ss.append("?configure=none");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException("Unrecognized COnfigureOption: "+configureOpt);
|
||||||
|
}
|
||||||
|
String sUrl = ss.toString();
|
||||||
|
|
||||||
|
// POST request
|
||||||
|
String result = HTTPUtils.put(sUrl, zipFile, "application/zip", gsuser, gspass);
|
||||||
|
return result != null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove a granule from a structured coverage by id.
|
* Remove a granule from a structured coverage by id.
|
||||||
*
|
*
|
||||||
@ -2721,4 +2802,22 @@ public class GeoServerRESTPublisher {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check the provided string for not being null or empty.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* It throws an exception in case the string is either null or empty.
|
||||||
|
*
|
||||||
|
* @param string the {@link String} to be checked
|
||||||
|
*/
|
||||||
|
private static void checkString(String string) {
|
||||||
|
if (string == null) {
|
||||||
|
throw new NullPointerException("Provided string is is null!");
|
||||||
|
}
|
||||||
|
if (string.length() <= 0) {
|
||||||
|
throw new IllegalArgumentException("Provided string is is empty!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -227,4 +227,23 @@ public class RESTStructuredCoverageGranulesList implements Iterable<RESTStructur
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
builder.append("RESTStructuredCoverageGranulesList [");
|
||||||
|
if (bbox != null) {
|
||||||
|
builder.append("bbox=");
|
||||||
|
builder.append(bbox);
|
||||||
|
}
|
||||||
|
if (granulesList != null) {
|
||||||
|
builder.append("granulesList={");
|
||||||
|
for(RESTStructuredCoverageGranule granule:granulesList){
|
||||||
|
builder.append(granule);
|
||||||
|
}
|
||||||
|
builder.append("}, ");
|
||||||
|
}
|
||||||
|
builder.append("]");
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,14 +32,20 @@ import java.math.BigDecimal;
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Carlo Cancellieri - carlo.cancellieri@geo-solutions.it
|
* @author Carlo Cancellieri - carlo.cancellieri@geo-solutions.it
|
||||||
|
* @author Simone Giannecchini, GeoSolutions
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class GSDimensionInfoEncoder extends XmlElement{
|
public class GSDimensionInfoEncoder extends XmlElement{
|
||||||
public final static String DIMENSIONINFO="dimensionInfo";
|
public final static String DIMENSIONINFO="dimensionInfo";
|
||||||
|
|
||||||
public final static String RESOLUTION="resolution";
|
public final static String RESOLUTION="resolution";
|
||||||
|
|
||||||
public final static String PRESENTATION="presentation";
|
public final static String PRESENTATION="presentation";
|
||||||
|
|
||||||
|
public final static String UNITS="units";
|
||||||
|
|
||||||
|
public final static String UNIT_SYMBOL="unitSymbol";
|
||||||
|
|
||||||
private boolean enabled;
|
private boolean enabled;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -116,4 +122,36 @@ public class GSDimensionInfoEncoder extends XmlElement{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set UoM for this dimension.
|
||||||
|
*
|
||||||
|
* <code>null</code> is acceptable and leave this UoM blank.
|
||||||
|
*
|
||||||
|
* @param unit UoM for this dimension.
|
||||||
|
*/
|
||||||
|
public void setUnit(final String unit){
|
||||||
|
if(unit==null||unit.length()<=0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (enabled){
|
||||||
|
set(UNITS,unit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set UoM for this dimension.
|
||||||
|
*
|
||||||
|
* <code>null</code> is acceptable and leave this UoM blank.
|
||||||
|
*
|
||||||
|
* @param unit UoM for this dimension.
|
||||||
|
*/
|
||||||
|
public void setUnitSymbol(final String unitSymbol){
|
||||||
|
if(unitSymbol==null||unitSymbol.length()<=0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (enabled){
|
||||||
|
set(UNIT_SYMBOL,unitSymbol);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,10 +29,13 @@ import it.geosolutions.geoserver.rest.HTTPUtils;
|
|||||||
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageGranulesList;
|
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageGranulesList;
|
||||||
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageIndexSchema;
|
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageIndexSchema;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
import java.util.zip.ZipFile;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -45,6 +48,21 @@ import org.slf4j.LoggerFactory;
|
|||||||
*/
|
*/
|
||||||
public class GeoServerRESTStructuredGridCoverageReaderManager extends GeoServerRESTAbstractManager {
|
public class GeoServerRESTStructuredGridCoverageReaderManager extends GeoServerRESTAbstractManager {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Option that tells GeoServer whether or not to configure all the coverages for a certain ImageMosaic.
|
||||||
|
*
|
||||||
|
* @author Simone Giannecchini, GeoSolutions
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public enum ConfigureCoveragesOption{
|
||||||
|
NONE,
|
||||||
|
ALL;
|
||||||
|
|
||||||
|
public static ConfigureCoveragesOption getDefault() {
|
||||||
|
return ALL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default logger
|
* Default logger
|
||||||
*/
|
*/
|
||||||
@ -64,18 +82,96 @@ public class GeoServerRESTStructuredGridCoverageReaderManager extends GeoServerR
|
|||||||
super(restURL, username, password);
|
super(restURL, username, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new ImageMosaic with the provided configuration provided as a zip file.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This call configures all the coverages contained in the ImageMosaic.
|
||||||
|
*
|
||||||
|
* @param workspace the GeoServer workspace
|
||||||
|
* @param coverageStore the GeoServer coverageStore
|
||||||
|
* @param the absolute path to the file to upload
|
||||||
|
*
|
||||||
|
* @return <code>true</code> if the call succeeds or <code>false</code> otherwise.
|
||||||
|
* @since geoserver-2.4.0, geoserver-mng-1.6.0
|
||||||
|
*/
|
||||||
|
public boolean create(String workspace, String coverageStore, String path) {
|
||||||
|
return create(workspace, coverageStore, path, ConfigureCoveragesOption.ALL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new ImageMosaic with the provided configuration provided as a zip file.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* With the options configure we can decide whether or not to configure or not the coverages contained in the ImageMosaic.
|
||||||
|
*
|
||||||
|
* @param workspace the GeoServer workspace
|
||||||
|
* @param coverageStore the GeoServer coverageStore
|
||||||
|
* @param the absolute path to the file to upload
|
||||||
|
* @param configureOpt tells GeoServer whether to configure all coverages in this mosaic (ALL) or none of them (NONE).
|
||||||
|
*
|
||||||
|
* @return <code>true</code> if the call succeeds or <code>false</code> otherwise.
|
||||||
|
* @since geoserver-2.4.0, geoserver-mng-1.6.0
|
||||||
|
*/
|
||||||
|
public boolean create(String workspace, String coverageStore, String path, ConfigureCoveragesOption configureOpt) {
|
||||||
|
// checks
|
||||||
|
checkString(workspace);
|
||||||
|
checkString(coverageStore);
|
||||||
|
checkString(path);
|
||||||
|
final File zipFile= new File(path);
|
||||||
|
if(!zipFile.exists()||!zipFile.isFile()||!zipFile.canRead()){
|
||||||
|
throw new IllegalArgumentException("The provided pathname does not point to a valide zip file: "+path);
|
||||||
|
}
|
||||||
|
// is it a zip?
|
||||||
|
ZipFile zip=null;
|
||||||
|
try{
|
||||||
|
zip= new ZipFile(zipFile);
|
||||||
|
zip.getName();
|
||||||
|
}catch (Exception e) {
|
||||||
|
LOGGER.trace(e.getLocalizedMessage(),e.getStackTrace());
|
||||||
|
throw new IllegalArgumentException("The provided pathname does not point to a valide zip file: "+path);
|
||||||
|
}finally{
|
||||||
|
if(zip!=null){
|
||||||
|
try {
|
||||||
|
zip.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
// swallow
|
||||||
|
LOGGER.trace(e.getLocalizedMessage(),e.getStackTrace());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// create URL
|
||||||
|
StringBuilder ss=HTTPUtils.append(restURL, "/rest/workspaces/", workspace, "/coveragestores/",
|
||||||
|
coverageStore, "/file.imagemosaic");
|
||||||
|
switch(configureOpt){
|
||||||
|
case ALL:
|
||||||
|
break;
|
||||||
|
case NONE:
|
||||||
|
ss.append("?configure=none");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException("Unrecognized COnfigureOption: "+configureOpt);
|
||||||
|
}
|
||||||
|
String sUrl = ss.toString();
|
||||||
|
|
||||||
|
// POST request
|
||||||
|
String result = HTTPUtils.put(sUrl, zipFile, "application/zip", gsuser, gspass);
|
||||||
|
return result != null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a store or harvest the coverage from the provided <b>external</b> path.
|
* Create a store or harvest the coverage from the provided <b>external</b> path.
|
||||||
*
|
*
|
||||||
* @param workspace the GeoServer workspace
|
* @param workspace the GeoServer workspace
|
||||||
* @param coverageStore the GeoServer coverageStore
|
* @param coverageStore the GeoServer coverageStore
|
||||||
* @param format the format of the file to upload
|
* @param format the format of the file to upload
|
||||||
* @param the absolut path to the file to upload
|
* @param the absolute path to the file to upload
|
||||||
*
|
*
|
||||||
* @return <code>true</code> if the call succeeds or <code>false</code> otherwise.
|
* @return <code>true</code> if the call succeeds or <code>false</code> otherwise.
|
||||||
* @since geoserver-2.4.0, geoserver-mng-1.6.0
|
* @since geoserver-2.4.0, geoserver-mng-1.6.0
|
||||||
*/
|
*/
|
||||||
public boolean createOrHarvestExternal(String workspace, String coverageStore, String format,
|
public boolean harvestExternal(String workspace, String coverageStore, String format,
|
||||||
String path) {
|
String path) {
|
||||||
// checks
|
// checks
|
||||||
checkString(workspace);
|
checkString(workspace);
|
||||||
|
|||||||
@ -24,7 +24,6 @@ package it.geosolutions.geoserver.decoder;
|
|||||||
import it.geosolutions.geoserver.rest.decoder.RESTCoverage;
|
import it.geosolutions.geoserver.rest.decoder.RESTCoverage;
|
||||||
import it.geosolutions.geoserver.rest.decoder.RESTDimensionInfo;
|
import it.geosolutions.geoserver.rest.decoder.RESTDimensionInfo;
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadatalink.GSMetadataLinkInfoEncoder;
|
import it.geosolutions.geoserver.rest.encoder.metadatalink.GSMetadataLinkInfoEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadatalink.ResourceMetadataLinkInfo;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|||||||
@ -24,12 +24,11 @@
|
|||||||
*/
|
*/
|
||||||
package it.geosolutions.geoserver.rest.datastore;
|
package it.geosolutions.geoserver.rest.datastore;
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
|
|
||||||
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
||||||
import it.geosolutions.geoserver.rest.encoder.GSAbstractStoreEncoder;
|
import it.geosolutions.geoserver.rest.encoder.GSAbstractStoreEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.datastore.GSArcSDEDatastoreEncoder;
|
import it.geosolutions.geoserver.rest.encoder.datastore.GSArcSDEDatastoreEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.datastore.GSOracleNGDatastoreEncoder;
|
|
||||||
|
import java.net.MalformedURLException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Testcase for creating arcsde-based resources on geoserver.
|
* Testcase for creating arcsde-based resources on geoserver.
|
||||||
|
|||||||
@ -24,16 +24,11 @@
|
|||||||
*/
|
*/
|
||||||
package it.geosolutions.geoserver.rest.datastore;
|
package it.geosolutions.geoserver.rest.datastore;
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
|
|
||||||
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
||||||
import it.geosolutions.geoserver.rest.decoder.RESTDataStore;
|
|
||||||
import it.geosolutions.geoserver.rest.encoder.GSAbstractStoreEncoder;
|
import it.geosolutions.geoserver.rest.encoder.GSAbstractStoreEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.datastore.GSOracleNGDatastoreEncoder;
|
import it.geosolutions.geoserver.rest.encoder.datastore.GSOracleNGDatastoreEncoder;
|
||||||
|
|
||||||
import org.junit.Test;
|
import java.net.MalformedURLException;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Testcase for creating OracleNG-based resources on geoserver.
|
* Testcase for creating OracleNG-based resources on geoserver.
|
||||||
|
|||||||
@ -24,18 +24,16 @@
|
|||||||
*/
|
*/
|
||||||
package it.geosolutions.geoserver.rest.datastore;
|
package it.geosolutions.geoserver.rest.datastore;
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
|
|
||||||
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
||||||
import it.geosolutions.geoserver.rest.decoder.RESTDataStore;
|
import it.geosolutions.geoserver.rest.decoder.RESTDataStore;
|
||||||
import it.geosolutions.geoserver.rest.encoder.GSAbstractStoreEncoder;
|
import it.geosolutions.geoserver.rest.encoder.GSAbstractStoreEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.GSLayerEncoder;
|
import it.geosolutions.geoserver.rest.encoder.GSLayerEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.datastore.GSAbstractDatastoreEncoder;
|
|
||||||
import it.geosolutions.geoserver.rest.encoder.datastore.GSOracleNGDatastoreEncoder;
|
import it.geosolutions.geoserver.rest.encoder.datastore.GSOracleNGDatastoreEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.feature.GSFeatureTypeEncoder;
|
import it.geosolutions.geoserver.rest.encoder.feature.GSFeatureTypeEncoder;
|
||||||
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStoreManager;
|
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStoreManager;
|
||||||
|
|
||||||
import org.junit.Before;
|
import java.net.MalformedURLException;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -56,14 +54,14 @@ import org.slf4j.LoggerFactory;
|
|||||||
*/
|
*/
|
||||||
public abstract class StoreIntegrationTest extends GeoserverRESTTest {
|
public abstract class StoreIntegrationTest extends GeoserverRESTTest {
|
||||||
|
|
||||||
private final static Logger LOGGER = LoggerFactory.getLogger(StoreIntegrationTest.class);
|
protected final GeoServerRESTStoreManager storeManager;
|
||||||
|
|
||||||
private final GeoServerRESTStoreManager storeManager;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ignore integration tests
|
* ignore integration tests
|
||||||
*/
|
*/
|
||||||
private final boolean ignore;
|
protected final boolean ignore;
|
||||||
|
|
||||||
|
private final static Logger LOGGER = LoggerFactory.getLogger(StoreIntegrationTest.class);
|
||||||
|
|
||||||
public boolean isIgnore() {
|
public boolean isIgnore() {
|
||||||
return ignore;
|
return ignore;
|
||||||
|
|||||||
@ -24,8 +24,11 @@
|
|||||||
*/
|
*/
|
||||||
package it.geosolutions.geoserver.rest.encoder;
|
package it.geosolutions.geoserver.rest.encoder;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
package it.geosolutions.geoserver.rest.encoder.feature;
|
package it.geosolutions.geoserver.rest.encoder.feature;
|
||||||
|
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadata.GSDimensionInfoEncoder;
|
import it.geosolutions.geoserver.rest.encoder.metadata.GSDimensionInfoEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadata.GSFeatureDimensionInfoEncoder;
|
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadata.GSDimensionInfoEncoder.Presentation;
|
import it.geosolutions.geoserver.rest.encoder.metadata.GSDimensionInfoEncoder.Presentation;
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadata.GSDimensionInfoEncoder.PresentationDiscrete;
|
import it.geosolutions.geoserver.rest.encoder.metadata.GSDimensionInfoEncoder.PresentationDiscrete;
|
||||||
|
import it.geosolutions.geoserver.rest.encoder.metadata.GSFeatureDimensionInfoEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.utils.ElementUtils;
|
import it.geosolutions.geoserver.rest.encoder.utils.ElementUtils;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|||||||
@ -27,10 +27,10 @@ import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder;
|
|||||||
import it.geosolutions.geoserver.rest.encoder.metadata.GSDimensionInfoEncoder;
|
import it.geosolutions.geoserver.rest.encoder.metadata.GSDimensionInfoEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadata.GSDimensionInfoEncoder.Presentation;
|
import it.geosolutions.geoserver.rest.encoder.metadata.GSDimensionInfoEncoder.Presentation;
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadata.GSDimensionInfoEncoder.PresentationDiscrete;
|
import it.geosolutions.geoserver.rest.encoder.metadata.GSDimensionInfoEncoder.PresentationDiscrete;
|
||||||
|
import it.geosolutions.geoserver.rest.encoder.metadata.GSFeatureDimensionInfoEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadata.virtualtable.GSVirtualTableEncoder;
|
import it.geosolutions.geoserver.rest.encoder.metadata.virtualtable.GSVirtualTableEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadata.virtualtable.VTGeometryEncoder;
|
import it.geosolutions.geoserver.rest.encoder.metadata.virtualtable.VTGeometryEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadata.virtualtable.VTParameterEncoder;
|
import it.geosolutions.geoserver.rest.encoder.metadata.virtualtable.VTParameterEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadata.GSFeatureDimensionInfoEncoder;
|
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadatalink.GSMetadataLinkInfoEncoder;
|
import it.geosolutions.geoserver.rest.encoder.metadatalink.GSMetadataLinkInfoEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.utils.ElementUtils;
|
import it.geosolutions.geoserver.rest.encoder.utils.ElementUtils;
|
||||||
import it.geosolutions.geoserver.rest.publisher.GeoserverRESTPublisherTest;
|
import it.geosolutions.geoserver.rest.publisher.GeoserverRESTPublisherTest;
|
||||||
|
|||||||
@ -1,14 +1,10 @@
|
|||||||
package it.geosolutions.geoserver.rest.encoder.feature;
|
package it.geosolutions.geoserver.rest.encoder.feature;
|
||||||
|
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadata.virtualtable.GSVirtualTableEncoder;
|
import it.geosolutions.geoserver.rest.encoder.metadata.virtualtable.GSVirtualTableEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadata.virtualtable.VTGeometryEncoder;
|
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadata.virtualtable.VTParameterEncoder;
|
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadata.virtualtable.VTGeometry;
|
import it.geosolutions.geoserver.rest.encoder.metadata.virtualtable.VTGeometry;
|
||||||
|
import it.geosolutions.geoserver.rest.encoder.metadata.virtualtable.VTGeometryEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.metadata.virtualtable.VTParameter;
|
import it.geosolutions.geoserver.rest.encoder.metadata.virtualtable.VTParameter;
|
||||||
import it.geosolutions.geoserver.rest.encoder.utils.XmlElement;
|
import it.geosolutions.geoserver.rest.encoder.metadata.virtualtable.VTParameterEncoder;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
import junit.framework.Assert;
|
import junit.framework.Assert;
|
||||||
|
|
||||||
import org.jdom.Element;
|
import org.jdom.Element;
|
||||||
|
|||||||
@ -16,26 +16,26 @@
|
|||||||
*/
|
*/
|
||||||
package it.geosolutions.geoserver.rest.manager;
|
package it.geosolutions.geoserver.rest.manager;
|
||||||
|
|
||||||
import it.geosolutions.geoserver.rest.GeoServerRESTReader;
|
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
||||||
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;
|
||||||
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageGranulesList.RESTStructuredCoverageGranule;
|
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageGranulesList.RESTStructuredCoverageGranule;
|
||||||
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageIndexSchema;
|
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageIndexSchema;
|
||||||
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageIndexSchema.RESTStructuredCoverageIndexAttribute;
|
import it.geosolutions.geoserver.rest.decoder.RESTStructuredCoverageIndexSchema.RESTStructuredCoverageIndexAttribute;
|
||||||
import it.geosolutions.geoserver.rest.encoder.GSAbstractStoreEncoder;
|
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy;
|
||||||
|
import it.geosolutions.geoserver.rest.encoder.coverage.GSImageMosaicEncoder;
|
||||||
|
import it.geosolutions.geoserver.rest.encoder.metadata.GSDimensionInfoEncoder;
|
||||||
|
import it.geosolutions.geoserver.rest.encoder.metadata.GSDimensionInfoEncoder.Presentation;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLDecoder;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.core.io.ClassPathResource;
|
||||||
|
|
||||||
|
import sun.management.counter.Units;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In order to test that class, make sure to configure a geoserver with a "mosaic" store.
|
* In order to test that class, make sure to configure a geoserver with a "mosaic" store.
|
||||||
@ -52,42 +52,30 @@ import org.slf4j.LoggerFactory;
|
|||||||
* @author Daniele Romagnoli, GeoSolutions SAS
|
* @author Daniele Romagnoli, GeoSolutions SAS
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class GeoServerRESTImageMosaicManagerTest extends StoreIntegrationTest {
|
public class GeoServerRESTImageMosaicManagerTest extends GeoserverRESTTest {
|
||||||
|
|
||||||
private final static Logger LOGGER = LoggerFactory.getLogger(GeoServerRESTImageMosaicManagerTest.class);
|
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
|
@Test
|
||||||
public void createAndDelete() throws IllegalArgumentException, MalformedURLException, UnsupportedEncodingException{
|
public void createAndDelete() throws Exception{
|
||||||
if (!enabled()) {
|
if (!enabled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GeoServerRESTStructuredGridCoverageReaderManager manager =
|
GeoServerRESTStructuredGridCoverageReaderManager manager =
|
||||||
new GeoServerRESTStructuredGridCoverageReaderManager(new URL(RESTURL), RESTUSER, RESTPW);
|
new GeoServerRESTStructuredGridCoverageReaderManager(new URL(RESTURL), RESTUSER, RESTPW);
|
||||||
GeoServerRESTReader reader = new GeoServerRESTReader(new URL(RESTURL), RESTUSER, RESTPW);
|
|
||||||
|
// create mosaic
|
||||||
|
boolean create=manager.create("it.geosolutions", "mosaic",new ClassPathResource("testdata/granules/mosaic.zip").getFile().getAbsolutePath());
|
||||||
|
assertTrue(create);
|
||||||
|
|
||||||
|
// enable dimension
|
||||||
|
fixDimensions("it.geosolutions", "mosaic", "mosaic");
|
||||||
|
|
||||||
// check index format
|
// check index format
|
||||||
RESTStructuredCoverageIndexSchema indexFormat = manager.getGranuleIndexSchema("it.geosolutions", "mosaic","mosaic");
|
RESTStructuredCoverageIndexSchema indexFormat = manager.getGranuleIndexSchema("it.geosolutions", "mosaic","mosaic");
|
||||||
if (indexFormat == null) {
|
assertTrue(create);
|
||||||
if (LOGGER.isWarnEnabled()) {
|
|
||||||
LOGGER.warn("sample coverage hasn't been found. Make sure to configure the layer before running this test");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
assertNotNull(indexFormat);
|
assertNotNull(indexFormat);
|
||||||
assertFalse(indexFormat.isEmpty());
|
assertFalse(indexFormat.isEmpty());
|
||||||
assertEquals(5, indexFormat.size());
|
assertEquals(5, indexFormat.size());
|
||||||
@ -104,7 +92,7 @@ public class GeoServerRESTImageMosaicManagerTest extends StoreIntegrationTest {
|
|||||||
assertEquals("0", element.getMinOccurs());
|
assertEquals("0", element.getMinOccurs());
|
||||||
assertEquals("1", element.getMaxOccurs());
|
assertEquals("1", element.getMaxOccurs());
|
||||||
assertEquals("true", element.getNillable());
|
assertEquals("true", element.getNillable());
|
||||||
assertEquals("java.sql.Timestamp", element.getBinding());
|
assertEquals("java.util.Date", element.getBinding());
|
||||||
} else if (elementName.equals("date")) {
|
} else if (elementName.equals("date")) {
|
||||||
assertEquals("0", element.getMinOccurs());
|
assertEquals("0", element.getMinOccurs());
|
||||||
assertEquals("1", element.getMaxOccurs());
|
assertEquals("1", element.getMaxOccurs());
|
||||||
@ -180,14 +168,8 @@ public class GeoServerRESTImageMosaicManagerTest extends StoreIntegrationTest {
|
|||||||
assertNotNull(granule);
|
assertNotNull(granule);
|
||||||
|
|
||||||
// Readding that 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();
|
|
||||||
|
|
||||||
// use reflection to get the store URL since coveragestore only returns name and workspace
|
// 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 );
|
result = manager.harvestExternal("it.geosolutions", "mosaic", "imagemosaic", new ClassPathResource("testdata/granules/NCOM_wattemp_100_20081101T0000000_12.tiff").getFile().getAbsolutePath() );
|
||||||
Assert.assertTrue(result);
|
Assert.assertTrue(result);
|
||||||
|
|
||||||
granulesList = manager.getGranules("it.geosolutions", "mosaic", "mosaic", null, null, null);
|
granulesList = manager.getGranules("it.geosolutions", "mosaic", "mosaic", null, null, null);
|
||||||
@ -201,64 +183,57 @@ public class GeoServerRESTImageMosaicManagerTest extends StoreIntegrationTest {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method has been copied from org.geotools.data.DataUtilities
|
* This method enables the various dimensions for the coverage autocreated for this test.
|
||||||
*
|
*
|
||||||
* Takes a URL and converts it to a File. The attempts to deal with Windows UNC format specific
|
* @param wsName the workspace
|
||||||
* problems, specifically files located on network shares and different drives.
|
* @param coverageStoreName the coverage store name
|
||||||
*
|
* @param csname the coverage name
|
||||||
* 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) {
|
private void fixDimensions(String wsName, String coverageStoreName, String csname) {
|
||||||
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;
|
final GSImageMosaicEncoder coverageEncoder = new GSImageMosaicEncoder();
|
||||||
|
/*
|
||||||
|
* unused in mosaic creation
|
||||||
|
* this is only useful if you want to modify an existing coverage:
|
||||||
|
* publisher.configureCoverage(ce, wsname, csname);
|
||||||
|
* or create a new one from an existing store:
|
||||||
|
* publisher.createCoverage(ce, wsname, csname);
|
||||||
|
*/
|
||||||
|
coverageEncoder.setName("mosaic");
|
||||||
|
|
||||||
String simplePrefix = "file:/";
|
coverageEncoder.setAllowMultithreading(true);
|
||||||
String standardPrefix = "file://";
|
coverageEncoder.setBackgroundValues("");
|
||||||
String os = System.getProperty("os.name");
|
coverageEncoder.setFilter("");
|
||||||
|
coverageEncoder.setInputTransparentColor("");
|
||||||
|
coverageEncoder.setLatLonBoundingBox(-180, -90, 180, 90, "EPSG:4326");
|
||||||
|
coverageEncoder.setMaxAllowedTiles(11);
|
||||||
|
coverageEncoder.setNativeBoundingBox(-180, -90, 180, 90, "EPSG:4326");
|
||||||
|
coverageEncoder.setProjectionPolicy(ProjectionPolicy.NONE);
|
||||||
|
coverageEncoder.setSRS("EPSG:4326");
|
||||||
|
|
||||||
if (os.toUpperCase().contains("WINDOWS") && string.startsWith(standardPrefix)) {
|
// activate time
|
||||||
// win32: host/share reference
|
final GSDimensionInfoEncoder time=new GSDimensionInfoEncoder(true);
|
||||||
path3 = string.substring(standardPrefix.length() - 2);
|
time.setUnit("Seconds");
|
||||||
} else if (string.startsWith(standardPrefix)) {
|
time.setUnitSymbol("s");
|
||||||
path3 = string.substring(standardPrefix.length());
|
time.setPresentation(Presentation.LIST);
|
||||||
} else if (string.startsWith(simplePrefix)) {
|
coverageEncoder.setMetadataDimension("time", time);
|
||||||
path3 = string.substring(simplePrefix.length() - 1);
|
|
||||||
} else {
|
// activate date
|
||||||
String auth = url.getAuthority();
|
final GSDimensionInfoEncoder date=new GSDimensionInfoEncoder(true);
|
||||||
String path2 = url.getPath().replace("%20", " ");
|
date.setPresentation(Presentation.LIST);
|
||||||
if (auth != null && !auth.equals("")) {
|
coverageEncoder.setMetadataDimension("custom_dimension_DATE", date);
|
||||||
path3 = "//" + auth + path2;
|
|
||||||
} else {
|
// activate depth
|
||||||
path3 = path2;
|
final GSDimensionInfoEncoder depth=new GSDimensionInfoEncoder(true);
|
||||||
}
|
depth.setPresentation(Presentation.LIST);
|
||||||
}
|
depth.setUnit("Meters");
|
||||||
|
depth.setUnitSymbol("m");
|
||||||
|
coverageEncoder.setMetadataDimension("custom_dimension_DEPTH", depth);
|
||||||
|
|
||||||
|
|
||||||
|
boolean config=publisher.configureCoverage(coverageEncoder, wsName, csname);
|
||||||
|
assertTrue(config);
|
||||||
|
|
||||||
return new File(path3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,8 +25,8 @@
|
|||||||
|
|
||||||
package it.geosolutions.geoserver.rest.publisher;
|
package it.geosolutions.geoserver.rest.publisher;
|
||||||
|
|
||||||
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
|
||||||
import it.geosolutions.geoserver.rest.GeoServerRESTPublisher.StoreType;
|
import it.geosolutions.geoserver.rest.GeoServerRESTPublisher.StoreType;
|
||||||
|
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
||||||
import it.geosolutions.geoserver.rest.decoder.RESTCoverageStore;
|
import it.geosolutions.geoserver.rest.decoder.RESTCoverageStore;
|
||||||
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy;
|
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy;
|
||||||
|
|
||||||
@ -34,8 +34,6 @@ import java.io.File;
|
|||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.junit.BeforeClass;
|
|
||||||
import org.junit.Ignore;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|||||||
@ -24,13 +24,13 @@
|
|||||||
*/
|
*/
|
||||||
package it.geosolutions.geoserver.rest.publisher;
|
package it.geosolutions.geoserver.rest.publisher;
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
||||||
import it.geosolutions.geoserver.rest.decoder.RESTNamespace;
|
import it.geosolutions.geoserver.rest.decoder.RESTNamespace;
|
||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Testcase for namespace management.
|
* Testcase for namespace management.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -30,13 +30,9 @@ import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
|||||||
import it.geosolutions.geoserver.rest.datastore.StoreIntegrationTest;
|
import it.geosolutions.geoserver.rest.datastore.StoreIntegrationTest;
|
||||||
import it.geosolutions.geoserver.rest.encoder.GSAbstractStoreEncoder;
|
import it.geosolutions.geoserver.rest.encoder.GSAbstractStoreEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.datastore.GSPostGISDatastoreEncoder;
|
import it.geosolutions.geoserver.rest.encoder.datastore.GSPostGISDatastoreEncoder;
|
||||||
import it.geosolutions.geoserver.rest.manager.GeoServerRESTStoreManager;
|
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Testcase for creating postgis-based resources on geoserver.
|
* Testcase for creating postgis-based resources on geoserver.
|
||||||
* <P>
|
* <P>
|
||||||
|
|||||||
@ -31,7 +31,6 @@ import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
|||||||
import it.geosolutions.geoserver.rest.decoder.RESTLayer;
|
import it.geosolutions.geoserver.rest.decoder.RESTLayer;
|
||||||
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy;
|
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy;
|
||||||
import it.geosolutions.geoserver.rest.encoder.coverage.GSCoverageEncoderTest;
|
import it.geosolutions.geoserver.rest.encoder.coverage.GSCoverageEncoderTest;
|
||||||
import it.geosolutions.geoserver.rest.encoder.feature.GSFeatureEncoderTest;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
@ -39,8 +38,6 @@ import java.io.IOException;
|
|||||||
|
|
||||||
import org.apache.commons.httpclient.NameValuePair;
|
import org.apache.commons.httpclient.NameValuePair;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.AfterClass;
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|||||||
BIN
src/test/resources/testdata/granules/NCOM_wattemp_100_20081101T0000000_12.tiff
vendored
Normal file
BIN
src/test/resources/testdata/granules/NCOM_wattemp_100_20081101T0000000_12.tiff
vendored
Normal file
Binary file not shown.
BIN
src/test/resources/testdata/granules/mosaic.zip
vendored
BIN
src/test/resources/testdata/granules/mosaic.zip
vendored
Binary file not shown.
@ -1 +0,0 @@
|
|||||||
regex=[a-z]{5,5}
|
|
||||||
Loading…
Reference in New Issue
Block a user