Testing

The easiest way to test your installation is to use it to view your Index Service, by pointing your web browser at http://your-tomcat-host:your-tomcat-port/webmds and clicking on the olink labelled "A list of resources registered to the local default index service".

For more in-depth tests, you can run the WebMDS unit tests, by doing the following:

  1. Install httpunit, version 1.6 or later. Set the environment variable GLOBUS_HTTPUNIT_DIR to the directory into which httpunit has been installed.
  2. Install the WebMDS test package; from the GT4 distribution directory, run

    make gt4-webmds-test
    

  3. Run the core WebMDS test suite. This tests the WebMDS servlet itself, the File XML Source, and the more commonly-used xslt transforms. There are two modes in which this test suite can be run.

    • The core WebMDS tests can be run in a servlet container simulator. This tests the WebMDS code but does not test whether or not WebMDS has been deployed correctly into Tomcat:

      ant -f $GLOBUS_LOCATION/etc/globus_wsrf_mds_webmds_test/build.xml test-installed
      

      The output should look something like this:

      Buildfile: GLOBUS_LOCATION/etc/globus_wsrf_mds_webmds_test/build.xml
      
      test-installed:
          [junit] Running org.globus.mds.webmds.test.PackageTests
          [junit] Running org.globus.mds.webmds.test.SimpleServletTest tests with servlet simulator.
          [junit] No webmds.test.servletURL property specified; skipping org.globus.mds.webmds.test.SimpleServletTest http tests
          [junit] Running org.globus.mds.webmds.test.ServletXslTests tests with servlet simulator.
          [junit] No webmds.test.servletURL property specified; skipping org.globus.mds.webmds.test.ServletXslTests http tests
          [junit] Tests run: 8, Failures: 0, Errors: 0, Time elapsed: 4.516 sec
      
      BUILD SUCCESSFUL
      Total time: 8 seconds
      

    • The core WebMDS tests can be run against a running WebMDS server, to test the local WebMDS deployment:

      ant \
        -f $GLOBUS_LOCATION/etc/globus_wsrf_mds_webmds_test/build.xml \
        "-Dwebmds.test.servletURL=http://webmds_host:webmds_port/webmds/webmds" \
        test-installed
      

      The output should look something like this:

      Buildfile: GLOBUS_LOCATION/etc/globus_wsrf_mds_webmds_test/build.xml
      
      test-installed:
          [junit] Running org.globus.mds.webmds.test.PackageTests
          [junit] Running org.globus.mds.webmds.test.SimpleServletTest tests with servlet simulator.
          [junit] Running org.globus.mds.webmds.test.SimpleServletTest tests against server at http://webmds_host:webmds_port/webmds/webmds
          [junit] Running org.globus.mds.webmds.test.ServletXslTests tests with servlet simulator.
          [junit] Running org.globus.mds.webmds.test.ServletXslTests tests against server at http://webmds_host:webmds_port/webmds/webmds
          [junit] Tests run: 8, Failures: 0, Errors: 0, Time elapsed: 5.229 sec
      
      BUILD SUCCESSFUL
      Total time: 8 seconds
      

    The tests have passed if the number of failures and number of errors are both 0. Detailed test output can be found in the file $GLOBUS_LOCATION/etc/globus_wsrf_mds_webmds_test/test-reports/TEST-org.globus.mds.webmds.test.PackageTests.xml.

  4. Run the WebMDS resource property node source test suite, to test the ability of WebMDS to query a running MDS4 Index Server. This test suite requires that both a secure Index server and an insecure Index server be running. As with the core tests, the resource property tests may be run in two modes.

    • The tests can be run in a servlet container simulator. This tests the WebMDS code, and the interaction between the WebMDS code and running Index servers, but does not test whether or not WebMDS has been deployed correctly into tomcat:

      ant -f \
        $GLOBUS_LOCATION/etc/globus_wsrf_mds_webmds_resource_property_source_test/build.xml \
        "-Dwebmds.rpTest.insecureServicePrefix=http://index_server_host:index_server_port/wsrf/services" \
        "-Dwebmds.rpTest.secureServicePrefix=https://index_server_host:index_server_port/wsrf/services" \
        test-installed
      

      The output should look something like this:

      Buildfile: GLOBUS_LOCATION/etc/globus_wsrf_mds_webmds_resource_property_source_test/build.xml
      
      test-installed:
          [junit] Running org.globus.mds.webmds.xmlSources.resourceProperties.test.PackageTests
          [junit] querying resource properties at 'http://insecure_index_server_host:insecure_index_server_port/wsrf/services/DefaultIndexService'
          [junit] querying resource properties at 'https://secure_index_server_host:secure_index_server_port/wsrf/services/DefaultIndexService'
          [junit] Tests will use Globus servers at https://secure_index_server_host:secure_index_server_port/wsrf/services/DefaultIndexService and http://insecure_index_server_host:insecure_index_server_port/wsrf/services/DefaultIndexService
          [junit] Running org.globus.mds.webmds.xmlSources.resourceProperties.test.ResourcePropertyServletTest tests with servlet simulator.
          [junit] Tests will use Globus servers at https://secure_index_server_host:secure_index_server_port/wsrf/services/DefaultIndexService and http://insecure_index_server_host:insecure_index_server_port/wsrf/services/DefaultIndexService
          [junit] No webmds.test.servletURL property specified; skipping org.globus.mds.webmds.xmlSources.resourceProperties.test.ResourcePropertyServletTest http tests
          [junit] Tests will use Globus servers at https://secure_index_server_host:secure_index_server_port/wsrf/services/DefaultIndexService and http://insecure_index_server_host:insecure_index_server_port/wsrf/services/DefaultIndexService
          [junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 6.626 sec
      
      BUILD SUCCESSFUL
      Total time: 10 seconds
      

    • To run an end-to-end test that tests the communication between a deployed WebMDS server and running index servers, do the following:

      ant -f \
        $GLOBUS_LOCATION/etc/globus_wsrf_mds_webmds_resource_property_source_test/build.xml \
        "-Dwebmds.rpTest.insecureServicePrefix=http://insecure_index_server_host:index_server_port/wsrf/services" \
        "-Dwebmds.rpTest.secureServicePrefix=https://secure_index_server_host:index_server_port/wsrf/services" \
        "-Dwebmds.test.servletURL=http://webmds_host:webmds_port/webmds/webmds" \
        test-installed
      

      The output should look something like this:

      Buildfile: GLOBUS_LOCATION/etc/globus_wsrf_mds_webmds_resource_property_source_test/build.xml
      
      test-installed:
          [junit] Running org.globus.mds.webmds.xmlSources.resourceProperties.test.PackageTests
          [junit] querying resource properties at 'http://insecure_index_server_host:insecure_index_server_port/wsrf/services/DefaultIndexService'
          [junit] querying resource properties at 'https://secure_index_server_host:secure_index_server_port/wsrf/services/DefaultIndexService'
          [junit] Tests will use Globus servers at https://secure_index_server_host:secure_index_server_port/wsrf/services/DefaultIndexService and http://insecure_index_server_host:insecure_index_server_port/wsrf/services/DefaultIndexService
          [junit] Running org.globus.mds.webmds.xmlSources.resourceProperties.test.ResourcePropertyServletTest tests with servlet simulator.
          [junit] Tests will use Globus servers at https://secure_index_server_host:secure_index_server_port/wsrf/services/DefaultIndexService and http://insecure_index_server_host:insecure_index_server_port/wsrf/services/DefaultIndexService
          [junit] Running org.globus.mds.webmds.xmlSources.resourceProperties.test.ResourcePropertyServletTest tests against server at http://webmds_host:webmds_port/webmds/webmds
          [junit] Tests will use Globus servers at https://secure_index_server_host:secure_index_server_port/wsrf/services/DefaultIndexService and http://insecure_index_server_host:insecure_index_server_port/wsrf/services/DefaultIndexService
          [junit] Tests run: 5, Failures: 0, Errors: 0, Time elapsed: 7.041 sec
      
      BUILD SUCCESSFUL
      Total time: 10 seconds
      

    The tests have passed if the number of failures and number of errors are both 0. Detailed test output can be found in the file $GLOBUS_LOCATION/etc/globus_wsrf_mds_webmds_resource_property_source_test/test-reports/TEST-org.globus.mds.webmds.xmlSources.resourceProperties.test.PackageTests.xml.