Jersey Test Processor
Download
Source Code:Â https://github.com/testify/JerseyTestProcessor.git
Latest Snapshot:Â Coming Soon
Latest Release:Â Coming Soon
Description
The Jersey Test Processor is a Testify processor service that utilizes the Jersey RESTful Web services framework to send REST messages and store responses. Only one REST message can be sent per test file. To use this processor, write "JerseyTestProcessor" (not case sensitive) in the processor type section of the test file. This processor does not utilize any configuration values but it does have additional required and optional sub-elements that are defined within the test block element and parsed out internally. These sub-elements are broken down below:
Required Elements
Operation
Surrounded by element indicators: <operation></operation>
This defines the rest operation that will be performed. Only one operation can be defined per test file. Supported operations are: DELETE, GET, HEAD, POST, and PUT.
Optional elements
Message Body
Surrounded by element indicators: <body></body>
For certain REST requests a message body is needed. This processor supports a message body for POST and PUT operations.
Media Type
Surrounded by element indicators:Â <media></media>
Many REST requests require a set media type. Only one media type can be defined per test file. Supported media types are: application/json, application/xml, application/octet-stream, text/xml, and multipart/form-data.
Processor Output
In addition to returning a processor response message, the Jersey Test Processor also returns an HTTP status code. If the response includes headers, these will be returned as well.
Example Test Block
Below is an example test block for a POST operation. The text below would be placed in the test block section (as defined by the Testify Test Parser service)Â of the test file.
<operation> POST </operation> <media> text/xml </media> <body> <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns3:metacard xmlns:ns1="http://www.opengis.net/gml" xmlns:ns2="http://www.w3.org/1999/xlink" xmlns:ns3="urn:catalog:metacard" xmlns:ns4="http://www.w3.org/2001/SMIL20/" xmlns:ns5="http://www.w3.org/2001/SMIL20/Language" ns1:id="0d0fc6ae201f4524a1e6d76d2cc32f17"> <ns3:type>metacard</ns3:type> <ns3:source>source</ns3:source> <ns3:dateTime name="effective"> <ns3:value>2013-10-13T06:25:27.270-04:00</ns3:value> </ns3:dateTime> <ns3:stringxml name="metadata"> <ns3:value> Information </ns3:value> </ns3:stringxml> <ns3:dateTime name="created"> <ns3:value>2014-05-28T13:34:08.471-04:00</ns3:value> </ns3:dateTime> <ns3:dateTime name="modified"> <ns3:value>2014-05-28T13:34:08.471-04:00</ns3:value> </ns3:dateTime> <ns3:geometry name="location"> <ns3:value> <ns1:Point> <ns1:pos>0 0</ns1:pos> </ns1:Point> </ns3:value> </ns3:geometry> <ns3:string name="title"> <ns3:value>TestData</ns3:value> </ns3:string> <ns3:base64Binary name="thumbnail"> <ns3:value></ns3:value> </ns3:base64Binary> <ns3:string name="metadata-content-type"> <ns3:value>video</ns3:value> </ns3:string> <ns3:string name="resource-size"> <ns3:value>N/A</ns3:value> </ns3:string> </ns3:metacard> </body>