-
Notifications
You must be signed in to change notification settings - Fork 19
Building and testing
You can build the whole GeoBatch application using maven.
By default no action will be built nor packaged inside the war file; you have to explicitly list the set of actions you want to include using maven profiles.
For instance, if you want to include the geotiff
action (an action that optimizes geotiffs and publish them as a layer into GeoServer), the shapefile
action (an action that ingest a shapefile in geoserver and publish it as a layer), and the imagemosaic
action (an action that ingests into geoserver a set of geotiffs publishing the whole as a mosaic, optionally with time and/or elevation dimensions associated), you'll have to issue the command
mvn install -Pgeotiff,shapefile,imagemosaic
Profiles are used to include services in the build as well. There are 3 services at the moment: jmx
, jms
, octave
, rest
.
If you want to include all of the available actions and services you can define the all
sysvar when launching maven:
mvn clean install -Dall
Please note that you can perform your intermediate builds and tests inside your preferred IDE, but in order to be sure that GeoBatch will build under any platform, including the Jenkins CI environment, you must run the maven build instruction on the command line.
Particular care has to be taken when testing a release or testing the build process after a complex refactoring. In these cases you'll have to specify the -Dall
sysvar in order to force the build for every available piece of code.
Since GeoBatch is quite complex, some tests should be performed on a running instance. The recommended servlet container is Apache Tomcat, so final tests should be performed running GeoBatch inside a Tomcat container, anyway as a first testing step it could be easier to run GeoBatch inside Jetty, using the configured maven-jetty-plugin:
cd /YOUR/GB/WORKING/DIR/src/web/app
mvn -Dall jetty:run
Note:
As of https://github.com/geosolutions-it/geobatch/issues/197, you have to run
mvn jetty:run-exploded
in order to run GeoBatch with jetty. Please update the related doc.
When booting, GB will show you any configuration or dependency issue.
If there are no problems during GeoBatch boot, next step is to test every single action.
Each action has at least one sample flow and the related config dirs in src/main/resources/data
.
Such sample files for all the selected actions (either by -Pactionname
or by -Dall
) are copied into the war file in WEB-INF/data
.
You'll have to edit a bit the sample files to fit your installation (for instance, setting the proper URL, username and password for the target GeoServer instance while editing configuration files for actions geotiff
or shapefile
), and then run the sample flows by copying test files into the related watch dir.
As said above, the final tests should be performed in Apache Tomcat. So you should run GeoBatch in a Tomcat instance and test the single actions in this environment.