switch to slf4j to close #12

This commit is contained in:
ccancellieri 2012-04-19 13:21:11 +02:00
parent c9a81141cb
commit 0432534518
21 changed files with 373 additions and 344 deletions

486
pom.xml
View File

@ -1,265 +1,279 @@
<!-- <!-- * GeoServer-Manager - Simple Manager Library for GeoServer * * Copyright
* GeoServer-Manager - Simple Manager Library for GeoServer (C) 2007,2011 GeoSolutions S.A.S. * http://www.geo-solutions.it * * Permission
* is hereby granted, free of charge, to any person obtaining a copy * of this
* Copyright (C) 2007,2011 GeoSolutions S.A.S. software and associated documentation files (the "Software"), to deal * in
* http://www.geo-solutions.it the Software without restriction, including without limitation the rights
* * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* Permission is hereby granted, free of charge, to any person obtaining a copy * copies of the Software, and to permit persons to whom the Software is *
* of this software and associated documentation files (the "Software"), to deal furnished to do so, subject to the following conditions: * * The above copyright
* in the Software without restriction, including without limitation the rights notice and this permission notice shall be included in * all copies or substantial
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY
* copies of the Software, and to permit persons to whom the Software is OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* furnished to do so, subject to the following conditions: OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* The above copyright notice and this permission notice shall be included in DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* all copies or substantial portions of the Software. ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN * THE SOFTWARE. -->
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<modelVersion>4.0.0</modelVersion> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>it.geosolutions</groupId> <groupId>it.geosolutions</groupId>
<artifactId>geoserver-manager</artifactId> <artifactId>geoserver-manager</artifactId>
<version>1.4.1-SNAPSHOT</version> <version>1.4.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>GeoServer 2 Manager - REST based</name> <name>GeoServer 2 Manager - REST based</name>
<description> <description>
GeoServer Manager is a library to interact with GeoServer 2.x. GeoServer Manager is a library to interact with GeoServer 2.x.
The scope of this library is to have a simple API, and use as few external The scope of this library is to have a simple API, and use as few external
libs as possible. libs as possible.
</description> </description>
<inceptionYear>2007</inceptionYear> <inceptionYear>2007</inceptionYear>
<organization> <organization>
<name>GeoSolutions</name> <name>GeoSolutions</name>
<url>http://www.geo-solutions.it</url> <url>http://www.geo-solutions.it</url>
</organization> </organization>
<developers> <developers>
<developer> <developer>
<id>etj</id> <id>etj</id>
<name>Emanuele Tajariol</name> <name>Emanuele Tajariol</name>
<email>etj AT geosolutions.it</email> <email>etj AT geosolutions.it</email>
<organization>GeoSolutions</organization> <organization>GeoSolutions</organization>
<organizationUrl>http://www.geo-solutions.it</organizationUrl> <organizationUrl>http://www.geo-solutions.it</organizationUrl>
<roles> <roles>
<role>architect</role> <role>architect</role>
<role>developer</role> <role>developer</role>
</roles> </roles>
<timezone>+1</timezone> <timezone>+1</timezone>
</developer> </developer>
<developer> <developer>
<id>ccancellieri</id> <id>ccancellieri</id>
<name>Carlo Cancellieri</name> <name>Carlo Cancellieri</name>
<email>carlo.cancellieri AT geosolutions.it</email> <email>carlo.cancellieri AT geosolutions.it</email>
<organization>GeoSolutions</organization> <organization>GeoSolutions</organization>
<organizationUrl>http://www.geo-solutions.it</organizationUrl> <organizationUrl>http://www.geo-solutions.it</organizationUrl>
<roles> <roles>
<role>architect</role> <role>architect</role>
<role>developer</role> <role>developer</role>
</roles> </roles>
<timezone>+1</timezone> <timezone>+1</timezone>
</developer> </developer>
</developers> </developers>
<licenses>
<license>
<name>MIT License</name>
<url>http://opensource.org/licenses/mit-license.php</url>
<distribution>repo</distribution>
</license>
</licenses>
<url>http://code.google.com/p/geoserver-manager/</url>
<issueManagement>
<system>googlecode</system>
<url>http://code.google.com/p/geoserver-manager/issues/list</url>
</issueManagement>
<mailingLists>
<mailingList>
<name>GeoServer Manager User List</name>
<post>geoserver-manager-users@googlegroups.com </post>
<archive>http://groups.google.com/group/geoserver-manager-users/topics</archive>
</mailingList>
</mailingLists>
<scm> <licenses>
<connection>scm:git:[fetch=]https://github.com/geosolutions-it/geoserver-manager.git[push=]git@github.com:geosolutions-it/geoserver-manager.git</connection> <license>
<!--developerConnection>scm:git</developerConnection--> <name>MIT License</name>
<!--tag>master</tag--> <url>http://opensource.org/licenses/mit-license.php</url>
<url>https://github.com/geosolutions-it/geoserver-manager</url> <distribution>repo</distribution>
</scm> </license>
</licenses>
<ciManagement> <url>http://code.google.com/p/geoserver-manager/</url>
<system>jenkins</system>
<url>http://ci.geo-solutions.it/</url> <issueManagement>
</ciManagement> <system>googlecode</system>
<url>http://code.google.com/p/geoserver-manager/issues/list</url>
<distributionManagement> </issueManagement>
<downloadUrl>http://maven.geo-solutions.it</downloadUrl>
<repository> <mailingLists>
<uniqueVersion>false</uniqueVersion> <mailingList>
<id>geosolutions</id> <name>GeoServer Manager User List</name>
<url>ftp://maven.geo-solutions.it/</url> <post>geoserver-manager-users@googlegroups.com </post>
</repository> <archive>http://groups.google.com/group/geoserver-manager-users/topics</archive>
<site> </mailingList>
<id>demo.geosolutions</id> </mailingLists>
<url>scp://demo.geo-solutions.it/var/www/share/javadoc/gsman</url>
</site> <scm>
</distributionManagement> <connection>scm:git:[fetch=]https://github.com/geosolutions-it/geoserver-manager.git[push=]git@github.com:geosolutions-it/geoserver-manager.git</connection>
<!--developerConnection>scm:git</developerConnection -->
<!--tag>master</tag -->
<url>https://github.com/geosolutions-it/geoserver-manager</url>
</scm>
<ciManagement>
<system>jenkins</system>
<url>http://ci.geo-solutions.it/</url>
</ciManagement>
<distributionManagement>
<downloadUrl>http://maven.geo-solutions.it</downloadUrl>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>geosolutions</id>
<url>ftp://maven.geo-solutions.it/</url>
</repository>
<site>
<id>demo.geosolutions</id>
<url>scp://demo.geo-solutions.it/var/www/share/javadoc/gsman</url>
</site>
</distributionManagement>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version> <version>2.0.2</version>
<configuration> <configuration>
<source>1.6</source> <source>1.6</source>
<target>1.6</target> <target>1.6</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>2.7</version> <version>2.7</version>
<configuration> <configuration>
<detectLinks /> <detectLinks />
<!-- <links> <!-- <links> <link>http://commons.apache.org/dbcp/apidocs/</link> <link>http://commons.apache.org/fileupload/apidocs/</link>
<link>http://commons.apache.org/dbcp/apidocs/</link> <link>http://download.oracle.com/javase/6/docs/api</link> </links> -->
<link>http://commons.apache.org/fileupload/apidocs/</link> </configuration>
<link>http://download.oracle.com/javase/6/docs/api</link> </plugin>
</links>-->
</configuration>
</plugin>
<!-- ======================================================= --> <!-- ======================================================= -->
<!-- Source packaging. --> <!-- Source packaging. -->
<!-- ======================================================= --> <!-- ======================================================= -->
<plugin> <plugin>
<inherited>true</inherited> <inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId> <artifactId>maven-source-plugin</artifactId>
<configuration> <configuration>
<attach>true</attach> <attach>true</attach>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<!-- versioning --> <!-- versioning -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId> <artifactId>maven-release-plugin</artifactId>
<version>2.2.2</version> <version>2.2.2</version>
<configuration> <configuration>
<tagNameFormat>v@{project.version}</tagNameFormat> <tagNameFormat>v@{project.version}</tagNameFormat>
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
<!-- ======================================================== --> <!-- ======================================================== -->
<!-- Extensions settings for Deployment --> <!-- Extensions settings for Deployment -->
<!-- ======================================================== --> <!-- ======================================================== -->
<extensions> <extensions>
<!--.............................................--> <!--............................................. -->
<!-- geo-solutions (using wagon ftp) --> <!-- geo-solutions (using wagon ftp) -->
<!--.............................................--> <!--............................................. -->
<extension> <extension>
<groupId>org.apache.maven.wagon</groupId> <groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId> <artifactId>wagon-ftp</artifactId>
<version>1.0-beta-7</version> <version>1.0-beta-7</version>
</extension> </extension>
</extensions> </extensions>
</build> </build>
<reporting> <reporting>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<configuration> <configuration>
<links> <links>
<link>http://commons.apache.org/lang/api</link> <link>http://commons.apache.org/lang/api</link>
<link>http://java.sun.com/j2se/1.5.0/docs/api</link> <link>http://java.sun.com/j2se/1.5.0/docs/api</link>
<link>http://www.jdom.org/docs/apidocs</link> <link>http://www.jdom.org/docs/apidocs</link>
</links> </links>
</configuration> </configuration>
</plugin> </plugin>
<!-- <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.2</version>
</plugin>-->
</plugins>
</reporting>
<dependencies> <!-- <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId>
<version>2.2</version> </plugin> -->
</plugins>
</reporting>
<dependency> <properties>
<groupId>commons-io</groupId> <slf4j.version>1.5.11</slf4j.version>
<artifactId>commons-io</artifactId> </properties>
<version>2.0.1</version>
</dependency>
<dependency> <dependencies>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>1.1</version>
</dependency>
<dependency> <dependency>
<groupId>log4j</groupId> <groupId>commons-io</groupId>
<artifactId>log4j</artifactId> <artifactId>commons-io</artifactId>
<version>1.2.16</version> <version>2.0.1</version>
</dependency> </dependency>
<!--=================================================================--> <dependency>
<!-- TEST --> <groupId>commons-httpclient</groupId>
<!--=================================================================--> <artifactId>commons-httpclient</artifactId>
<version>3.1</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>org.jdom</groupId>
<artifactId>junit</artifactId> <artifactId>jdom</artifactId>
<version>4.8.2</version> <version>1.1</version>
<scope>test</scope> </dependency>
</dependency>
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.slf4j</groupId>
<artifactId>spring-core</artifactId> <artifactId>slf4j-api</artifactId>
<version>2.5.6.SEC02</version> <version>${slf4j.version}</version>
<scope>test</scope> </dependency>
</dependency> <dependency>
</dependencies> <groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- commons-logging can be rather simply and conveniently excluded as
a dependency by declaring it in the provided scope within the pom.xml file
of your project. The actual commons-logging classes would be provided by
jcl-over-slf4j. This translates into the following pom file snippet: -->
<!-- <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId>
<version>1.1.1</version> <scope>provided</scope> </dependency> <dependency>
<groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.16</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>-->
<!--================================================================= -->
<!-- TEST -->
<!--================================================================= -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>2.5.6.SEC02</version>
<scope>test</scope>
</dependency>
</dependencies>
</project> </project>

View File

@ -45,8 +45,8 @@ import java.util.Iterator;
import org.apache.commons.httpclient.NameValuePair; import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.apache.log4j.Level; import org.slf4j.Logger;
import org.apache.log4j.Logger; import org.slf4j.LoggerFactory;
/** /**
* Connect to a GeoServer instance to publish or modify data. * Connect to a GeoServer instance to publish or modify data.
@ -58,8 +58,7 @@ import org.apache.log4j.Logger;
*/ */
public class GeoServerRESTPublisher { public class GeoServerRESTPublisher {
private static final Logger LOGGER = Logger private static final Logger LOGGER = LoggerFactory.getLogger(GeoServerRESTPublisher.class);
.getLogger(GeoServerRESTPublisher.class);
private final String restURL; private final String restURL;
private final String gsuser; private final String gsuser;
private final String gspass; private final String gspass;
@ -137,7 +136,7 @@ public class GeoServerRESTPublisher {
try { try {
return publishStyle(sldBody, null); return publishStyle(sldBody, null);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
if (LOGGER.isEnabledFor(Level.ERROR)) { if (LOGGER.isErrorEnabled()) {
LOGGER.error(e.getLocalizedMessage(), e); LOGGER.error(e.getLocalizedMessage(), e);
} }
} }
@ -340,7 +339,7 @@ public class GeoServerRESTPublisher {
try { try {
return removeStyle(styleName, true); return removeStyle(styleName, true);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
if (LOGGER.isEnabledFor(Level.ERROR)) { if (LOGGER.isErrorEnabled()) {
LOGGER.error(e.getLocalizedMessage(), e); LOGGER.error(e.getLocalizedMessage(), e);
} }
} }
@ -427,7 +426,7 @@ public class GeoServerRESTPublisher {
LOGGER.info("Store successfully created using ( " + uri + " )"); LOGGER.info("Store successfully created using ( " + uri + " )");
return true; return true;
} else { } else {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error("Error in creating store using: " + uri); LOGGER.error("Error in creating store using: " + uri);
return false; return false;
} }
@ -761,7 +760,7 @@ public class GeoServerRESTPublisher {
final String layername = fte.getName(); final String layername = fte.getName();
if (layername == null || layername.isEmpty()) { if (layername == null || layername.isEmpty()) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error("GSFeatureTypeEncoder has no valid name associated, try using GSFeatureTypeEncoder.setName(String)"); LOGGER.error("GSFeatureTypeEncoder has no valid name associated, try using GSFeatureTypeEncoder.setName(String)");
return false; return false;
} }
@ -778,7 +777,7 @@ public class GeoServerRESTPublisher {
LOGGER.info("DB layer successfully added (layer:" + layername + ")"); LOGGER.info("DB layer successfully added (layer:" + layername + ")");
if (layerEncoder == null) { if (layerEncoder == null) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error("GSLayerEncoder is null: Unable to find the defauldStyle for this layer"); LOGGER.error("GSLayerEncoder is null: Unable to find the defauldStyle for this layer");
return false; return false;
} }
@ -1209,7 +1208,7 @@ public class GeoServerRESTPublisher {
// create Coverage Store // create Coverage Store
if (!createCoverage(workspace, storeName, coverageEncoder)) { if (!createCoverage(workspace, storeName, coverageEncoder)) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error("Unable to create a coverage for the store:" LOGGER.error("Unable to create a coverage for the store:"
+ coverageName); + coverageName);
return null; return null;
@ -1223,7 +1222,7 @@ public class GeoServerRESTPublisher {
this.gspass); this.gspass);
return reader.getCoverageStore(workspace, storeName); return reader.getCoverageStore(workspace, storeName);
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
LOGGER.log(Level.ERROR, e.getMessage(), e); LOGGER.error(e.getMessage(), e);
} }
} }
return null; return null;
@ -1343,7 +1342,7 @@ public class GeoServerRESTPublisher {
* readable by target GeoServer not the calling client! * readable by target GeoServer not the calling client!
*/ */
if (!mosaicDir.isDirectory()) { if (!mosaicDir.isDirectory()) {
if (LOGGER.isEnabledFor(Level.WARN)) if (LOGGER.isWarnEnabled())
LOGGER.warn("Directory '" LOGGER.warn("Directory '"
+ mosaicDir + mosaicDir
+ "' not exists locally. Continue: please check existance on the remote server."); + "' not exists locally. Continue: please check existance on the remote server.");
@ -1465,13 +1464,13 @@ public class GeoServerRESTPublisher {
return false; return false;
} }
if (!createCoverage(workspace, storeName, coverageEncoder)) { if (!createCoverage(workspace, storeName, coverageEncoder)) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error("Unable to create a coverage for the store:" LOGGER.error("Unable to create a coverage for the store:"
+ coverageName); + coverageName);
return false; return false;
} }
if (!configureLayer(workspace, coverageName, layerEncoder)) { if (!configureLayer(workspace, coverageName, layerEncoder)) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error("Unable to configure the Layer for the coverage:" LOGGER.error("Unable to configure the Layer for the coverage:"
+ coverageName); + coverageName);
return false; return false;
@ -1508,7 +1507,7 @@ public class GeoServerRESTPublisher {
fqLayerName = layerName; fqLayerName = layerName;
if (LOGGER.isEnabledFor(Level.WARN)) { if (LOGGER.isWarnEnabled()) {
LOGGER.warn("Null workspace while configuring layer : " LOGGER.warn("Null workspace while configuring layer : "
+ layerName + " -- This behavior is deprecated."); + layerName + " -- This behavior is deprecated.");
} }
@ -1551,8 +1550,8 @@ public class GeoServerRESTPublisher {
// the covstore is still there: should we delete it? // the covstore is still there: should we delete it?
} catch (MalformedURLException ex) { } catch (MalformedURLException ex) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error(ex); LOGGER.error(ex.getLocalizedMessage(),ex);
return false; return false;
} }
} }
@ -1580,7 +1579,7 @@ public class GeoServerRESTPublisher {
fqLayerName = layerName; fqLayerName = layerName;
if (LOGGER.isEnabledFor(Level.WARN)) { if (LOGGER.isWarnEnabled()) {
LOGGER.warn("Null workspace while configuring layer : " LOGGER.warn("Null workspace while configuring layer : "
+ layerName + " -- This behavior is deprecated."); + layerName + " -- This behavior is deprecated.");
} }
@ -1615,8 +1614,8 @@ public class GeoServerRESTPublisher {
// the store is still there: should we delete it? // the store is still there: should we delete it?
} catch (MalformedURLException ex) { } catch (MalformedURLException ex) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error(ex); LOGGER.error(ex.getLocalizedMessage(),ex);
return false; return false;
} }
} }
@ -1637,7 +1636,7 @@ public class GeoServerRESTPublisher {
try { try {
return removeDatastore(workspace, storename, true); return removeDatastore(workspace, storename, true);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error("Arguments may not be null or empty!", e); LOGGER.error("Arguments may not be null or empty!", e);
} }
return false; return false;
@ -1684,8 +1683,8 @@ public class GeoServerRESTPublisher {
return deleted; return deleted;
} catch (MalformedURLException ex) { } catch (MalformedURLException ex) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error(ex); LOGGER.error(ex.getLocalizedMessage(),ex);
return false; return false;
} }
} }
@ -1704,7 +1703,7 @@ public class GeoServerRESTPublisher {
try { try {
return removeCoverageStore(workspace, storename, true); return removeCoverageStore(workspace, storename, true);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error("Arguments may not be null or empty!", e); LOGGER.error("Arguments may not be null or empty!", e);
} }
return false; return false;
@ -1750,8 +1749,8 @@ public class GeoServerRESTPublisher {
return deleted; return deleted;
} catch (MalformedURLException ex) { } catch (MalformedURLException ex) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error(ex); LOGGER.error(ex.getLocalizedMessage(),ex);
return false; return false;
} }
} }
@ -1769,7 +1768,7 @@ public class GeoServerRESTPublisher {
try { try {
return removeWorkspace(workspace, false); return removeWorkspace(workspace, false);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error("Arguments may not be null or empty!", e); LOGGER.error("Arguments may not be null or empty!", e);
} }
return false; return false;
@ -1813,8 +1812,8 @@ public class GeoServerRESTPublisher {
return deleted; return deleted;
} catch (MalformedURLException ex) { } catch (MalformedURLException ex) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error(ex); LOGGER.error(ex.getLocalizedMessage(),ex);
return false; return false;
} }
} }
@ -1853,7 +1852,7 @@ public class GeoServerRESTPublisher {
boolean deleted = HTTPUtils.delete(deleteUrl.toExternalForm(), boolean deleted = HTTPUtils.delete(deleteUrl.toExternalForm(),
gsuser, gspass); gsuser, gspass);
if (!deleted) { if (!deleted) {
if (LOGGER.isEnabledFor(Level.WARN)) if (LOGGER.isWarnEnabled())
LOGGER.warn("Could not delete layergroup " + name); LOGGER.warn("Could not delete layergroup " + name);
} else { } else {
if (LOGGER.isInfoEnabled()) if (LOGGER.isInfoEnabled())
@ -1862,8 +1861,8 @@ public class GeoServerRESTPublisher {
return deleted; return deleted;
} catch (MalformedURLException ex) { } catch (MalformedURLException ex) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error(ex); LOGGER.error(ex.getLocalizedMessage(),ex);
return false; return false;
} }
} }
@ -1889,7 +1888,7 @@ public class GeoServerRESTPublisher {
fqLayerName = layerName; fqLayerName = layerName;
if (LOGGER.isEnabledFor(Level.WARN)) { if (LOGGER.isWarnEnabled()) {
LOGGER.warn("Null workspace while removing layer : " LOGGER.warn("Null workspace while removing layer : "
+ layerName + " -- This behavior is deprecated."); + layerName + " -- This behavior is deprecated.");
} }
@ -1897,7 +1896,7 @@ public class GeoServerRESTPublisher {
fqLayerName = workspace + ":" + layerName; fqLayerName = workspace + ":" + layerName;
} }
if (layerName == null) { if (layerName == null) {
if (LOGGER.isEnabledFor(Level.ERROR)) { if (LOGGER.isErrorEnabled()) {
LOGGER.error("Null layerName : " + layerName); LOGGER.error("Null layerName : " + layerName);
} }
return false; return false;
@ -1911,7 +1910,7 @@ public class GeoServerRESTPublisher {
LOGGER.info("Layer successfully removed: " + fqLayerName); LOGGER.info("Layer successfully removed: " + fqLayerName);
} }
} else { } else {
if (LOGGER.isEnabledFor(Level.WARN)) if (LOGGER.isWarnEnabled())
LOGGER.warn("Error removing layer " + fqLayerName); LOGGER.warn("Error removing layer " + fqLayerName);
} }
@ -1956,7 +1955,7 @@ public class GeoServerRESTPublisher {
LOGGER.info("Layer successfully configured: " + fqLayerName); LOGGER.info("Layer successfully configured: " + fqLayerName);
} }
} else { } else {
if (LOGGER.isEnabledFor(Level.WARN)) if (LOGGER.isWarnEnabled())
LOGGER.warn("Error configuring layer " + fqLayerName + " (" LOGGER.warn("Error configuring layer " + fqLayerName + " ("
+ sendResult + ")"); + sendResult + ")");
} }
@ -1980,7 +1979,7 @@ public class GeoServerRESTPublisher {
final String wsname, final String csname) { final String wsname, final String csname) {
final String cname = ce.getName(); final String cname = ce.getName();
if (cname == null) { if (cname == null) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error("Unable to configure a coverage with no name try using GSCoverageEncoder.setName(String)"); LOGGER.error("Unable to configure a coverage with no name try using GSCoverageEncoder.setName(String)");
return false; return false;
} }
@ -1989,13 +1988,13 @@ public class GeoServerRESTPublisher {
try { try {
reader = new GeoServerRESTReader(restURL, gsuser, gspass); reader = new GeoServerRESTReader(restURL, gsuser, gspass);
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error(e); LOGGER.error(e.getLocalizedMessage(),e);
return false; return false;
} }
final RESTCoverageList covList = reader.getCoverages(wsname, csname); final RESTCoverageList covList = reader.getCoverages(wsname, csname);
if (covList.isEmpty()) { if (covList.isEmpty()) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error("No coverages found in new coveragestore " LOGGER.error("No coverages found in new coveragestore "
+ csname); + csname);
return false; return false;
@ -2011,7 +2010,7 @@ public class GeoServerRESTPublisher {
} }
// if no coverage to configure is found return false // if no coverage to configure is found return false
if (!found) { if (!found) {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error("No coverages found in new coveragestore " LOGGER.error("No coverages found in new coveragestore "
+ csname + " called " + cname); + csname + " called " + cname);
return false; return false;
@ -2030,7 +2029,7 @@ public class GeoServerRESTPublisher {
+ csname + ":" + cname); + csname + ":" + cname);
} }
} else { } else {
if (LOGGER.isEnabledFor(Level.WARN)) if (LOGGER.isWarnEnabled())
LOGGER.warn("Error configuring coverage " + wsname + ":" LOGGER.warn("Error configuring coverage " + wsname + ":"
+ csname + ":" + cname + " (" + sendResult + ")"); + csname + ":" + cname + " (" + sendResult + ")");
} }
@ -2125,7 +2124,7 @@ public class GeoServerRESTPublisher {
+ ":" + storeName + ":" + resourceName); + ":" + storeName + ":" + resourceName);
} }
} else { } else {
if (LOGGER.isEnabledFor(Level.ERROR)) if (LOGGER.isErrorEnabled())
LOGGER.error("Error creating coverage " + workspace + ":" LOGGER.error("Error creating coverage " + workspace + ":"
+ storeName + ":" + resourceName + " (" + sendResult + storeName + ":" + resourceName + " (" + sendResult
+ ")"); + ")");

View File

@ -29,8 +29,8 @@ import it.geosolutions.geoserver.rest.decoder.RESTCoverage;
import it.geosolutions.geoserver.rest.decoder.RESTCoverageList; import it.geosolutions.geoserver.rest.decoder.RESTCoverageList;
import it.geosolutions.geoserver.rest.decoder.RESTCoverageStore; import it.geosolutions.geoserver.rest.decoder.RESTCoverageStore;
import it.geosolutions.geoserver.rest.decoder.RESTCoverageStoreList; import it.geosolutions.geoserver.rest.decoder.RESTCoverageStoreList;
import it.geosolutions.geoserver.rest.decoder.RESTDataStoreList;
import it.geosolutions.geoserver.rest.decoder.RESTDataStore; import it.geosolutions.geoserver.rest.decoder.RESTDataStore;
import it.geosolutions.geoserver.rest.decoder.RESTDataStoreList;
import it.geosolutions.geoserver.rest.decoder.RESTFeatureType; import it.geosolutions.geoserver.rest.decoder.RESTFeatureType;
import it.geosolutions.geoserver.rest.decoder.RESTLayer; import it.geosolutions.geoserver.rest.decoder.RESTLayer;
import it.geosolutions.geoserver.rest.decoder.RESTLayerGroup; import it.geosolutions.geoserver.rest.decoder.RESTLayerGroup;
@ -46,7 +46,10 @@ import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.apache.log4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
@ -58,7 +61,7 @@ import org.apache.log4j.Logger;
*/ */
public class GeoServerRESTReader { public class GeoServerRESTReader {
private final static Logger LOGGER = Logger.getLogger(GeoServerRESTReader.class); private final static Logger LOGGER = LoggerFactory.getLogger(GeoServerRESTReader.class);
private final String baseurl; private final String baseurl;
private String username; private String username;
private String password; private String password;

View File

@ -33,6 +33,7 @@ import java.net.ConnectException;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import org.apache.commons.httpclient.Credentials; import org.apache.commons.httpclient.Credentials;
import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.HttpStatus;
@ -47,13 +48,14 @@ import org.apache.commons.httpclient.methods.PutMethod;
import org.apache.commons.httpclient.methods.RequestEntity; import org.apache.commons.httpclient.methods.RequestEntity;
import org.apache.commons.httpclient.methods.StringRequestEntity; import org.apache.commons.httpclient.methods.StringRequestEntity;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.log4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* Low level HTTP utilities. * Low level HTTP utilities.
*/ */
class HTTPUtils { class HTTPUtils {
private static final Logger LOGGER = Logger.getLogger(HTTPUtils.class); private static final Logger LOGGER = LoggerFactory.getLogger(HTTPUtils.class);
/** /**
* Performs an HTTP GET on the given URL. * Performs an HTTP GET on the given URL.

View File

@ -27,11 +27,13 @@ package it.geosolutions.geoserver.rest.decoder.utils;
import java.io.IOException; import java.io.IOException;
import java.io.StringReader; import java.io.StringReader;
import org.apache.log4j.Logger;
import org.jdom.Document; import org.jdom.Document;
import org.jdom.Element; import org.jdom.Element;
import org.jdom.JDOMException; import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder; import org.jdom.input.SAXBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* *
@ -39,7 +41,7 @@ import org.jdom.input.SAXBuilder;
*/ */
public class JDOMBuilder { public class JDOMBuilder {
private final static Logger LOGGER = Logger.getLogger(JDOMBuilder.class); private final static Logger LOGGER = LoggerFactory.getLogger(JDOMBuilder.class);
public static Element buildElement(String response) { public static Element buildElement(String response) {
if(response == null) if(response == null)

View File

@ -29,9 +29,10 @@ import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import org.apache.log4j.Logger;
import org.jdom.Element; import org.jdom.Element;
import org.jdom.filter.Filter; import org.jdom.filter.Filter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* *
@ -42,7 +43,7 @@ public abstract class ElementUtils {
/** /**
* Default logger * Default logger
*/ */
private final static Logger LOGGER = Logger.getLogger(ElementUtils.class); private final static Logger LOGGER = LoggerFactory.getLogger(ElementUtils.class);
/** /**
* *

View File

@ -35,7 +35,8 @@ import java.io.IOException;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.filefilter.SuffixFileFilter; import org.apache.commons.io.filefilter.SuffixFileFilter;
import org.apache.log4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
/** /**
@ -48,7 +49,7 @@ import org.springframework.core.io.ClassPathResource;
* @author etj * @author etj
*/ */
public class ConfigTest extends GeoserverRESTTest { public class ConfigTest extends GeoserverRESTTest {
private final static Logger LOGGER = Logger.getLogger(ConfigTest.class); private final static Logger LOGGER = LoggerFactory.getLogger(ConfigTest.class);
private static final String DEFAULT_WS = "geosolutions"; private static final String DEFAULT_WS = "geosolutions";

View File

@ -25,19 +25,22 @@
package it.geosolutions.geoserver.rest; package it.geosolutions.geoserver.rest;
import it.geosolutions.geoserver.rest.decoder.utils.NameLinkElem;
import it.geosolutions.geoserver.rest.decoder.RESTCoverage; import it.geosolutions.geoserver.rest.decoder.RESTCoverage;
import it.geosolutions.geoserver.rest.decoder.RESTCoverageStore; import it.geosolutions.geoserver.rest.decoder.RESTCoverageStore;
import it.geosolutions.geoserver.rest.decoder.RESTDataStore; import it.geosolutions.geoserver.rest.decoder.RESTDataStore;
import it.geosolutions.geoserver.rest.decoder.RESTFeatureType; import it.geosolutions.geoserver.rest.decoder.RESTFeatureType;
import it.geosolutions.geoserver.rest.decoder.RESTLayer; import it.geosolutions.geoserver.rest.decoder.RESTLayer;
import it.geosolutions.geoserver.rest.decoder.RESTLayerGroup; import it.geosolutions.geoserver.rest.decoder.RESTLayerGroup;
import it.geosolutions.geoserver.rest.decoder.utils.NameLinkElem;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.util.List; import java.util.List;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* Initializes REST params. * Initializes REST params.
@ -54,7 +57,7 @@ import org.apache.log4j.Logger;
* @author etj * @author etj
*/ */
public abstract class GeoserverRESTTest extends TestCase { public abstract class GeoserverRESTTest extends TestCase {
private final static Logger LOGGER = Logger.getLogger(GeoserverRESTTest.class); private final static Logger LOGGER = LoggerFactory.getLogger(GeoserverRESTTest.class);
protected static final String DEFAULT_WS = "geosolutions"; protected static final String DEFAULT_WS = "geosolutions";

View File

@ -21,11 +21,12 @@ package it.geosolutions.geoserver.rest.encoder;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.apache.log4j.Logger;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* *
* @author Carlo Cancellieri - carlo.cancellieri@geo-solutions.it * @author Carlo Cancellieri - carlo.cancellieri@geo-solutions.it
*/ */
public class GSWorkspaceEncoderTest extends TestCase { public class GSWorkspaceEncoderTest extends TestCase {
@ -36,18 +37,17 @@ public class GSWorkspaceEncoderTest extends TestCase {
/** /**
* Default logger * Default logger
*/ */
protected final static Logger LOGGER = Logger.getLogger(GSWorkspaceEncoderTest.class); protected final static Logger LOGGER = LoggerFactory.getLogger(GSWorkspaceEncoderTest.class);
@Test @Test
public void testAll() { public void testAll() {
final GSWorkspaceEncoder wsenc = new GSWorkspaceEncoder("WS1"); final GSWorkspaceEncoder wsenc = new GSWorkspaceEncoder("WS1");
LOGGER.info(wsenc.toString()); LOGGER.info(wsenc.toString());
wsenc.setName("test_name"); wsenc.setName("test_name");
LOGGER.info(wsenc.toString()); LOGGER.info(wsenc.toString());
wsenc.setName("new_name"); wsenc.setName("new_name");
LOGGER.info(wsenc.toString()); LOGGER.info(wsenc.toString());
} }
} }

View File

@ -26,10 +26,11 @@ import it.geosolutions.geoserver.rest.encoder.metadata.GSDimensionInfoEncoder.Pr
import it.geosolutions.geoserver.rest.encoder.utils.ElementUtils; import it.geosolutions.geoserver.rest.encoder.utils.ElementUtils;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.apache.log4j.Logger;
import org.jdom.Element; import org.jdom.Element;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* *
@ -43,7 +44,7 @@ public class GSCoverageEncoderTest extends TestCase {
/** /**
* Default logger * Default logger
*/ */
protected final static Logger LOGGER = Logger.getLogger(GSCoverageEncoderTest.class); protected final static Logger LOGGER = LoggerFactory.getLogger(GSCoverageEncoderTest.class);
/** /**
* test set or reset of reprojection * test set or reset of reprojection

View File

@ -21,8 +21,9 @@ package it.geosolutions.geoserver.rest.encoder.coverage;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.apache.log4j.Logger;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* *
@ -36,7 +37,7 @@ public class GSImageMosaicEncoderTest extends TestCase {
/** /**
* Default logger * Default logger
*/ */
protected final static Logger LOGGER = Logger.getLogger(GSImageMosaicEncoderTest.class); protected final static Logger LOGGER = LoggerFactory.getLogger(GSImageMosaicEncoderTest.class);
/** /**
* TODO implement this test * TODO implement this test

View File

@ -30,10 +30,11 @@ import java.math.BigDecimal;
import junit.framework.TestCase; import junit.framework.TestCase;
import org.apache.log4j.Logger;
import org.jdom.Element; import org.jdom.Element;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* *
@ -41,7 +42,7 @@ import org.junit.Test;
* @author Carlo Cancellieri - carlo.cancellieri@geo-solutions.it * @author Carlo Cancellieri - carlo.cancellieri@geo-solutions.it
*/ */
public class GSFeatureEncoderTest extends TestCase { public class GSFeatureEncoderTest extends TestCase {
protected final static Logger LOGGER = Logger.getLogger(GSFeatureEncoderTest.class); protected final static Logger LOGGER = LoggerFactory.getLogger(GSFeatureEncoderTest.class);
public GSFeatureEncoderTest() { public GSFeatureEncoderTest() {
} }

View File

@ -1,21 +1,17 @@
package it.geosolutions.geoserver.rest.encoder.utils; package it.geosolutions.geoserver.rest.encoder.utils;
import it.geosolutions.geoserver.rest.encoder.GSWorkspaceEncoderTest;
import java.io.IOException;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import org.apache.log4j.Logger;
import org.jdom.Content;
import org.jdom.Element; import org.jdom.Element;
import org.jdom.filter.Filter; import org.jdom.filter.Filter;
import org.jdom.output.XMLOutputter;
import org.junit.After; import org.junit.After;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ElementUtilsTest { public class ElementUtilsTest {
@ -23,7 +19,7 @@ public class ElementUtilsTest {
/** /**
* Default logger * Default logger
*/ */
protected final static Logger LOGGER = Logger.getLogger(ElementUtilsTest.class); protected final static Logger LOGGER = LoggerFactory.getLogger(ElementUtilsTest.class);
final static String NAME="TEST"; final static String NAME="TEST";

View File

@ -27,15 +27,14 @@ package it.geosolutions.geoserver.rest.publisher;
import it.geosolutions.geoserver.rest.GeoserverRESTTest; 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.GSLayerEncoder;
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy; import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy;
import it.geosolutions.geoserver.rest.encoder.coverage.GSCoverageEncoder;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import org.apache.log4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
/** /**
@ -47,7 +46,7 @@ import org.springframework.core.io.ClassPathResource;
*/ */
public class GeoserverRESTGeoTiffTest extends GeoserverRESTTest { public class GeoserverRESTGeoTiffTest extends GeoserverRESTTest {
private final static Logger LOGGER = Logger.getLogger(GeoserverRESTGeoTiffTest.class); private final static Logger LOGGER = LoggerFactory.getLogger(GeoserverRESTGeoTiffTest.class);
public GeoserverRESTGeoTiffTest(String testName) { public GeoserverRESTGeoTiffTest(String testName) {
super(testName); super(testName);
@ -72,7 +71,7 @@ public class GeoserverRESTGeoTiffTest extends GeoserverRESTTest {
boolean pc = publisher.publishExternalGeoTIFF(DEFAULT_WS, storeName, geotiff, layerName,"EPSG:4326",ProjectionPolicy.FORCE_DECLARED,"raster"); boolean pc = publisher.publishExternalGeoTIFF(DEFAULT_WS, storeName, geotiff, layerName,"EPSG:4326",ProjectionPolicy.FORCE_DECLARED,"raster");
assertTrue("publish() failed", pc); assertTrue("publish() failed", pc);
assertTrue(existsLayer(layerName)); assertTrue(existsLayer(layerName));
LOGGER.info(pc); LOGGER.info("Published "+pc);
RESTCoverageStore reloadedCS = reader.getCoverageStore(DEFAULT_WS, storeName); RESTCoverageStore reloadedCS = reader.getCoverageStore(DEFAULT_WS, storeName);
assertEquals(storeName, reloadedCS.getName()); assertEquals(storeName, reloadedCS.getName());

View File

@ -26,8 +26,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.ParameterConfigure; import it.geosolutions.geoserver.rest.GeoServerRESTPublisher.ParameterConfigure;
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.GSLayerEncoder; import it.geosolutions.geoserver.rest.encoder.GSLayerEncoder;
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy; import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy;
@ -40,7 +40,8 @@ import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import org.apache.commons.httpclient.NameValuePair; import org.apache.commons.httpclient.NameValuePair;
import org.apache.log4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
/** /**
@ -68,7 +69,7 @@ import org.springframework.core.io.ClassPathResource;
*/ */
public class GeoserverRESTImageMosaicTest extends GeoserverRESTTest { public class GeoserverRESTImageMosaicTest extends GeoserverRESTTest {
private final static Logger LOGGER = Logger.getLogger(GeoserverRESTImageMosaicTest.class); private final static Logger LOGGER = LoggerFactory.getLogger(GeoserverRESTImageMosaicTest.class);
public GeoserverRESTImageMosaicTest(String testName) { public GeoserverRESTImageMosaicTest(String testName) {

View File

@ -29,7 +29,9 @@ package it.geosolutions.geoserver.rest.publisher;
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.GSPostGISDatastoreEncoder; import it.geosolutions.geoserver.rest.encoder.GSPostGISDatastoreEncoder;
import org.apache.log4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* Testcase for creating postgis-based resources on geoserver. * Testcase for creating postgis-based resources on geoserver.
@ -57,7 +59,7 @@ import org.apache.log4j.Logger;
*/ */
public class GeoserverRESTPostgisDatastoreTest extends GeoserverRESTTest { public class GeoserverRESTPostgisDatastoreTest extends GeoserverRESTTest {
private final static Logger LOGGER = Logger.getLogger(GeoserverRESTPostgisDatastoreTest.class); private final static Logger LOGGER = LoggerFactory.getLogger(GeoserverRESTPostgisDatastoreTest.class);
private static final String DEFAULT_WS = "it.geosolutions"; private static final String DEFAULT_WS = "it.geosolutions";
private final boolean pgIgnore; private final boolean pgIgnore;

View File

@ -31,7 +31,9 @@ import it.geosolutions.geoserver.rest.decoder.RESTLayer;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import org.apache.log4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/** /**
* Testcase for publishing layers on geoserver. * Testcase for publishing layers on geoserver.
@ -43,7 +45,7 @@ import org.apache.log4j.Logger;
*/ */
public class GeoserverRESTPublisherTest extends GeoserverRESTTest { public class GeoserverRESTPublisherTest extends GeoserverRESTTest {
private final static Logger LOGGER = Logger.getLogger(GeoserverRESTPublisherTest.class); private final static Logger LOGGER = LoggerFactory.getLogger(GeoserverRESTPublisherTest.class);
public GeoserverRESTPublisherTest(String testName) { public GeoserverRESTPublisherTest(String testName) {
super(testName); super(testName);

View File

@ -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.UploadMethod; import it.geosolutions.geoserver.rest.GeoServerRESTPublisher.UploadMethod;
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;
@ -35,7 +35,8 @@ import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import org.apache.commons.httpclient.NameValuePair; import org.apache.commons.httpclient.NameValuePair;
import org.apache.log4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
/** /**
@ -48,7 +49,7 @@ import org.springframework.core.io.ClassPathResource;
*/ */
public class GeoserverRESTShapeTest extends GeoserverRESTTest { public class GeoserverRESTShapeTest extends GeoserverRESTTest {
private final static Logger LOGGER = Logger.getLogger(GeoserverRESTShapeTest.class); private final static Logger LOGGER = LoggerFactory.getLogger(GeoserverRESTShapeTest.class);
public GeoserverRESTShapeTest(String testName) { public GeoserverRESTShapeTest(String testName) {
super(testName); super(testName);

View File

@ -36,9 +36,10 @@ import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.log4j.Logger;
import org.jdom.Element; import org.jdom.Element;
import org.jdom.Namespace; import org.jdom.Namespace;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
/** /**
@ -51,7 +52,7 @@ import org.springframework.core.io.ClassPathResource;
*/ */
public class GeoserverRESTStyleTest extends GeoserverRESTTest { public class GeoserverRESTStyleTest extends GeoserverRESTTest {
private final static Logger LOGGER = Logger private final static Logger LOGGER = LoggerFactory
.getLogger(GeoserverRESTStyleTest.class); .getLogger(GeoserverRESTStyleTest.class);
public GeoserverRESTStyleTest(String testName) { public GeoserverRESTStyleTest(String testName) {

View File

@ -26,15 +26,13 @@
package it.geosolutions.geoserver.rest.publisher; package it.geosolutions.geoserver.rest.publisher;
import it.geosolutions.geoserver.rest.GeoserverRESTTest; import it.geosolutions.geoserver.rest.GeoserverRESTTest;
import it.geosolutions.geoserver.rest.decoder.RESTCoverageStore;
import it.geosolutions.geoserver.rest.encoder.GSLayerEncoder;
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy; import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy;
import it.geosolutions.geoserver.rest.encoder.coverage.GSCoverageEncoder;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import org.apache.log4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
/** /**
@ -47,7 +45,7 @@ import org.springframework.core.io.ClassPathResource;
*/ */
public class GeoserverRESTWorkspaceTest extends GeoserverRESTTest { public class GeoserverRESTWorkspaceTest extends GeoserverRESTTest {
private final static Logger LOGGER = Logger.getLogger(GeoserverRESTWorkspaceTest.class); private final static Logger LOGGER = LoggerFactory.getLogger(GeoserverRESTWorkspaceTest.class);
public GeoserverRESTWorkspaceTest(String testName) { public GeoserverRESTWorkspaceTest(String testName) {
super(testName); super(testName);

View File

@ -25,14 +25,15 @@
package it.geosolutions.geoserver.rest.publisher; package it.geosolutions.geoserver.rest.publisher;
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
import it.geosolutions.geoserver.rest.GeoServerRESTPublisher.ParameterConfigure; import it.geosolutions.geoserver.rest.GeoServerRESTPublisher.ParameterConfigure;
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import org.apache.commons.httpclient.NameValuePair; import org.apache.commons.httpclient.NameValuePair;
import org.apache.log4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.ClassPathResource;
/** /**
@ -44,7 +45,7 @@ import org.springframework.core.io.ClassPathResource;
*/ */
public class GeoserverRESTWorldImageTest extends GeoserverRESTTest { public class GeoserverRESTWorldImageTest extends GeoserverRESTTest {
private final static Logger LOGGER = Logger.getLogger(GeoserverRESTWorldImageTest.class); private final static Logger LOGGER = LoggerFactory.getLogger(GeoserverRESTWorldImageTest.class);
public GeoserverRESTWorldImageTest(String testName) { public GeoserverRESTWorldImageTest(String testName) {
super(testName); super(testName);