Merge upstream/master
This commit is contained in:
commit
1b5fb6350f
45
README.md
45
README.md
@ -7,13 +7,47 @@
|
|||||||
* Stable on Windows + OracleJDK7 [](http://winbuild.geo-solutions.it/jenkins/view/GeoServer-Manager/job/GeoServer-Manager-Stable/)
|
* Stable on Windows + OracleJDK7 [](http://winbuild.geo-solutions.it/jenkins/view/GeoServer-Manager/job/GeoServer-Manager-Stable/)
|
||||||
|
|
||||||
|
|
||||||
## Intro
|
|
||||||
Client library written in Java to interact with [GeoServer](http://www.geoserver.org) through its REst administration interface.
|
|
||||||
|
|
||||||
The purpose of this project is to hold a REST client library to interact with GeoServer; a requirement for this library is to depend as less as possible on external libraries. This library aims at being lean and mean.
|
## Intro
|
||||||
|
Client library written in Java to interact with [GeoServer](http://www.geoserver.org) through its [ReST administration interface](http://docs.geoserver.org/stable/en/user/rest/api/index.html).
|
||||||
|
|
||||||
|
The purpose of this project is to hold a ReST client library to interact with GeoServer; a requirement for this library is to depend as less as possible on external libraries. This library aims at being lean and mean.
|
||||||
|
|
||||||
For general questions about this project feel free to use the mailing lists.
|
For general questions about this project feel free to use the mailing lists.
|
||||||
|
|
||||||
|
## Using the library
|
||||||
|
|
||||||
|
### Working with Maven
|
||||||
|
In order to include the lib and its dependencies in a Maven project, the repository to point at is this one:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<repository>
|
||||||
|
<id>GeoSolutions</id>
|
||||||
|
<url>http://maven.geo-solutions.it/</url>
|
||||||
|
</repository>
|
||||||
|
```
|
||||||
|
|
||||||
|
and the dependency tag for your pom is as follows:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<dependency>
|
||||||
|
<groupId>it.geosolutions</groupId>
|
||||||
|
<artifactId>geoserver-manager</artifactId>
|
||||||
|
<version>1.7.0</version>
|
||||||
|
</dependency>
|
||||||
|
```
|
||||||
|
### Direct Link to JAR
|
||||||
|
If you are simply looking for the JAR to download and use you can find it [here](http://maven.geo-solutions.it/it/geosolutions/geoserver-manager/1.7.0/geoserver-manager-1.7.0.jar).
|
||||||
|
|
||||||
|
### GeoServer Compatibility Matrix
|
||||||
|
|
||||||
|
**GeoServer-Manager/GeoServer** | **2.6.x** |**2.7.x** |**2.8.x** |**2.9.x**
|
||||||
|
-------------------------------- | ----------|----------|----------|---------
|
||||||
|
**1.6.0** | Y | Y | P | P
|
||||||
|
**1.7.0** | N | P | Y | Y
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
You can find some examples in the wiki.
|
||||||
## License
|
## License
|
||||||
|
|
||||||
geoserver-manager is released under a permissinve [MIT](https://opensource.org/licenses/MIT) license. See [wikipedia](https://en.wikipedia.org/wiki/MIT_License) for more information.
|
geoserver-manager is released under a permissinve [MIT](https://opensource.org/licenses/MIT) license. See [wikipedia](https://en.wikipedia.org/wiki/MIT_License) for more information.
|
||||||
@ -26,4 +60,9 @@ geoserver-manager is released under a permissinve [MIT](https://opensource.org/l
|
|||||||
|
|
||||||
For more information see [this](https://github.com/geosolutions-it/geoserver-manager/wiki) page.
|
For more information see [this](https://github.com/geosolutions-it/geoserver-manager/wiki) page.
|
||||||
|
|
||||||
|
## Version
|
||||||
|
Current stable version is [1.7.0](https://github.com/geosolutions-it/geoserver-manager/releases/tag/v1.7.0) ([Changelog](https://github.com/geosolutions-it/geoserver-manager/wiki/Changelog)).
|
||||||
|
|
||||||
|
## Credits
|
||||||
|
The work on this library has been initiated by GeoSolutions. Over the years it has been funded by various organizations like UN FAO, German Space Agency (DLR) and others.
|
||||||
|
|
||||||
|
|||||||
514
pom.xml
514
pom.xml
@ -1,287 +1,301 @@
|
|||||||
<!-- * GeoServer-Manager - Simple Manager Library for GeoServer * * Copyright
|
<!--
|
||||||
(C) 2007,2011 GeoSolutions S.A.S. * http://www.geo-solutions.it * * Permission
|
* GeoServer-Manager - Simple Manager Library for GeoServer
|
||||||
is hereby granted, free of charge, to any person obtaining a copy * of this
|
*
|
||||||
software and associated documentation files (the "Software"), to deal * in
|
* Copyright (C) 2007 - 2016 GeoSolutions S.A.S. 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"
|
||||||
<modelVersion>4.0.0</modelVersion>
|
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">
|
||||||
|
|
||||||
<groupId>it.geosolutions</groupId>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>geoserver-manager</artifactId>
|
|
||||||
<version>1.7-SNAPSHOT</version>
|
|
||||||
|
|
||||||
<packaging>jar</packaging>
|
<groupId>it.geosolutions</groupId>
|
||||||
|
<artifactId>geoserver-manager</artifactId>
|
||||||
|
<version>1.8-SNAPSHOT</version>
|
||||||
|
|
||||||
<name>GeoServer 2 Manager - REST based</name>
|
<packaging>jar</packaging>
|
||||||
<description>
|
|
||||||
GeoServer Manager is a library to interact with GeoServer 2.x.
|
<name>GeoServer Manager - REST based</name>
|
||||||
|
<description>
|
||||||
|
GeoServer Manager is a library to interact with GeoServer
|
||||||
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>
|
<url>https://github.com/geosolutions-it/geoserver-manager</url>
|
||||||
<name>GeoSolutions</name>
|
|
||||||
<url>http://www.geo-solutions.it</url>
|
|
||||||
</organization>
|
|
||||||
|
|
||||||
<developers>
|
<organization>
|
||||||
<developer>
|
<name>GeoSolutions</name>
|
||||||
<id>etj</id>
|
<url>http://www.geo-solutions.it</url>
|
||||||
<name>Emanuele Tajariol</name>
|
</organization>
|
||||||
<email>etj AT geosolutions.it</email>
|
|
||||||
<organization>GeoSolutions</organization>
|
|
||||||
<organizationUrl>http://www.geo-solutions.it</organizationUrl>
|
|
||||||
<roles>
|
|
||||||
<role>architect</role>
|
|
||||||
<role>developer</role>
|
|
||||||
</roles>
|
|
||||||
<timezone>+1</timezone>
|
|
||||||
</developer>
|
|
||||||
<developer>
|
|
||||||
<id>ccancellieri</id>
|
|
||||||
<name>Carlo Cancellieri</name>
|
|
||||||
<email>carlo.cancellieri AT geosolutions.it</email>
|
|
||||||
<organization>GeoSolutions</organization>
|
|
||||||
<organizationUrl>http://www.geo-solutions.it</organizationUrl>
|
|
||||||
<roles>
|
|
||||||
<role>architect</role>
|
|
||||||
<role>developer</role>
|
|
||||||
</roles>
|
|
||||||
<timezone>+1</timezone>
|
|
||||||
</developer>
|
|
||||||
</developers>
|
|
||||||
|
|
||||||
<licenses>
|
<developers>
|
||||||
<license>
|
<developer>
|
||||||
<name>MIT License</name>
|
<id>etj</id>
|
||||||
<url>http://opensource.org/licenses/mit-license.php</url>
|
<name>Emanuele Tajariol</name>
|
||||||
<distribution>repo</distribution>
|
<email>etj AT geosolutions.it</email>
|
||||||
</license>
|
<organization>GeoSolutions</organization>
|
||||||
</licenses>
|
<organizationUrl>http://www.geo-solutions.it</organizationUrl>
|
||||||
|
<roles>
|
||||||
|
<role>architect</role>
|
||||||
|
<role>developer</role>
|
||||||
|
</roles>
|
||||||
|
<timezone>+1</timezone>
|
||||||
|
</developer>
|
||||||
|
<developer>
|
||||||
|
<id>ccancellieri</id>
|
||||||
|
<name>Carlo Cancellieri</name>
|
||||||
|
<email>carlo.cancellieri AT geosolutions.it</email>
|
||||||
|
<organization>GeoSolutions</organization>
|
||||||
|
<organizationUrl>http://www.geo-solutions.it</organizationUrl>
|
||||||
|
<roles>
|
||||||
|
<role>architect</role>
|
||||||
|
<role>developer</role>
|
||||||
|
</roles>
|
||||||
|
<timezone>+1</timezone>
|
||||||
|
</developer>
|
||||||
|
</developers>
|
||||||
|
|
||||||
<url>http://code.google.com/p/geoserver-manager/</url>
|
<licenses>
|
||||||
|
<license>
|
||||||
|
<name>MIT License</name>
|
||||||
|
<url>http://opensource.org/licenses/mit-license.php</url>
|
||||||
|
<distribution>repo</distribution>
|
||||||
|
</license>
|
||||||
|
</licenses>
|
||||||
|
|
||||||
<issueManagement>
|
<issueManagement>
|
||||||
<system>googlecode</system>
|
<system>GitHub</system>
|
||||||
<url>http://code.google.com/p/geoserver-manager/issues/list</url>
|
<url>https://github.com/geosolutions-it/geoserver-manager/issues</url>
|
||||||
</issueManagement>
|
</issueManagement>
|
||||||
|
|
||||||
<mailingLists>
|
<mailingLists>
|
||||||
<mailingList>
|
<mailingList>
|
||||||
<name>GeoServer Manager User List</name>
|
<name>GeoServer Manager User List</name>
|
||||||
<post>geoserver-manager-users@googlegroups.com </post>
|
<post>geoserver-manager-users@googlegroups.com </post>
|
||||||
<archive>http://groups.google.com/group/geoserver-manager-users/topics</archive>
|
<archive>http://groups.google.com/group/geoserver-manager-users/topics</archive>
|
||||||
</mailingList>
|
</mailingList>
|
||||||
</mailingLists>
|
</mailingLists>
|
||||||
|
|
||||||
<scm>
|
<scm>
|
||||||
<connection>scm:git:[fetch=]https://github.com/geosolutions-it/geoserver-manager.git[push=]git@github.com:geosolutions-it/geoserver-manager.git</connection>
|
<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 -->
|
<url>https://github.com/geosolutions-it/geoserver-manager</url>
|
||||||
<!--tag>master</tag -->
|
</scm>
|
||||||
<url>https://github.com/geosolutions-it/geoserver-manager</url>
|
|
||||||
</scm>
|
|
||||||
|
|
||||||
<ciManagement>
|
<ciManagement>
|
||||||
<system>jenkins</system>
|
<system>jenkins</system>
|
||||||
<url>http://ci.geo-solutions.it/</url>
|
<url>http://build.geo-solutions.it/jenkins/view/GeoServer-manager/</url>
|
||||||
</ciManagement>
|
</ciManagement>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<downloadUrl>http://maven.geo-solutions.it</downloadUrl>
|
<downloadUrl>http://maven.geo-solutions.it</downloadUrl>
|
||||||
<repository>
|
<repository>
|
||||||
<uniqueVersion>false</uniqueVersion>
|
<uniqueVersion>false</uniqueVersion>
|
||||||
<id>geosolutions</id>
|
<id>geosolutions</id>
|
||||||
<url>ftp://maven.geo-solutions.it/</url>
|
<url>ftp://maven.geo-solutions.it/</url>
|
||||||
</repository>
|
</repository>
|
||||||
<site>
|
<site>
|
||||||
<id>demo.geosolutions</id>
|
<id>demo.geosolutions</id>
|
||||||
<url>scp://demo.geo-solutions.it/var/www/share/github/gsman</url>
|
<url>scp://demo.geo-solutions.it/var/www/share/github/gsman</url>
|
||||||
</site>
|
</site>
|
||||||
</distributionManagement>
|
</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> <link>http://commons.apache.org/dbcp/apidocs/</link> <link>http://commons.apache.org/fileupload/apidocs/</link>
|
<!-- <links> <link>http://commons.apache.org/dbcp/apidocs/</link> <link>http://commons.apache.org/fileupload/apidocs/</link>
|
||||||
<link>http://download.oracle.com/javase/6/docs/api</link> </links> -->
|
<link>http://download.oracle.com/javase/6/docs/api</link> </links> -->
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</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>2.6</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>
|
</plugins>
|
||||||
<version>2.2</version> </plugin> -->
|
</reporting>
|
||||||
</plugins>
|
|
||||||
</reporting>
|
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<slf4j.version>1.5.11</slf4j.version>
|
<slf4j.version>1.5.11</slf4j.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
<version>2.0.1</version>
|
<version>2.0.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-httpclient</groupId>
|
<groupId>commons-httpclient</groupId>
|
||||||
<artifactId>commons-httpclient</artifactId>
|
<artifactId>commons-httpclient</artifactId>
|
||||||
<version>3.1</version>
|
<version>3.1</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>commons-logging</groupId>
|
<groupId>commons-logging</groupId>
|
||||||
<artifactId>commons-logging</artifactId>
|
<artifactId>commons-logging</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jdom</groupId>
|
<groupId>jdom</groupId>
|
||||||
<artifactId>jdom</artifactId>
|
<artifactId>jdom</artifactId>
|
||||||
<version>1.1</version>
|
<version>1.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
<version>${slf4j.version}</version>
|
<version>${slf4j.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>jcl-over-slf4j</artifactId>
|
<artifactId>jcl-over-slf4j</artifactId>
|
||||||
<version>${slf4j.version}</version>
|
<version>${slf4j.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- commons-logging can be rather simply and conveniently excluded as
|
<!-- commons-logging can be rather simply and conveniently excluded as
|
||||||
a dependency by declaring it in the provided scope within the pom.xml file
|
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
|
of your project. The actual commons-logging classes would be provided by
|
||||||
jcl-over-slf4j. This translates into the following pom file snippet: -->
|
jcl-over-slf4j.
|
||||||
<!-- <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId>
|
This translates into the following pom file snippet: -->
|
||||||
<version>1.1.1</version> <scope>provided</scope> </dependency> <dependency>
|
<!-- <dependency>
|
||||||
<groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.16</version>
|
<groupId>commons-logging</groupId>
|
||||||
</dependency>
|
<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>-->
|
||||||
|
|
||||||
</dependency>-->
|
<!--================================================================= -->
|
||||||
<!--================================================================= -->
|
<!-- TEST -->
|
||||||
<!-- TEST -->
|
<!--================================================================= -->
|
||||||
<!--================================================================= -->
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<version>4.8.2</version>
|
<version>4.8.2</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-core</artifactId>
|
<artifactId>spring-core</artifactId>
|
||||||
<version>2.5.6.SEC02</version>
|
<version>2.5.6.SEC02</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>commons-logging</groupId>
|
<groupId>commons-logging</groupId>
|
||||||
<artifactId>commons-logging</artifactId>
|
<artifactId>commons-logging</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-log4j12</artifactId>
|
<artifactId>slf4j-log4j12</artifactId>
|
||||||
<version>${slf4j.version}</version>
|
<version>${slf4j.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* GeoServer-Manager - Simple Manager Library for GeoServer
|
* GeoServer-Manager - Simple Manager Library for GeoServer
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007,2013 GeoSolutions S.A.S.
|
* Copyright (C) 2007,2016 GeoSolutions S.A.S.
|
||||||
* http://www.geo-solutions.it
|
* http://www.geo-solutions.it
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* GeoServer-Manager - Simple Manager Library for GeoServer
|
* GeoServer-Manager - Simple Manager Library for GeoServer
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007,2015 GeoSolutions S.A.S.
|
* Copyright (C) 2007 - 2016 GeoSolutions S.A.S.
|
||||||
* http://www.geo-solutions.it
|
* http://www.geo-solutions.it
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
@ -50,8 +50,13 @@ public static final String QUIET_ON_NOT_FOUND_PARAM = "quietOnNotFound=";
|
|||||||
List<RESTStyle> styles = new ArrayList<RESTStyle>();
|
List<RESTStyle> styles = new ArrayList<RESTStyle>();
|
||||||
|
|
||||||
RESTStyle style = reader.getStyle(stylename);
|
RESTStyle style = reader.getStyle(stylename);
|
||||||
if(style != null)
|
|
||||||
styles.add(style);
|
// We don't want geoserver to be lenient here: take only the real global style if it exists
|
||||||
|
if(style != null) {
|
||||||
|
if(style.getWorkspace() == null || style.getWorkspace().isEmpty()) {
|
||||||
|
styles.add(style);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (String workspace : reader.getWorkspaceNames()) {
|
for (String workspace : reader.getWorkspaceNames()) {
|
||||||
style = reader.getStyle(workspace, stylename);
|
style = reader.getStyle(workspace, stylename);
|
||||||
|
|||||||
@ -56,7 +56,7 @@ public abstract class GSAbstractStoreEncoder extends PropertyXMLEncoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return ElementUtils.contains(getRoot(), "name").getTextTrim();
|
return ElementUtils.contains(getRoot(), "type").getTextTrim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package it.geosolutions.geoserver.decoder;
|
package it.geosolutions.geoserver.decoder;
|
||||||
|
|
||||||
import it.geosolutions.geoserver.rest.decoder.RESTLayer;
|
|
||||||
import it.geosolutions.geoserver.rest.decoder.RESTLayer21;
|
import it.geosolutions.geoserver.rest.decoder.RESTLayer21;
|
||||||
import it.geosolutions.geoserver.rest.encoder.authorityurl.GSAuthorityURLInfoEncoder;
|
import it.geosolutions.geoserver.rest.encoder.authorityurl.GSAuthorityURLInfoEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.identifier.GSIdentifierInfoEncoder;
|
import it.geosolutions.geoserver.rest.encoder.identifier.GSIdentifierInfoEncoder;
|
||||||
@ -14,6 +13,8 @@ import junit.framework.Assert;
|
|||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -25,6 +26,8 @@ import org.springframework.core.io.ClassPathResource;
|
|||||||
*/
|
*/
|
||||||
public class LayerDecoder21Test{
|
public class LayerDecoder21Test{
|
||||||
|
|
||||||
|
private final static Logger LOGGER = LoggerFactory.getLogger(LayerDecoder21Test.class);
|
||||||
|
|
||||||
RESTLayer21 layer;
|
RESTLayer21 layer;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
@ -43,7 +46,7 @@ public class LayerDecoder21Test{
|
|||||||
public void testAuthorityURLs() {
|
public void testAuthorityURLs() {
|
||||||
List<GSAuthorityURLInfoEncoder> authorityURLs = layer
|
List<GSAuthorityURLInfoEncoder> authorityURLs = layer
|
||||||
.getEncodedAuthorityURLInfoList();
|
.getEncodedAuthorityURLInfoList();
|
||||||
System.out.println(authorityURLs.size());
|
LOGGER.debug("Number of authority URLs: " + authorityURLs.size());
|
||||||
Assert.assertEquals("authority1", authorityURLs.get(0).getName());
|
Assert.assertEquals("authority1", authorityURLs.get(0).getName());
|
||||||
Assert.assertEquals("http://www.authority1.org", authorityURLs.get(0)
|
Assert.assertEquals("http://www.authority1.org", authorityURLs.get(0)
|
||||||
.getHref());
|
.getHref());
|
||||||
|
|||||||
@ -23,7 +23,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 java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|||||||
@ -21,11 +21,8 @@
|
|||||||
*/
|
*/
|
||||||
package it.geosolutions.geoserver.decoder;
|
package it.geosolutions.geoserver.decoder;
|
||||||
|
|
||||||
import it.geosolutions.geoserver.rest.GeoServerRESTPublisher;
|
|
||||||
import it.geosolutions.geoserver.rest.GeoServerRESTReader;
|
|
||||||
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
||||||
import it.geosolutions.geoserver.rest.decoder.about.GSVersionDecoder;
|
import it.geosolutions.geoserver.rest.decoder.about.GSVersionDecoder;
|
||||||
import it.geosolutions.geoserver.rest.decoder.about.GSVersionDecoder.VERSION;
|
|
||||||
import junit.framework.Assert;
|
import junit.framework.Assert;
|
||||||
|
|
||||||
import org.jdom.Element;
|
import org.jdom.Element;
|
||||||
|
|||||||
@ -64,7 +64,7 @@ public class ConfigTest extends GeoserverRESTTest {
|
|||||||
LOGGER.info("Existing styles: " + reader.getStyles().getNames());
|
LOGGER.info("Existing styles: " + reader.getStyles().getNames());
|
||||||
String basename = FilenameUtils.getBaseName(sldFile.toString());
|
String basename = FilenameUtils.getBaseName(sldFile.toString());
|
||||||
LOGGER.info("Publishing style " + sldFile + " as " + basename);
|
LOGGER.info("Publishing style " + sldFile + " as " + basename);
|
||||||
assertTrue("Cound not publish " + sldFile, publisher.publishStyle(sldFile, basename));
|
assertTrue("Could not publish " + sldFile, publisher.publishStyle(sldFile, basename));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,12 +25,10 @@
|
|||||||
package it.geosolutions.geoserver.rest;
|
package it.geosolutions.geoserver.rest;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import it.geosolutions.geoserver.rest.decoder.RESTLayerGroup;
|
import it.geosolutions.geoserver.rest.decoder.RESTLayerGroup;
|
||||||
import it.geosolutions.geoserver.rest.decoder.utils.NameLinkElem;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|||||||
@ -35,6 +35,9 @@ import it.geosolutions.geoserver.rest.decoder.utils.NameLinkElem;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
|
||||||
@ -44,6 +47,8 @@ import static org.junit.Assert.*;
|
|||||||
*/
|
*/
|
||||||
public class GeoserverRESTReaderTest extends GeoserverRESTTest {
|
public class GeoserverRESTReaderTest extends GeoserverRESTTest {
|
||||||
|
|
||||||
|
private final static Logger LOGGER = LoggerFactory.getLogger(GeoserverRESTReaderTest.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test of getLayers method, of class GeoServerRESTReader.
|
* Test of getLayers method, of class GeoServerRESTReader.
|
||||||
*/
|
*/
|
||||||
@ -56,16 +61,16 @@ public class GeoserverRESTReaderTest extends GeoserverRESTTest {
|
|||||||
// assertEquals(/*CHANGEME*/19, result.getChildren("layer").size()); // value in default gs installation
|
// assertEquals(/*CHANGEME*/19, result.getChildren("layer").size()); // value in default gs installation
|
||||||
|
|
||||||
// System.out.println("Layers:" + result.getChildren("layer").size());
|
// System.out.println("Layers:" + result.getChildren("layer").size());
|
||||||
System.out.println("Layers:" + result.size());
|
LOGGER.debug("Layers: " + result.size());
|
||||||
System.out.print("Layers:" );
|
// LOGGER.debug("Layers:" );
|
||||||
for (NameLinkElem shlayer : result) {
|
for (NameLinkElem shlayer : result) {
|
||||||
assertNotNull(shlayer.getName());
|
assertNotNull(shlayer.getName());
|
||||||
System.out.print(shlayer.getName() + " ");
|
LOGGER.debug(shlayer.getName() + " ");
|
||||||
}
|
}
|
||||||
// for (Element layer : (List<Element>)result.getChildren("layer")) {
|
// for (Element layer : (List<Element>)result.getChildren("layer")) {
|
||||||
// System.out.print(layer.getChildText("name") + " ");
|
// System.out.print(layer.getChildText("name") + " ");
|
||||||
// }
|
// }
|
||||||
System.out.println();
|
LOGGER.debug("");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -79,25 +84,25 @@ public class GeoserverRESTReaderTest extends GeoserverRESTTest {
|
|||||||
assertNotNull(wslist);
|
assertNotNull(wslist);
|
||||||
// assertEquals(7, wslist.size()); // value in default gs installation
|
// assertEquals(7, wslist.size()); // value in default gs installation
|
||||||
|
|
||||||
System.out.println("Workspaces: " + wslist.size());
|
LOGGER.debug("Workspaces: " + wslist.size());
|
||||||
int dsnum = 0;
|
int dsnum = 0;
|
||||||
for (RESTWorkspaceList.RESTShortWorkspace ws : wslist) {
|
for (RESTWorkspaceList.RESTShortWorkspace ws : wslist) {
|
||||||
System.out.println("Getting DSlist for WS " + ws.getName() + "..." );
|
LOGGER.debug("Getting DSlist for WS " + ws.getName() + "..." );
|
||||||
RESTDataStoreList result = reader.getDatastores(ws.getName());
|
RESTDataStoreList result = reader.getDatastores(ws.getName());
|
||||||
assertNotNull(result);
|
assertNotNull(result);
|
||||||
dsnum += result.size();
|
dsnum += result.size();
|
||||||
for (NameLinkElem ds : result) {
|
for (NameLinkElem ds : result) {
|
||||||
assertNotNull(ds.getName());
|
assertNotNull(ds.getName());
|
||||||
System.out.print(ds.getName() + " " );
|
LOGGER.debug(ds.getName() + " " );
|
||||||
RESTDataStore datastore = reader.getDatastore(ws.getName(), ds.getName());
|
RESTDataStore datastore = reader.getDatastore(ws.getName(), ds.getName());
|
||||||
assertNotNull(datastore);
|
assertNotNull(datastore);
|
||||||
assertEquals(ds.getName(), datastore.getName());
|
assertEquals(ds.getName(), datastore.getName());
|
||||||
assertEquals(ws.getName(), datastore.getWorkspaceName());
|
assertEquals(ws.getName(), datastore.getWorkspaceName());
|
||||||
}
|
}
|
||||||
System.out.println();
|
LOGGER.debug("");
|
||||||
}
|
}
|
||||||
System.out.println();
|
LOGGER.debug("");
|
||||||
System.out.println("Datastores:" + dsnum); // value in default gs installation
|
LOGGER.debug("Datastores:" + dsnum); // value in default gs installation
|
||||||
// assertEquals(4, dsnum); // value in default gs installation
|
// assertEquals(4, dsnum); // value in default gs installation
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -116,7 +121,6 @@ public class GeoserverRESTReaderTest extends GeoserverRESTTest {
|
|||||||
// assertEquals(7, wsnames.size()); // value in default gs installation
|
// assertEquals(7, wsnames.size()); // value in default gs installation
|
||||||
|
|
||||||
// System.out.println("Workspaces: " + wslist.size());
|
// System.out.println("Workspaces: " + wslist.size());
|
||||||
int dsnum = 0;
|
|
||||||
int wscnt = 0;
|
int wscnt = 0;
|
||||||
for (RESTWorkspaceList.RESTShortWorkspace ws : wslist) {
|
for (RESTWorkspaceList.RESTShortWorkspace ws : wslist) {
|
||||||
String wsname = wsnames.get(wscnt++);
|
String wsname = wsnames.get(wscnt++);
|
||||||
@ -158,14 +162,14 @@ public class GeoserverRESTReaderTest extends GeoserverRESTTest {
|
|||||||
assertNotNull(names);
|
assertNotNull(names);
|
||||||
assertEquals(names.size(), result.size()); // value in default gs installation
|
assertEquals(names.size(), result.size()); // value in default gs installation
|
||||||
|
|
||||||
System.out.println("Namespaces:" + result.size());
|
LOGGER.debug("Namespaces:" + result.size());
|
||||||
System.out.print("Namespaces:" );
|
LOGGER.debug("Namespaces:" );
|
||||||
int namesIdx = 0;
|
int namesIdx = 0;
|
||||||
for (RESTNamespaceList.RESTShortNamespace ns : result) {
|
for (RESTNamespaceList.RESTShortNamespace ns : result) {
|
||||||
assertEquals("namespace mismatch", names.get(namesIdx++), ns.getName());
|
assertEquals("namespace mismatch", names.get(namesIdx++), ns.getName());
|
||||||
System.out.print(ns.getName() + " " );
|
LOGGER.debug(ns.getName() + " " );
|
||||||
}
|
}
|
||||||
System.out.println();
|
LOGGER.debug("");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -179,12 +183,12 @@ public class GeoserverRESTReaderTest extends GeoserverRESTTest {
|
|||||||
assertNotNull(names);
|
assertNotNull(names);
|
||||||
// assertEquals(7, names.size()); // value in default gs installation
|
// assertEquals(7, names.size()); // value in default gs installation
|
||||||
|
|
||||||
System.out.println("Namespaces:" + names.size());
|
LOGGER.debug("Namespaces:" + names.size());
|
||||||
System.out.print("Namespaces:");
|
LOGGER.debug("Namespaces:");
|
||||||
for (String name : names) {
|
for (String name : names) {
|
||||||
System.out.print(name + " ");
|
LOGGER.debug(name + " ");
|
||||||
}
|
}
|
||||||
System.out.println();
|
LOGGER.debug("");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -198,12 +202,12 @@ public class GeoserverRESTReaderTest extends GeoserverRESTTest {
|
|||||||
assertNotNull(wslist);
|
assertNotNull(wslist);
|
||||||
// assertEquals(7, wslist.size()); // value in default gs installation
|
// assertEquals(7, wslist.size()); // value in default gs installation
|
||||||
|
|
||||||
System.out.println("Workspaces:" + wslist.size());
|
LOGGER.debug("Workspaces:" + wslist.size());
|
||||||
System.out.print("Workspaces:");
|
LOGGER.debug("Workspaces:");
|
||||||
for (RESTWorkspaceList.RESTShortWorkspace ws : wslist) {
|
for (RESTWorkspaceList.RESTShortWorkspace ws : wslist) {
|
||||||
System.out.print(ws.getName() + " ");
|
LOGGER.debug(ws.getName() + " ");
|
||||||
}
|
}
|
||||||
System.out.println();
|
LOGGER.debug("");
|
||||||
|
|
||||||
assertEquals(wslist.size(), reader.getWorkspaceNames().size());
|
assertEquals(wslist.size(), reader.getWorkspaceNames().size());
|
||||||
}
|
}
|
||||||
@ -218,12 +222,12 @@ public class GeoserverRESTReaderTest extends GeoserverRESTTest {
|
|||||||
assertNotNull(names);
|
assertNotNull(names);
|
||||||
// assertEquals(7, names.size()); // value in default gs installation
|
// assertEquals(7, names.size()); // value in default gs installation
|
||||||
|
|
||||||
System.out.println("Workspaces:" + names.size());
|
LOGGER.debug("Workspaces:" + names.size());
|
||||||
System.out.print("Workspaces:");
|
LOGGER.debug("Workspaces:");
|
||||||
for (String name : names) {
|
for (String name : names) {
|
||||||
System.out.print(name + " ");
|
LOGGER.debug(name + " ");
|
||||||
}
|
}
|
||||||
System.out.println();
|
LOGGER.debug("");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* GeoServer-Manager - Simple Manager Library for GeoServer
|
* GeoServer-Manager - Simple Manager Library for GeoServer
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007,2011 GeoSolutions S.A.S.
|
* Copyright (C) 2007 - 2016 GeoSolutions S.A.S.
|
||||||
* http://www.geo-solutions.it
|
* http://www.geo-solutions.it
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
@ -41,7 +41,6 @@ import java.util.List;
|
|||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
import org.jdom.output.EscapeStrategy;
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Rule;
|
import org.junit.Rule;
|
||||||
@ -98,7 +97,7 @@ public abstract class GeoserverRESTTest {
|
|||||||
RESTURL = getenv("gsmgr_resturl", "http://localhost:8080/geoserver");
|
RESTURL = getenv("gsmgr_resturl", "http://localhost:8080/geoserver");
|
||||||
RESTUSER = getenv("gsmgr_restuser", "admin");
|
RESTUSER = getenv("gsmgr_restuser", "admin");
|
||||||
RESTPW = getenv("gsmgr_restpw", "geoserver");
|
RESTPW = getenv("gsmgr_restpw", "geoserver");
|
||||||
GS_VERSION = getenv("gsmgr_version", "2.4");
|
GS_VERSION = getenv("gsmgr_version", "2.8");
|
||||||
|
|
||||||
// These tests will destroy data, so let's make sure we do want to run them
|
// These tests will destroy data, so let's make sure we do want to run them
|
||||||
enabled = getenv("gsmgr_resttest", "false").equalsIgnoreCase("true");
|
enabled = getenv("gsmgr_resttest", "false").equalsIgnoreCase("true");
|
||||||
@ -136,17 +135,17 @@ public abstract class GeoserverRESTTest {
|
|||||||
+ RESTURL);
|
+ RESTURL);
|
||||||
}
|
}
|
||||||
} else if (existgs == false){
|
} else if (existgs == false){
|
||||||
System.out.println("Failing tests : geoserver not found");
|
LOGGER.debug("Failing tests : geoserver not found");
|
||||||
fail("GeoServer not found");
|
fail("GeoServer not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
GSVersionDecoder v=reader.getGeoserverVersion();
|
GSVersionDecoder v=reader.getGeoserverVersion();
|
||||||
if (v.compareTo(VERSION.getVersion(GS_VERSION))!=0){
|
if (v.compareTo(VERSION.getVersion(GS_VERSION))!=0){
|
||||||
System.out.println("Failing tests : geoserver version does not match.\nAccepted versions: "+VERSION.print());
|
LOGGER.debug("Failing tests : geoserver version does not match.\nAccepted versions: "+VERSION.print());
|
||||||
fail("GeoServer version ("+v.getVersion()+") does not match the desired one ("+GS_VERSION+")");
|
fail("GeoServer version ("+v.getVersion()+") does not match the desired one ("+GS_VERSION+")");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
System.out.println("Skipping tests ");
|
LOGGER.debug("Skipping tests ");
|
||||||
LOGGER.warn("Tests are disabled. Please read the documentation to enable them.");
|
LOGGER.warn("Tests are disabled. Please read the documentation to enable them.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* GeoServer-Manager - Simple Manager Library for GeoServer
|
* GeoServer-Manager - Simple Manager Library for GeoServer
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007,2013 GeoSolutions S.A.S.
|
* Copyright (C) 2007 - 2016 GeoSolutions S.A.S.
|
||||||
* http://www.geo-solutions.it
|
* http://www.geo-solutions.it
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
@ -22,20 +22,17 @@
|
|||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package it.geosolutions.geoserver.rest;
|
package it.geosolutions.geoserver.rest;
|
||||||
|
|
||||||
import static it.geosolutions.geoserver.rest.GeoserverRESTTest.publisher;
|
|
||||||
import static it.geosolutions.geoserver.rest.GeoserverRESTTest.reader;
|
|
||||||
import it.geosolutions.geoserver.rest.decoder.RESTStyle;
|
import it.geosolutions.geoserver.rest.decoder.RESTStyle;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import static org.junit.Assert.*;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -44,52 +41,66 @@ import org.springframework.core.io.ClassPathResource;
|
|||||||
*/
|
*/
|
||||||
public class UtilTest extends GeoserverRESTTest {
|
public class UtilTest extends GeoserverRESTTest {
|
||||||
|
|
||||||
private final static Logger LOGGER = LoggerFactory.getLogger(UtilTest.class);
|
private final static Logger LOGGER = LoggerFactory.getLogger(UtilTest.class);
|
||||||
|
|
||||||
|
@Test
|
||||||
@Test
|
public void testSearchStyle() throws IOException {
|
||||||
public void testSearchStyle() throws IOException {
|
if (!enabled()) {
|
||||||
if (!enabled())
|
return;
|
||||||
return;
|
}
|
||||||
deleteAll();
|
deleteAll();
|
||||||
|
|
||||||
final String WORKSPACE = "testWorkspace";
|
final String WORKSPACE = "testWorkspace";
|
||||||
final String STYLENAME = "restteststyle";
|
final String STYLENAME = "restteststyle";
|
||||||
|
|
||||||
File sldFile = new ClassPathResource("testdata/restteststyle.sld").getFile();
|
File sldFile = new ClassPathResource("testdata/restteststyle.sld").getFile();
|
||||||
|
|
||||||
publisher.createWorkspace(WORKSPACE);
|
publisher.createWorkspace(WORKSPACE);
|
||||||
|
|
||||||
assertEquals(0, reader.getStyles().size());
|
assertEquals(0, reader.getStyles().size());
|
||||||
assertEquals(0, reader.getStyles(WORKSPACE).size());
|
assertEquals(0, reader.getStyles(WORKSPACE).size());
|
||||||
assertEquals(0, Util.searchStyles(reader, STYLENAME).size());
|
assertEquals(0, Util.searchStyles(reader, STYLENAME).size());
|
||||||
|
|
||||||
// insert style in workspace
|
// insert style in workspace
|
||||||
assertTrue(publisher.publishStyleInWorkspace(WORKSPACE, sldFile, STYLENAME));
|
assertTrue(publisher.publishStyleInWorkspace(WORKSPACE, sldFile, STYLENAME));
|
||||||
assertTrue(reader.existsStyle(WORKSPACE, STYLENAME));
|
assertTrue(reader.existsStyle(WORKSPACE, STYLENAME));
|
||||||
assertFalse(reader.existsStyle(STYLENAME));
|
|
||||||
assertEquals(0, reader.getStyles().size());
|
// GeoServer returns workspace specific names if hte name is not found as global
|
||||||
assertEquals(1, reader.getStyles(WORKSPACE).size());
|
assertTrue(reader.existsStyle(STYLENAME));
|
||||||
|
|
||||||
|
assertEquals(0, reader.getStyles().size());
|
||||||
|
assertEquals(1, reader.getStyles(WORKSPACE).size());
|
||||||
assertEquals(1, Util.searchStyles(reader, STYLENAME).size());
|
assertEquals(1, Util.searchStyles(reader, STYLENAME).size());
|
||||||
|
|
||||||
// insert global style
|
// insert global style
|
||||||
assertTrue(publisher.publishStyle(sldFile, STYLENAME));
|
assertTrue(publisher.publishStyle(sldFile, STYLENAME));
|
||||||
|
|
||||||
assertTrue(reader.existsStyle(STYLENAME));
|
assertTrue(reader.existsStyle(STYLENAME));
|
||||||
assertTrue(reader.existsStyle(WORKSPACE, STYLENAME));
|
assertTrue(reader.existsStyle(WORKSPACE, STYLENAME));
|
||||||
|
|
||||||
assertEquals(2, Util.searchStyles(reader, STYLENAME).size());
|
for(RESTStyle style : Util.searchStyles(reader, STYLENAME))
|
||||||
|
{
|
||||||
|
LOGGER.debug(style.getWorkspace() + " :: " + style.getName());
|
||||||
|
}
|
||||||
|
|
||||||
assertEquals(1, reader.getStyles().size());
|
// there's a bug in geoserver here: the global style will include workspace info
|
||||||
assertEquals(1, reader.getStyles(WORKSPACE).size());
|
// https://osgeo-org.atlassian.net/browse/GEOS-7498
|
||||||
|
// Commenting out all the concerned test code
|
||||||
|
|
||||||
List<RESTStyle> styles = Util.searchStyles(reader, STYLENAME);
|
// assertEquals(2, Util.searchStyles(reader, STYLENAME).size());
|
||||||
|
//
|
||||||
assertEquals(STYLENAME, styles.get(0).getName());
|
// assertEquals(1, reader.getStyles().size());
|
||||||
assertEquals(null, styles.get(0).getWorkspace()); // first one is the global one, if any
|
// assertEquals(1, reader.getStyles(WORKSPACE).size());
|
||||||
|
//
|
||||||
assertEquals(STYLENAME, styles.get(1).getName());
|
// List<RESTStyle> styles = Util.searchStyles(reader, STYLENAME);
|
||||||
assertEquals(WORKSPACE, styles.get(1).getWorkspace());
|
//
|
||||||
}
|
// assertEquals(STYLENAME, styles.get(0).getName());
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// // assertEquals(null, styles.get(0).getWorkspace()); // first one is the global one, if any
|
||||||
|
//
|
||||||
|
// assertEquals(STYLENAME, styles.get(1).getName());
|
||||||
|
// assertEquals(WORKSPACE, styles.get(1).getWorkspace());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,8 +19,6 @@
|
|||||||
*/
|
*/
|
||||||
package it.geosolutions.geoserver.rest.encoder.coverage;
|
package it.geosolutions.geoserver.rest.encoder.coverage;
|
||||||
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder;
|
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy;
|
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder.ProjectionPolicy;
|
||||||
import it.geosolutions.geoserver.rest.encoder.dimensions.GSCoverageDimensionEncoder;
|
import it.geosolutions.geoserver.rest.encoder.dimensions.GSCoverageDimensionEncoder;
|
||||||
|
|||||||
@ -19,12 +19,6 @@
|
|||||||
*/
|
*/
|
||||||
package it.geosolutions.geoserver.rest.encoder.dimensions;
|
package it.geosolutions.geoserver.rest.encoder.dimensions;
|
||||||
|
|
||||||
import static org.junit.Assert.assertFalse;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import it.geosolutions.geoserver.rest.encoder.feature.GSFeatureTypeEncoder;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import junit.framework.Assert;
|
import junit.framework.Assert;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|||||||
@ -23,14 +23,11 @@ import it.geosolutions.geoserver.rest.GeoServerRESTPublisher;
|
|||||||
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
import it.geosolutions.geoserver.rest.GeoserverRESTTest;
|
||||||
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.RESTResource;
|
|
||||||
import it.geosolutions.geoserver.rest.decoder.about.GSVersionDecoder;
|
|
||||||
import it.geosolutions.geoserver.rest.decoder.about.GSVersionDecoder.VERSION;
|
import it.geosolutions.geoserver.rest.decoder.about.GSVersionDecoder.VERSION;
|
||||||
import it.geosolutions.geoserver.rest.encoder.GSLayerEncoder;
|
import it.geosolutions.geoserver.rest.encoder.GSLayerEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.GSLayerEncoder21;
|
import it.geosolutions.geoserver.rest.encoder.GSLayerEncoder21;
|
||||||
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder;
|
import it.geosolutions.geoserver.rest.encoder.GSResourceEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.authorityurl.GSAuthorityURLInfoEncoder;
|
import it.geosolutions.geoserver.rest.encoder.authorityurl.GSAuthorityURLInfoEncoder;
|
||||||
import it.geosolutions.geoserver.rest.encoder.dimensions.GSCoverageDimensionEncoder;
|
|
||||||
import it.geosolutions.geoserver.rest.encoder.identifier.GSIdentifierInfoEncoder;
|
import it.geosolutions.geoserver.rest.encoder.identifier.GSIdentifierInfoEncoder;
|
||||||
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;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* GeoServer-Manager - Simple Manager Library for GeoServer
|
* GeoServer-Manager - Simple Manager Library for GeoServer
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007,2012 GeoSolutions S.A.S.
|
* Copyright (C) 2007 - 2016 GeoSolutions S.A.S.
|
||||||
* http://www.geo-solutions.it
|
* http://www.geo-solutions.it
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
@ -37,6 +37,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
import org.junit.Ignore;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test datastore handling (create, read and update):
|
* Test datastore handling (create, read and update):
|
||||||
@ -64,9 +65,11 @@ import static org.junit.Assert.*;
|
|||||||
* <li>Test all new values.
|
* <li>Test all new values.
|
||||||
* </ol>
|
* </ol>
|
||||||
*
|
*
|
||||||
|
* @deprecated ignored since dir of shapes cannot be uploaded
|
||||||
* @author Oscar Fonts
|
* @author Oscar Fonts
|
||||||
*/
|
*/
|
||||||
public class GeoserverRESTDatastoreManagerTest extends StoreIntegrationTest {
|
@Ignore
|
||||||
|
public class DirShapeStoreManagerTest extends StoreIntegrationTest {
|
||||||
|
|
||||||
private static final String WS_NAME = DEFAULT_WS;
|
private static final String WS_NAME = DEFAULT_WS;
|
||||||
|
|
||||||
@ -78,7 +81,7 @@ public class GeoserverRESTDatastoreManagerTest extends StoreIntegrationTest {
|
|||||||
|
|
||||||
private static URL LOCATION_2;
|
private static URL LOCATION_2;
|
||||||
|
|
||||||
public GeoserverRESTDatastoreManagerTest() throws Exception {
|
public DirShapeStoreManagerTest() throws Exception {
|
||||||
super(false);
|
super(false);
|
||||||
LOCATION_1 = new URL("file:data/shapefiles/");
|
LOCATION_1 = new URL("file:data/shapefiles/");
|
||||||
LOCATION_2 = new URL("file:data/2");
|
LOCATION_2 = new URL("file:data/2");
|
||||||
@ -104,7 +107,7 @@ public class GeoserverRESTDatastoreManagerTest extends StoreIntegrationTest {
|
|||||||
// Create a directory of spatial files with default parameters
|
// Create a directory of spatial files with default parameters
|
||||||
GSDirectoryOfShapefilesDatastoreEncoder create = new GSDirectoryOfShapefilesDatastoreEncoder(
|
GSDirectoryOfShapefilesDatastoreEncoder create = new GSDirectoryOfShapefilesDatastoreEncoder(
|
||||||
DS_NAME, LOCATION_1);
|
DS_NAME, LOCATION_1);
|
||||||
assertTrue(manager.getStoreManager().create(WS_NAME, create));
|
assertTrue("Could not create create store", manager.getStoreManager().create(WS_NAME, create));
|
||||||
|
|
||||||
// Read the store from server; check all parameter values
|
// Read the store from server; check all parameter values
|
||||||
RESTDataStore read = reader.getDatastore(WS_NAME, DS_NAME);
|
RESTDataStore read = reader.getDatastore(WS_NAME, DS_NAME);
|
||||||
@ -131,14 +134,14 @@ public class GeoserverRESTDatastoreManagerTest extends StoreIntegrationTest {
|
|||||||
update.setCacheAndReuseMemoryMaps(false);
|
update.setCacheAndReuseMemoryMaps(false);
|
||||||
|
|
||||||
// update the store
|
// update the store
|
||||||
assertTrue(manager.getStoreManager().update(WS_NAME, update));
|
assertTrue("Could not update store " + WS_NAME, manager.getStoreManager().update(WS_NAME, update));
|
||||||
|
|
||||||
// Read again, check that all parameters have changed
|
// Read again, check that all parameters have changed
|
||||||
read = reader.getDatastore(WS_NAME, DS_NAME);
|
read = reader.getDatastore(WS_NAME, DS_NAME);
|
||||||
assertEquals(read.getWorkspaceName(), WS_NAME);
|
assertEquals("Bad workspace name", read.getWorkspaceName(), WS_NAME);
|
||||||
assertEquals(read.isEnabled(), false);
|
assertEquals("Datastore should not be enabled", read.isEnabled(), false);
|
||||||
connParams = read.getConnectionParameters();
|
connParams = read.getConnectionParameters();
|
||||||
assertEquals(connParams.get("url"), LOCATION_2.toString());
|
assertEquals("Bad URL", connParams.get("url"), LOCATION_2.toString());
|
||||||
assertEquals(connParams.get("charset"), "UTF-8");
|
assertEquals(connParams.get("charset"), "UTF-8");
|
||||||
assertEquals(connParams.get("create spatial index"), "false");
|
assertEquals(connParams.get("create spatial index"), "false");
|
||||||
assertEquals(connParams.get("memory mapped buffer"), "true");
|
assertEquals(connParams.get("memory mapped buffer"), "true");
|
||||||
@ -26,8 +26,6 @@
|
|||||||
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 static it.geosolutions.geoserver.rest.GeoserverRESTTest.publisher;
|
|
||||||
import static it.geosolutions.geoserver.rest.GeoserverRESTTest.reader;
|
|
||||||
import it.geosolutions.geoserver.rest.decoder.RESTLayer;
|
import it.geosolutions.geoserver.rest.decoder.RESTLayer;
|
||||||
import it.geosolutions.geoserver.rest.decoder.RESTStyle;
|
import it.geosolutions.geoserver.rest.decoder.RESTStyle;
|
||||||
import it.geosolutions.geoserver.rest.decoder.utils.JDOMBuilder;
|
import it.geosolutions.geoserver.rest.decoder.utils.JDOMBuilder;
|
||||||
|
|||||||
@ -33,8 +33,6 @@ import java.io.IOException;
|
|||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,8 +45,6 @@ import org.springframework.core.io.ClassPathResource;
|
|||||||
*/
|
*/
|
||||||
public class GeoserverRESTWorkspaceTest extends GeoserverRESTTest {
|
public class GeoserverRESTWorkspaceTest extends GeoserverRESTTest {
|
||||||
|
|
||||||
private final static Logger LOGGER = LoggerFactory.getLogger(GeoserverRESTWorkspaceTest.class);
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testWorkspaces() {
|
public void testWorkspaces() {
|
||||||
if (!enabled()) return;
|
if (!enabled()) return;
|
||||||
|
|||||||
@ -35,8 +35,6 @@ import org.apache.commons.httpclient.NameValuePair;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.core.io.ClassPathResource;
|
import org.springframework.core.io.ClassPathResource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -48,8 +46,6 @@ import org.springframework.core.io.ClassPathResource;
|
|||||||
*/
|
*/
|
||||||
public class GeoserverRESTWorldImageTest extends GeoserverRESTTest {
|
public class GeoserverRESTWorldImageTest extends GeoserverRESTTest {
|
||||||
|
|
||||||
private final static Logger LOGGER = LoggerFactory.getLogger(GeoserverRESTWorldImageTest.class);
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPublishWorldImage() throws IOException {
|
public void testPublishWorldImage() throws IOException {
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user