"Seegrid will be due for a migration to confluence on the 1st of August. Any update on or after the 1st of August will NOT be migrated"
-- VictorTey - 25 Jun 2013

SISS Release GeoServer Testing

Overview:

The motivation behind this is to simplify the release of SISS. As part of the requirement when choosing the appropriate release version of Geoserver, we need to test the version of Geoserver against some commonly used filter against a sample NVCL or ERML data. It has always been a hassle doing this manually and takes up to a day to properly deploy, configure and test the Geoserver build across multiple date range. We have simplify this process by automating the work into Jenkin's job.

How it works

The SISS Geoserver tests on https://cgsrv8.arrc.csiro.au/jenkins/view/Deployment-Test/ are set up as part of a normal Jenkins job. Each of the slave machine contains a shell script:
/home/geoserver-deploy/updateGeoServer.sh

that takes in a parameter builddate that builds and deploys the specific Geoserver of that build date into tomcat. Once the specified Geoserver is built and configured, we can then run tests against the service.

The TestRun -XXXX job on Jenkin downloads a small package from the URL below

https://github.com/victortey/ServicePointUnitTester.git

that facilitates the testing of the services. It contains a sepc.xml file in src/main/resource which contains testing parameters.

Configuring the sepc.xml file

<TestService id='Basic Empty Query' url='http://gs-test2.arrc.csiro.au:8080/erml-geoserver-test/wfs'>
      <type>POST</type>
      <postBody>
         <![CDATA[             
<wfs:GetFeature service="WFS" version="1.1.0" xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:er="urn:cgi:xmlns:GGIC:EarthResource:1.1" xmlns:gsml="urn:cgi:xmlns:CGI:GeoSciML:2.0" maxFeatures="50" resultType="results" >
    <wfs:Query typeName="er:MiningFeatureOccurrence" srsName="EPSG:4326">
        <ogc:Filter>
            <ogc:And>
                <ogc:BBOX>
                    <ogc:PropertyName>er:location</ogc:PropertyName>
                    <gml:Envelope srsName="EPSG:4326">
                        <gml:lowerCorner>92.8125 -48.341644 </gml:lowerCorner>
                        <gml:upperCorner>173.75977 1.4061089 </gml:upperCorner>
                    </gml:Envelope>
                </ogc:BBOX>
                <ogc:PropertyIsLike escapeChar="!" wildCard="*" matchCase="false" singleChar="#" >
                    <ogc:PropertyName>er:specification/er:Mine/gml:name</ogc:PropertyName>
                    <ogc:Literal>*</ogc:Literal>
                </ogc:PropertyIsLike>
            </ogc:And>
        </ogc:Filter>
    </wfs:Query>
</wfs:GetFeature>
         ]]>
      </postBody>
      <Test id='1'>         
         <xpath>//gml:featureMembers/er:MiningFeatureOccurrence</xpath>
         <evaluationType>COUNT</evaluationType>
         <expected>50</expected>         
      </Test>      
   </TestService>

A brief explanation on the elements of the config file:
  • ID - a unique id to identify the test series.
  • url - the location of the service to be tested against
  • type - the type of request we are making. Options are POST or GET
  • postBody - the body of the post request. In order for the xml to be parsed "as is" this section has to be encapulated in a CDATA tag.
And below that you have the tests and its condition
  • id - id of the test against the series
  • xpath - xpath of the element to match the test against
  • evaluationType - type of evaluation. Options are COUNT or EVALUATE
  • expected - the expected result

To make any changes:

To create your own tests, simply fork out the repository in github and make the necessary changes then create a job in Jenkins that points to your repository.
Topic revision: r2 - 05 Aug 2013, RiniAngreani
 

Current license: All material on this collaboration platform is licensed under a Creative Commons Attribution 3.0 Australia Licence (CC BY 3.0).