Forum Discussion

heyroth's avatar
heyroth
New Contributor
12 years ago

Project LoadScript fails in Jenkins environment

The following code from a project load script works fine in the soapui GUI-environment

Project="TRON-WLP3"
TestSuite="000-ProjectSetup"
TestCase="ProjectSetup"

log.info "Project Load Script $project"
def projectSetupTestSuite = project.getTestSuiteByName ('000-ProjectSetup')
log.info projectSetupTestSuite
def projectSetupTestCase = projectSetupTestSuite.getTestCaseByName ('ProjectSetup')
log.info projectSetupTestCase

projectSetupTestCase.run (null, false)

It generates the following output:

Mon Oct 21 11:53:25 CEST 2013:INFO:Project Load Script com.eviware.soapui.impl.wsdl.WsdlProjectPro@2467ea
Mon Oct 21 11:53:25 CEST 2013:INFO:com.eviware.soapui.impl.wsdl.WsdlTestSuitePro@1a482df
Mon Oct 21 11:53:25 CEST 2013:INFO:com.eviware.soapui.impl.wsdl.WsdlTestCasePro@1d8631f

When run via Jenkins it generates an exception and starts the rest of the project or a requested TestSuite or TestCase anyway.

Gestartet durch Benutzer anonymous
Building in workspace /opt/testrun/.jenkins/jobs/TRON-WLP3-SoapUI-TestCase-Test/workspace
Using master perforce client: lbwls2test-testrun-jenkins
[workspace] $ p4 workspace -o lbwls2test-testrun-jenkins
Clear workspace includes .repository ...
Quickly cleaning workspace...
[workspace] $ p4 -d /opt/testrun/.jenkins/jobs/TRON-WLP3-SoapUI-TestCase-Test/workspace -x- have
Workspace is clean.
Clean complete, took 883 ms
Last build changeset: 78905
[workspace] $ p4 changes -s submitted -m 1 //...
[workspace] $ p4 -s changes -s submitted //lbwls2test-testrun-jenkins/...@78906,@78906
[workspace] $ p4 describe -s 78906
[workspace] $ p4 -G where //...
[workspace] $ p4 -s users heyroth
[workspace] $ p4 user -o heyroth
Sync'ing workspace to changelist 78906 (forcing sync of unchanged files).
[workspace] $ p4 -s sync -f //lbwls2test-testrun-jenkins/...@78906
Sync complete, took 5144 ms
[workspace] $ mvn -f workspace/p4/appl/main/tron/test/soapUI/pom.xml -Denvironment=tron2tst -DprojectDir=TRON-WLP3-soapui-project -DtestSuite=686-RMS-ConsumerScore -DtestCase=RmsStatusCode_EXP200 -fn clean resources:resources
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Online-Tron-SoapUI Test Module 0.5.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ parent ---
[INFO] Deleting /opt/testrun/.jenkins/jobs/TRON-WLP3-SoapUI-TestCase-Test/workspace/workspace/p4/appl/main/tron/test/soapUI/target
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-cli) @ parent ---
[debug] execute contextualize
[WARNING] File encoding has not been set, using platform encoding ISO-8859-1, i.e. build is platform dependent!
[WARNING] Using platform encoding (ISO-8859-1 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 3 resources
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.875s
[INFO] Finished at: Mon Oct 21 11:46:21 CEST 2013
[INFO] Final Memory: 4M/247M
[INFO] ------------------------------------------------------------------------
[workspace] $ /bin/sh -xe /tmp/hudson7842364200382452802.sh
+ cd workspace/p4/appl/main/tron/test/soapUI
+ unset DISPLAY
+ ./soapui-testrun-generic.sh -Genvironment=tron2tst -I projects/TRON-WLP3-soapui-project -s686-RMS-ConsumerScore -cRmsStatusCode_EXP200
================================
=
= SOAPUI_HOME = /opt/testrun/opt/SmartBear/soapuiPro
=
================================
soapUI Pro 4.6.0-m-SNAPSHOT TestCase Runner
- Setting global property [environment] to [tron2tst]
- Setting global property [PropertiesDirectory] to [/opt/testrun/.jenkins/jobs/TRON-WLP3-SoapUI-TestCase-Test/workspace/workspace/p4/appl/main/tron/test/soapUI/]
11:46:22,190 INFO [SoapUI] Adding [/opt/testrun/opt/SmartBear/soapuiPro/bin/ext/ojdbc6.jar] to extensions classpath
11:46:22,190 INFO [SoapUI] Adding [/opt/testrun/opt/SmartBear/soapuiPro/bin/ext/postgresql-8.3-604.jdbc4.jar] to extensions classpath
11:46:22,190 INFO [SoapUI] Adding [/opt/testrun/opt/SmartBear/soapuiPro/bin/ext/postgresql-8.3-604.jdbc3.jar] to extensions classpath
11:46:22,190 INFO [SoapUI] Adding [/opt/testrun/opt/SmartBear/soapuiPro/bin/ext/sqljdbc.jar] to extensions classpath
11:46:22,191 INFO [SoapUI] Adding [/opt/testrun/opt/SmartBear/soapuiPro/bin/ext/jsch.jar] to extensions classpath
11:46:22,453 INFO [DefaultSoapUICore] initialized soapui-settings from [/opt/testrun/.jenkins/jobs/TRON-WLP3-SoapUI-TestCase-Test/workspace/workspace/p4/appl/main/tron/test/soapUI/target/classes/soapui-settings.xml]
11:46:22,644 INFO [SoapUIProGroovyScriptEngineFactory] Setting Script Library to [/opt/testrun/.jenkins/jobs/TRON-WLP3-SoapUI-TestCase-Test/workspace/workspace/p4/appl/main/tron/test/soapUI/src]
11:46:22,644 INFO [DefaultSoapUICore] Adding listeners from [/opt/testrun/opt/SmartBear/soapuiPro/bin/listeners/demo-listeners.xml]

11:46:33,370 INFO [WsdlProject] Loaded project from [file:/opt/testrun/.jenkins/jobs/TRON-WLP3-SoapUI-TestCase-Test/workspace/workspace/p4/appl/main/tron/test/soapUI/projects/TRON-WLP3-soapui-project/]
11:46:33,401 INFO [SoapUIProGroovyScriptEngineFactory] Setting Script Library to [/opt/testrun/.jenkins/jobs/TRON-WLP3-SoapUI-TestCase-Test/workspace/workspace/p4/appl/main/tron/test/soapUI/src]

11:46:46,155 INFO [log] Project Load Script com.eviware.soapui.impl.wsdl.WsdlProjectPro@3fb2d7df
11:46:46,307 INFO [log]
11:46:46,316 ERROR [SoapUI] An error occured [Cannot invoke method getTestCaseByName() on null object], see error log for details
java.lang.NullPointerException: Cannot invoke method getTestCaseByName() on null object
at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:77)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:32)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at Script1.run(Script1.groovy:4)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:96)
at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SourceFile:89)
at com.eviware.soapui.impl.wsdl.WsdlProject.runAfterLoadScript(WsdlProject.java:1511)
at com.eviware.soapui.impl.wsdl.WsdlProject.afterLoad(WsdlProject.java:565)
at com.eviware.soapui.impl.wsdl.WsdlProjectPro.loadProject(SourceFile:295)
at com.eviware.soapui.impl.wsdl.WsdlProject.<init>(WsdlProject.java:244)
at com.eviware.soapui.impl.wsdl.WsdlProjectPro.<init>(SourceFile:155)
at com.eviware.soapui.impl.wsdl.WsdlProjectProFactory.createNew(SourceFile:32)
at com.eviware.soapui.impl.wsdl.WsdlProjectProFactory.createNew(SourceFile:16)
at com.eviware.soapui.tools.SoapUITestCaseRunner.runRunner(SoapUITestCaseRunner.java:337)
at com.eviware.soapui.tools.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:158)
at com.eviware.soapui.tools.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:89)
at com.eviware.soapui.SoapUIProTestCaseRunner.main(SourceFile:58)

...

Finished: SUCCESS


Is this and error or due to misuage?

3 Replies

  • nmrao's avatar
    nmrao
    Icon for Champion Level 1 rankChampion Level 1
    Note that if you are a licensed user, please keep positing your queries under soapui pro boards for quicker resolution.

    Coming to the issue, it is difficult to traceout the reason with the available details.


    Would you please tell if you are able to run the project using $SOAPUI_HOME/bin/testrunner.sh script without any issue?
    How are you running the soapui project from jenkins? using any maven or using testrunner?
  • heyroth's avatar
    heyroth
    New Contributor
    Tried to recreate the problem with by isolation just the project load script and the initialization testsuite - couldn't. So it's best to close this issue until it reappears and I can reproduce it.

    Since we have a more urgent problem, i would need to know how to register or re-register as a soapui-pro user for the soapui-pro bugs. I talked to our software management guy and he can't remember having received a note saying "by the way, this is your user and password for the pro section".

    What do I have to do to be able to post in the pro section?

    Cheers

    Uwe