Forum Discussion

666666's avatar
666666
Occasional Contributor
11 years ago

maven-soapui-plugin: JUnit report not always generated

Hello,

As you may be aware from reading my other thread here, I am running the open source maven-soapui-plugin from within Java test cases that use Selenium WebDriver. I have stumbled into the following issue: Sometimes, even though SoapUI execution is successful, I am not getting any results output.

My test cases generate maven commands like this one:
mvn eviware:maven-soapui-plugin:test -DjunitReport=true -DexportAll=true "-DprojectFile=/var/lib/jenkins/jobs/example/workspace/soapui-suites/SuiteOne-soapui-project.xml" "-DoutputFolder=target/soapui-reports/Example_case" "-DtestSuite=Test suite" "-DtestCase=Test case"

This command will run successfully - the test will end with FINISHED status and the output directory I specified will be created containing both the JUnit result from testing and what exportAll generates. I will also run more commands like that one and they will all succeed. They use the same project (because my test java classes are grouped by SoapUI project).

Later in the same execution, however, I will run tests from another project. The command is generated using the same template and will look like this:
mvn eviware:maven-soapui-plugin:test -DjunitReport=true -DexportAll=true "-DprojectFile=/var/lib/jenkins/jobs/example/workspace/soapui-suites/Project-v7_7-soapui-example-example.xml" "-DoutputFolder=target/soapui-reports/Example_Example" "-DtestSuite=example suite" "-DtestCase=Example Example"

Now, this command will succeed as well -- the test will be found and the status will ultimately be FINISHED. So far no difference with the first example. However, there will be absolutely no output in any directory. There is no error message and soapui-errors.log will be empty. It must have something to do with the projects themselves, for it is always the same tests that fail. In the commands I have provided above I have naturally removed any information that is related to the actual projects we use but I have kept the same capitalization and use of underscores and other signs that may have some relation with the issue. I think this may be an issue as I used to have problems executing the project files when they contained spaces.

This is the console output of a test that ended up in FINISHED status and had JUnit report created

[INFO] --- maven-soapui-plugin:4.5.1:test (default-cli) @ example ---
soapUI 4.5.1 Maven2 TestCase Runner
17:16:47,772 WARN [SoapUI] Missing folder [/var/lib/jenkins/jobs/asda-quick-test/workspace/./ext] for external libraries
17:16:47,773 INFO [DefaultSoapUICore] Creating new settings at [/var/lib/jenkins/soapui-settings.xml]
17:16:48,617 INFO [WsdlProject] Loaded project from [file:/var/lib/jenkins/jobs/example/workspace/soapui-suites/ABCD-v7_7-an-example-name.xml]
17:16:49,135 INFO [SoapUITestCaseRunner] Running soapUI tests in project [ABC Project]
17:16:49,135 INFO [SoapUITestCaseRunner] Running TestCase [example test 1]
17:16:49,140 INFO [SoapUITestCaseRunner] Running soapUI testcase [example test 1]
17:16:49,162 INFO [SoapUITestCaseRunner] running step [clear cookies]
17:16:49,472 INFO [SoapUITestCaseRunner] running step [get Sample level 1]
17:16:49,704 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
17:16:49,704 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: GET /s/609/?client_id=9876f70c-c708-41ca-9053-15eca3e89c76&format=json&levels=1 HTTP/1.1
17:16:49,831 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 200 OK
17:16:49,837 DEBUG [HttpClientSupport$SoapUIHttpClient] Connection can be kept alive for 20000 MILLISECONDS
17:16:49,963 INFO [SoapUITestCaseRunner] Finished running soapUI testcase [example test 1], time taken: 585ms, status: FINISHED
17:16:49,966 INFO [SoapUITestCaseRunner] TestCase [example test 1] finished with status [FINISHED] in 585ms

SoapUI 4.5.1-SNAPSHOT TestCaseRunner Summary
-----------------------------
Time Taken: 831ms
Total TestSuites: 0
Total TestCases: 1 (0 failed)
Total TestSteps: 2
Total Request Assertions: 0
Total Failed Assertions: 0
Total Exported Results: 2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.369s
[INFO] Finished at: Thu Sep 05 17:16:49 EEST 2013
[INFO] Final Memory: 20M/159M
[INFO] ------------------------------------------------------------------------


Command was:

mvn eviware:maven-soapui-plugin:test -DjunitReport=true -DexportAll=true "-DprojectFile=/var/lib/jenkins/jobs/example/workspace/soapui-suites/ABCD-v7_7-an-example-name.xml" "-DoutputFolder=target/soapui-reports/example_test_1" "-DtestSuite=ABC Project" "-DtestCase=example test 1"


This is the console output of a test that ended up being FINISHED but did NOT generate output files:

[INFO] --- maven-soapui-plugin:4.5.1:test (default-cli) @ example ---
soapUI 4.5.1 Maven2 TestCase Runner
17:13:10,717 WARN [SoapUI] Missing folder [/var/lib/jenkins/jobs/example/./ext] for external libraries
17:13:10,718 INFO [DefaultSoapUICore] Creating new settings at [/var/lib/jenkins/soapui-settings.xml]
17:13:11,571 INFO [WsdlProject] Loaded project from [file:/var/lib/jenkins/jobs/example/workspace/suites/Test-AAA-example-project.xml]
17:13:12,115 INFO [SoapUITestCaseRunner] Running soapUI tests in project [Test-AAA-example-project]
17:13:12,115 INFO [SoapUITestCaseRunner] Running TestCase [Test and test]
17:13:12,141 INFO [SoapUITestCaseRunner] Running soapUI testcase [Test and test]
17:13:12,142 INFO [SoapUITestCaseRunner] running step [Test and test]
17:13:12,798 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
17:13:12,799 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: GET /s/Example-Ex/ab/cd/v7_7/test_search/ex//?client_id=6736f70c-c708-98ca-9053-98eca3e99c76&format=json&sort=name_desc&q=test HTTP/1.1
17:13:14,640 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 200 OK
17:13:14,646 DEBUG [HttpClientSupport$SoapUIHttpClient] Connection can be kept alive for 20000 MILLISECONDS
17:13:15,560 INFO [SoapUITestCaseRunner] Finished running soapUI testcase [Test and test], time taken: 2574ms, status: FINISHED
17:13:15,560 INFO [SoapUITestCaseRunner] TestCase [Test and test] finished with status [FINISHED] in 2574ms

SoapUI 4.5.1-SNAPSHOT TestCaseRunner Summary
-----------------------------
Time Taken: 3444ms
Total TestSuites: 0
Total TestCases: 1 (0 failed)
Total TestSteps: 1
Total Request Assertions: 0
Total Failed Assertions: 0
Total Exported Results: 1


Command was:

mvn eviware:maven-soapui-plugin:test -DjunitReport=true -DexportAll=true "-DprojectFile=/var/lib/jenkins/jobs/example/workspace/suites/Test-AAA-example-project.xml" "-DoutputFolder=target/soapui-reports/Test_and_test" "-DtestSuite=Test" "-DtestCase=Test and test"


Any help would be greatly appreciated.
Thank you.

2 Replies

  • 666666's avatar
    666666
    Occasional Contributor
    Hello again,

    I found the solution to the problem: all test cases I thought I had no output from had their project's resourceRoot property set to ${projectDir}. Obviously, this setting changes the base directory that is used when a path is constructed using maven-soapui-plugin's outputFolder setting. So the results for such projects were to be found inside the directory where the check out was made to and not the target folder.

    Removing the resourceRoot property's value caused the correct relative path to be used and results were gathered as expected.