"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"

Integration test suite for SISSvoc3

Tests for SISSvoc3 interface.

Test module

The following module provides a set of tests which tests the Elda configuration file.

What you need:

Instructions

  • Check out both Elda source and Elda Test Module.
  • The test module is based on Elda source Revision: 7a4083ecb090b61ab15e1115849d9875302b0896.
  • To check out this revision, run the following HG (mercurial) command:
    hg clone --rev 7a4083ecb090b61ab15e1115849d9875302b0896 --verbose -- https://code.google.com/p/elda/ <ELDA_LOCATION_PLEASE_CHANGE_THIS>
  • Once you have checked out the Elda Test Module, copy the folder "elda-testing-config" into the Elda source folder.
  • Modify the root pom.xml of Elda Source and under <modules>, include a new module:
    <module>elda-testing-config</module>
  • Build Elda source by opening a command prompt window, navigating to the elda source folder, and typing the following command:
    mvn install
  • Once the built is successful, navigate to the folder "elda-testing-config". In here, to run the test module execute the following command in the command line:
    mvn integratation-test
  • Once the test runs successfully, you should see the following in your command prompt:
    -------------------------------------------------------
    T E S T S
    -------------------------------------------------------
    Running com.epimorphics.lda.systemtest.EldaConfigTests
    Check response status: 200
    Check response status: 200
    Check response status: 200
    Check response status: 200
    Check response status: 200
    Check response status: 200
    Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.423 sec
    
    Results :
    
    Tests run: 6, Failures: 0, Errors: 0, Skipped: 0
    
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 26.608s
    [INFO] Finished at: Fri Dec 09 17:43:31 WST 2011
    [INFO] Final Memory: 11M/28M
    [INFO] ------------------------------------------------------------------------
    
         
Note: there should be 0 Failures to include all tests has passed.

Deliberately failing a test

To deliberately fail a test, open the configuration file located at \elda-testing-config\src\main\webapp\specs\InternationalStratigraphicChart2009-ELDAConfig.ttl and change the following:
## 2. List of concept collections - basic-view     
<#collectionEndpoint> a api:ListEndpoint ;
      api:uriTemplate "/isc/collection" ;
      api:selector [
         api:where " {?item rdf:type ?type ; ?label ?l  } FILTER ( ?type = skos:Collection || ?type = skos:OrderedCollection ) FILTER ( ?label = dc:title || ?label = rdfs:label || ?label = skos:prefLabel || ?label = skos:altLabel )";
      ] ;
      
      . 

To:
## 2. List of concept collections - basic-view     
<#collectionEndpoint> a api:ListEndpoint ;
      api:uriTemplate "/isc/collection" ;
      api:selector [
         api:where " {?item rdf:type ?type ; ?labeii ?l  } FILTER ( ?type = skos:Collection || ?type = skos:OrderedCollection ) FILTER ( ?label = dc:title || ?label = rdfs:label || ?label = skos:prefLabel || ?label = skos:altLabel )";
      ] ;
      
      . 

Note: We are just making a spelling error, "label" to "labeii" in the api:selector.

Now rerun the test module (run the command mvn integration-test), we should get the following error:
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.epimorphics.lda.systemtest.EldaConfigTests
Check response status: 200
Check response status: 200
Check response status: 200
Check response status: 200
Check response status: 200
Check response status: 200
Tests run: 6, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.39 sec <<< FAILURE!

Results :

Failed tests:   testGetCollection(com.epimorphics.lda.systemtest.EldaConfigTests)

Tests run: 6, Failures: 1, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.096s
[INFO] Finished at: Fri Dec 09 17:41:45 WST 2011
[INFO] Final Memory: 11M/28M
[INFO] ------------------------------------------------------------------------ 

Remember to change the configuration file back to exclude the spelling error once you are done with this.

Test dataset

https://www.seegrid.csiro.au/subversion/xmml/ontologies/TBCME/GeologicTimeScale/isc-test.ttl

Tests and results

URI response comment
{root}/resource?uri=http%3A%2F%2Fresource.geosciml.org%2Fclassifierscheme%2Fics%2Fischart%2F2009    
{root}/resource?uri=http%3A%2F%2Fresource.geosciml.org%2Fclassifier%2Fics%2Fischart%2FEras    
{root}/resource?uri=http%3A%2F%2Fresource.geosciml.org%2Fclassifier%2Fics%2Fischart%2FLudlow    
{root}/resource?uri=http%3A%2F%2Fresource.geosciml.org%2Fclassifier%2Fics%2Fischart%2FBaseLudlow    
{root}/conceptscheme    
{root}/collection    
{root}/orderedcollection    
{root}/concept    
{root}/concept?_lang=fr    
{root}/concept?label=Pal%C3%A9ozo%C3%AFque   UTF-8 percent encoded form of Paléozoïque
{root}/concept?label=%D0%9F%D0%B0%D0%BB%D0%B5%D0%BE%D0%B7%D0%BE%D0%B9
  UTF-8 percent encoded form of Палеозой
{root}/concept?notation=a1.1    
{root}/concept/broader?uri=http%3A%2F%2Fresource.geosciml.org%2Fclassifier%2Fics%2Fischart%2FLudlow  
{root}/concept/narrower?uri=http%3A%2F%2Fresource.geosciml.org%2Fclassifier%2Fics%2Fischart%2FLudlow  
{root}/concept/broader?label=Ludford    
{root}/concept/narrower?label=Wenlock    
{root}/concept/narrower?label=Ludford   empty result
{root}/concept/broaderTransitive?label=Ludford   requires inferencing SPARQL engine
{root}/concept/narrowerTransitive?label=Silurian   requires inferencing SPARQL engine
-- SimonCox - 30 Nov 2011
Topic revision: r22 - 28 Feb 2012, JacquelineGithaiga
 

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