Maven SoapUI插件,测试缺少的路径参数

时间:2013-05-10 14:15:07

标签: maven-2 soapui regression-testing

我对Web服务进行了一些回归测试,以确保在缺少必填字段时返回错误。当缺少查询参数(例如http://dummyurl.com?someRequiredParameter=something)时,一切正常。缺少必需的路径参数(例如http://dummyurl.com/requiredPathParameter/somethingelse)时,测试在SoapUI应用程序中正常工作,但从Maven运行时失败。当我尝试查询这些错误的URL时,我看到输出中的错误,但是响应有什么不同(我应该从服务器检查500),还是我需要设置的其他一些断言,以便测试通过SoapUI和Maven?

修改

完整错误是:

16:07:38,672 ERROR [WsdlSubmit] Exception in request: org.apache.commons.httpclient.URIException: escaped absolute path not valid
16:07:38,672 ERROR [SoapUI] An error occured [escaped absolute path not valid], see error log for details
org.apache.commons.httpclient.URIException: escaped absolute path not valid
    at org.apache.commons.httpclient.URI.setRawPath(URI.java:2837)
    at org.apache.commons.httpclient.URI.parseUriReference(URI.java:2023)
    at org.apache.commons.httpclient.URI.<init>(URI.java:147)
    at org.apache.commons.httpclient.HttpMethodBase.getURI(HttpMethodBase.java:265)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:383)
    at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:194)
    at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
    at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(WsdlSubmit.java:76)
    at com.eviware.soapui.impl.rest.RestRequest.submit(RestRequest.java:208)
    at com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep.run(RestTestRequestStep.java:753)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runTestStep(WsdlTestCaseRunner.java:207)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.internalRun(WsdlTestCaseRunner.java:138)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.internalRun(WsdlTestCaseRunner.java:39)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:139)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:679)
16:07:38,673 INFO  [SoapUIProTestCaseRunner] Assertion [Match content of [Fault]] has status UNKNOWN

2 个答案:

答案 0 :(得分:0)

行为应该是一样的。

检查SOAPUI Maven插件生成的日志文件。它包含每个测试的返回码。如果服务器端出现错误,您应该找到500个。

您的测试用例是否已包含检查返回码的断言?

答案 1 :(得分:0)

我最终不得不禁用有问题的测试。看来SoapUI应用程序可以处理丢失的路径参数,但maven插件不能。

如果弹出一个新的答案解释了如何使用SoapUI maven插件测试这个,我会试一试(希望)让它成为接受的答案。