tests/code/README.txt
author bergi <bergi@axolotlfarm.org>
Thu, 17 Nov 2011 16:47:19 +0100
changeset 188 fd0df255e988
permissions -rw-r--r--
Marked optional test cases in diagram
     1 	WebID Test Suite
     2 
     3 1. About
     4 This test suite dynamicly creates functional and broken WebIDs with
     5 different characteristics. These WebIDs are used to login at the defined
     6 endpoint. The endpoint should return EARL triples like defined in the
     7 following vocabular:
     8 www.w3.org/2005/Incubator/webid/earl/RelyingParty#
     9 For every test case a SPARQL query is defined to check whether the endpoint
    10 acts as expected or not.
    11 
    12 2. Requirements
    13 The source code is maintend in a subversion repository. To build the test
    14 suite from the sources you will need a subversion client. A JDK version 5
    15 or above is required to build the project. Also Maven is required for
    16 building and fetching all required libraries from the web.
    17 
    18 2.1. Requirements for FileFOAFPublisher (optional)
    19 You should use the embedded web server. With the FileFOAFPublisher you
    20 depend on the HTTP Server which could send for example corrupted headers!!
    21 If you still want to use it a HTTP server with local files access is
    22 required.
    23 
    24 3. Compiling the test suite
    25 With the command line subversion client you can check out the code with
    26 the following command:
    27 "svn co https://www.axolotlfarm.org/svn/bergi/bergnet/java/tests/webid/trunk/ WebIDTestSuite".
    28 To compile the code with maven run: "mvn compile".
    29 
    30 4. Configuration of the test suite
    31 The file "default.properties" contains all default settings. Usually that
    32 should work for you. But if you need to change something, the file contains
    33 comments about all parameters.  
    34 
    35 5. Running the tests
    36 Use the exec:java plugin to run the test suite. Here an example: 
    37 "mvn exec:java -Dexec.mainClass=org.bergnet.test.webid.WebIDTests -Dexec.args="-endpoint https://foafssl.org/test/WebId/n3 -stayalive -outputformat TTL" -X".
    38 See the Command line parameters section for more details.
    39 
    40 5.1. Command line parameters
    41 Every parameter begins with a minus like "-example". If an additional
    42 argument is required it must follow separated by space. Here is a list of
    43 all parameters:
    44 
    45 	-config $: Alernative configuration file
    46 		default: -config default.properties
    47 		example: -config example.properties
    48 
    49 	-criterions: Outputs the description of the EARL tests
    50 		default: not set
    51 		example: -criterions
    52 
    53 	-outputformat $: Defines the triple output format ("RDF/XML" or "TTL")
    54 		default: -outputformat RDF/XML
    55 		example: -outputforamt TTL
    56 
    57 	-endpoint $: Url to the endpoint you want to test
    58 		default: see properties file
    59 		example: -endpoint https://foafssl.org/test/WebId/n3
    60 
    61 	-baseurl $: The base directory where your FOAF will be published
    62 		(only host and port is used for embedded Jetty server)
    63 		default: -baseurl http://localhost:8080/
    64 		example: -baseurl http://mypc:1234/
    65 
    66 	-stayalive: Program doesn't terminate after tests are finished
    67 		(if	you want to access the files from the embedded server)
    68 		default: not set
    69 		example: -stayalive
    70 
    71 5.2. Repeating and verifying a test with curl
    72 You can use curl to repeat a test. The output folder contains the
    73 certificate (webid.pem) for every test case. So you just have to type:
    74 "curl -k -E webid.pem:password -H "Accept: text/turtle" https://foafssl.org/test/WebId/n3 > out.n3"