使用java代码

时间:2016-07-11 00:44:59

标签: java groovy soapui

我有一个SoapUI项目,它有一个测试步骤,从一个groovy脚本开始,它记录了所有剩余的测试步骤。如果我们通过SoapUI客户端这样做,这工作正常。

但是当我使用下面的Stackoverflow答案中描述的Java代码运行它时失败了:How to run soapUI tests from Java [Resolved]

Groovy脚本无法签署所有测试步骤,但测试继续运行。

  

10:42:20,100 ERROR [SoapUI]发生错误[未找到匹配项],请参阅   错误日志以获取详细信息java.lang.IllegalStateException:未找到匹配项     在java.util.regex.Matcher.group(Matcher.java:497)at   com.eviware.soapui.support.GroovyUtils.extractErrorLineNumber(GroovyUtils.java:145)     在   com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:172)     在   com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:235)     在   com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)     在   com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:148)     在   com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:43)     在   com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)     在   com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.start(AbstractTestRunner.java:77)     在   com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:640)     在Test.main(Test.java:69)   org.codehaus.groovy.control.MultipleCompilationErrorsException:   启动失败:Script1.groovy:7:无法解析课程   au.gov.mca.uhi.security.util.XMLSigner @ line 1,第1列.import   au.gov.mca.uhi.security.util.XMLSigner; ^   org.codehaus.groovy.syntax.SyntaxException:无法解析类   au.gov.mca.uhi.security.util.XMLSigner @第7行,第1栏   org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:146)     在   org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1145)     在   org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:141)     在   org.codehaus.groovy.control.CompilationUnit $ 10.call(CompilationUnit.java:632)     在   org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:912)     在   org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:574)     在   org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:523)     在   groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:279)     在   groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:258)     在groovy.lang.GroovyShell.parseClass(GroovyShell.java:613)at at   groovy.lang.GroovyShell.parse(GroovyShell.java:625)at   groovy.lang.GroovyShell.parse(GroovyShell.java:652)at   groovy.lang.GroovyShell.parse(GroovyShell.java:643)at   com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:148)     在   com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:93)     在   com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:149)     在   com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:235)     在   com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)     在   com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:148)     在   com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:43)     在   com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)     在   com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.start(AbstractTestRunner.java:77)     在   com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.run(WsdlTestCase.java:640)     在Test.main(Test.java:69)

我们有没有办法运行一个测试步骤,这是一个带有Java代码的soapUI项目中的一个groovy脚本。

My Maven依赖项:

 <dependency>
    <groupId>com.github.redfish4ktc.soapui</groupId>
    <artifactId>maven-soapui-extension-plugin</artifactId>
    <version>4.6.4.0</version>
</dependency>
<dependency>
    <groupId>net.java.dev.jgoodies</groupId>
    <artifactId>looks</artifactId>
    <version>2.1.4</version>
</dependency>
<dependency>
    <groupId>net.sf.squirrel-sql.thirdparty-non-maven</groupId>
    <artifactId>com-fifesoft-rsyntaxtextarea</artifactId>
    <version>1.0.0</version>
</dependency>
<dependency>
    <groupId>org.apache.karaf.eik.plugins</groupId>
    <artifactId>org.apache.commons.collections</artifactId>
    <version>3.2.1</version>
</dependency>
<dependency>
    <groupId>org.jomc</groupId>
    <artifactId>jomc-cli</artifactId>
    <version>1.0</version>
</dependency>

0 个答案:

没有答案