soapui groovy脚本中的空指针异常

时间:2015-06-12 13:48:17

标签: groovy soapui

我收到此空指针异常,不知道如何解析/调试它。该脚本包含一个包含两个方法的类。代码正在做它应该做的事情。关于geeting的任何指针都开始解决这个问题了吗?

 java.lang.NullPointerException
    at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:154)
    at com.eviware.soapui.model.testsuite.TestStep$run.call(Unknown Source)
    at Script48.run(Script48.groovy:22)
    at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:92)
    at com.eviware.soapui.impl.wsdl.teststeps.assertions.basic.GroovyScriptAssertion.assertScript(GroovyScriptAssertion.java:116)
    at com.eviware.soapui.impl.wsdl.teststeps.assertions.basic.GroovyScriptAssertion.internalAssertResponse(GroovyScriptAssertion.java:128)
    at com.eviware.soapui.impl.wsdl.teststeps.WsdlMessageAssertion.assertResponse(WsdlMessageAssertion.java:150)
    at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequest.assertResponse(WsdlTestRequest.java:176)
    at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.propertyChange(WsdlTestRequestStep.java:339)
    at com.eviware.soapui.impl.wsdl.support.assertions.AssertionsSupport.propertyChange(AssertionsSupport.java:79)
    at java.beans.PropertyChangeSupport.fire(Unknown Source

脚本看起来像这样。

import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner
    import com.eviware.soapui.support.types.StringToObjectMap
    import com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext


    context.setProperty("searchChange", new searchChange())
    class searchChange{

        def search(a,b,TCRunner){

            def search_TestCase = TCRunner.testCase.testSuite.getTestCaseByName("TestCaseName")
              search_TestCase.setPropertyValue("a", a)
              search_TestCase.setPropertyValue("b", b)
              search_TestCase.run(new com.eviware.soapui.support.types.StringToObjectMap(), false)

            }


        def runner(tCase,mExchange){

                     new WsdlTestCaseRunner( tCase, new StringToObjectMap() );


            }


    }

使用上面的类时,抛出异常的代码中的行(groovy:22)是

scripts.testCases["Library"].testSteps["Lib"].run(context.getTestRunner(),context)

0 个答案:

没有答案