-
Notifications
You must be signed in to change notification settings - Fork 2
/
Unstable-Endpoint-SoapUI-project.xml
54 lines (43 loc) · 11.4 KB
/
Unstable-Endpoint-SoapUI-project.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?xml version="1.0" encoding="UTF-8"?>
<con:soapui-project id="aef08a4c-61ba-4ec2-b9ce-8ee26d2f4601" activeEnvironment="Default" name="RepeatPluginTestStepProject" soapui-version="5.3.0" abortOnError="false" runType="SEQUENTIAL" resourceRoot="" xmlns:con="http://eviware.com/soapui/config"><con:settings/><con:interface xsi:type="con:RestService" id="3fd6e36d-3922-4b5e-8603-def77d2994a1" wadlVersion="http://wadl.dev.java.net/2009/02" name="http://05ten.se" type="rest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:settings/><con:definitionCache type="TEXT" rootPart=""/><con:endpoints><con:endpoint>http://localhost:8080</con:endpoint></con:endpoints><con:resource name="" path="/everyTime" id="2db14a08-097b-4bcd-876a-077ff04e4480"><con:settings/><con:parameters/><con:method name="1" id="f5747d39-59cc-476a-9999-2e082dec3c83" method="GET"><con:settings/><con:parameters/><con:representation type="FAULT"><con:mediaType>text/html; charset=UTF-8</con:mediaType><con:status>404</con:status><con:params/><con:element>html</con:element></con:representation><con:representation type="FAULT"><con:mediaType>application/xml</con:mediaType><con:status>404</con:status><con:params/></con:representation><con:representation type="RESPONSE"><con:mediaType>application/xml</con:mediaType><con:status>200</con:status><con:params/></con:representation><con:representation type="FAULT"><con:mediaType>text/html</con:mediaType><con:status>404</con:status><con:params/><con:element>html</con:element></con:representation><con:representation type="RESPONSE"><con:mediaType>text/html</con:mediaType><con:status>200</con:status><con:params/><con:element>html</con:element></con:representation><con:representation type="RESPONSE"><con:mediaType>text/html; charset=UTF-8</con:mediaType><con:status>200</con:status><con:params/><con:element>html</con:element></con:representation><con:representation type="RESPONSE"><con:mediaType>text/html; charset=iso-8859-1</con:mediaType><con:status>200</con:status><con:params/><con:element>html</con:element></con:representation><con:representation type="RESPONSE"><con:mediaType xsi:nil="true"/><con:status>0</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="RESPONSE"><con:mediaType xsi:nil="true"/><con:status>0</con:status><con:params/><con:element>data</con:element></con:representation><con:request name="Request 1" id="a496670d-3c27-4561-a0b4-eaaea35f03e4" mediaType="application/json"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:endpoint>http://localhost:8080</con:endpoint><con:request/><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters/></con:request></con:method></con:resource></con:interface><con:testSuite id="a96857a7-1c6d-4985-adb7-0a373599fafb" name="UnstableTestsSuite"><con:settings/><con:runType>SEQUENTIAL</con:runType><con:testCase id="8c406e06-852d-4f82-a35d-d50801a893ec" failOnError="false" failTestCaseOnErrors="true" keepSession="false" maxResults="0" name="UnstableEndpointTestCase" searchProperties="true" timeout="0" wsrmEnabled="false" wsrmVersion="1.0" wsrmAckTo="" amfAuthorisation="false" amfEndpoint="" amfLogin="" amfPassword=""><con:settings/><con:testStep type="restrequest" name="works_every_time_sometimes" id="8fdf39d2-3f87-4062-9bd6-60f9e10f09f7"><con:settings/><con:config service="http://05ten.se" methodName="1" resourcePath="/everyTime" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:restRequest name="works_every_time_sometimes" id="07a88f8a-d0b5-4173-8907-5e3cf98afc56" mediaType="application/json"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost:8080/everyTime</con:endpoint><con:request/><con:originalUri>http://05ten.se/</con:originalUri><con:assertion type="Invalid HTTP Status Codes" id="d0c61b3d-d545-4992-b3cf-db9e162ea525" name="Invalid HTTP Status Codes"><con:configuration><codes>404</codes></con:configuration></con:assertion><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters/></con:restRequest></con:config></con:testStep><con:testStep type="restrequest" name="works_every_third_time" id="75eed4dc-3f7e-4f69-b967-5353ad61715d"><con:settings/><con:config service="http://05ten.se" methodName="1" resourcePath="/everyTime" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:restRequest name="works_every_third_time" id="26d11699-732f-41e7-b86e-c20172b98b7e" mediaType="application/json"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost:8080/everyThirdTime</con:endpoint><con:request/><con:originalUri>http://05ten.se/bananananannananan</con:originalUri><con:assertion type="Invalid HTTP Status Codes" id="1bf122b2-b431-4fe4-8bdd-497dde85a9fd" name="Invalid HTTP Status Codes"><con:configuration><codes>404</codes></con:configuration></con:assertion><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters/></con:restRequest></con:config></con:testStep><con:testStep type="RepeatTestStep" name="Repeat Three Times" id="d42eb921-e855-41f1-b251-5b2ef660d69c"><con:settings/><con:config><maxAttempts>2</maxAttempts><targetTestStep>works_every_time_sometimes</targetTestStep></con:config></con:testStep><con:testStep type="restrequest" name="works_every_third_time2" id="f848423f-9085-45ea-bd3f-8e923571c5d4"><con:settings/><con:config service="http://05ten.se" methodName="1" resourcePath="/everyTime" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:restRequest name="works_every_third_time2" id="9cffec81-2d21-47b8-8a57-455a5a00a547" mediaType="application/json"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost:8080/everyThirdTime</con:endpoint><con:request/><con:originalUri>http://localhost/everyThirdTime/everyTime</con:originalUri><con:assertion type="Invalid HTTP Status Codes" id="df774d61-1142-4ebb-8ac3-a8ca5668fcb3" name="Invalid HTTP Status Codes"><con:configuration><codes>404</codes></con:configuration></con:assertion><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters/></con:restRequest></con:config></con:testStep><con:testStep type="RepeatTestStep" name="repeat_twice" id="26e823d0-9e2a-4fe5-b033-f9f6947ddf13"><con:settings/><con:config><maxAttempts>4</maxAttempts><targetTestStep>works_every_third_time2</targetTestStep></con:config></con:testStep><con:testStep type="restrequest" name="works_every_time" id="cc034f79-367d-441b-b049-d1e64006b35d"><con:settings/><con:config service="http://05ten.se" resourcePath="/everyTime" methodName="1" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:restRequest name="works_every_time" id="a496670d-3c27-4561-a0b4-eaaea35f03e4" mediaType="application/json"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:endpoint>http://localhost:8080/everyTime</con:endpoint><con:request/><con:originalUri>http://localhost/everyTime/everyTime</con:originalUri><con:assertion type="Invalid HTTP Status Codes" id="c397287f-d61b-429e-bf97-3e9d11f32575" name="Invalid HTTP Status Codes"><con:configuration><codes>404</codes></con:configuration></con:assertion><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters/></con:restRequest></con:config></con:testStep><con:setupScript>testCase.getProject().getRestMockServiceList().get(0).start()</con:setupScript><con:tearDownScript>testCase.getProject().getRestMockServiceList().get(0).getMockRunner().stop()</con:tearDownScript><con:properties/></con:testCase><con:properties/></con:testSuite><con:restMockService id="319df5b4-8777-424a-8580-97e346aa437b" port="8080" path="/" host="TSELSE3499083" name="UnstableService"><con:settings/><con:properties/><con:restMockAction name="/everyThirdTime" method="GET" resourcePath="/everyThirdTime" id="fdb5d7b6-c72f-4cd5-9b84-f184959efae0"><con:settings/><con:defaultResponse>Response 1</con:defaultResponse><con:dispatchStyle>SEQUENCE</con:dispatchStyle><con:dispatchPath/><con:response name="Fail" id="471ed0d8-1b7f-4184-82df-77bca523ca71" httpResponseStatus="404" mediaType="text/html"><con:settings/><con:responseContent>FAIL</con:responseContent></con:response><con:response name="Fail2" id="b142adaa-2350-4473-8e58-72f8896d05eb" httpResponseStatus="404" mediaType="text/html"><con:settings/><con:responseContent>FAIL2</con:responseContent></con:response><con:response name="Success" id="01503f3a-c131-42c4-b426-79a10814e6ac" httpResponseStatus="200" mediaType="text/html"><con:settings/><con:responseContent>SUCCESS!</con:responseContent></con:response></con:restMockAction><con:restMockAction name="/everyTime" method="GET" resourcePath="/everyTime" id="76607ad6-abb7-42f5-a2df-ba88a4844daa"><con:settings/><con:defaultResponse>alwaysWorks</con:defaultResponse><con:dispatchStyle>SEQUENCE</con:dispatchStyle><con:dispatchPath>/*
// Script dispatcher is used to select a response based on the incoming request.
// Here are few examples showing how to match based on path, query param, header and body
// Match based on path
def requestPath = mockRequest.getPath()
log.info "Path: "+ requestPath
if( requestPath.contains("json") )
{
// return the name of the response you want to dispatch
return "JSON Response"
}
// Match based on query parameter
def queryString = mockRequest.getRequest().getQueryString()
log.info "QueryString: " + queryString
if( queryString.contains("stockholm") )
{
// return the name of the response you want to dispatch
return "Response Stockholm"
}
else if( queryString.contains("london") )
{
// return the name of the response you want to dispatch
return "Response London"
}
// Match based on header
def acceptEncodingHeaderList = mockRequest.getRequestHeaders().get("Accept-Encoding")
log.info "AcceptEncoding Header List: " + acceptEncodingHeaderList
if( acceptEncodingHeaderList.contains("gzip,deflate") )
{
// return the name of the response you want to dispatch
return "GZiped Response"
}
// Match based on body
def requestBody = mockRequest.getRequestContent()
log.info "Request body: " + requestBody
if( requestBody.contains("some data") )
{
// return the name of the response you want to dispatch
return "Response N"
}
*/
</con:dispatchPath><con:response name="alwaysWorks" id="b258e11f-643b-4bc8-a16b-22a3b1e33712" httpResponseStatus="200" mediaType="text/html"><con:settings/><con:responseContent>SUCCESS AS ALWAYS!</con:responseContent></con:response></con:restMockAction></con:restMockService><con:properties/><con:wssContainer/><con:oAuth2ProfileContainer/><con:oAuth1ProfileContainer/><con:sensitiveInformation/></con:soapui-project>