Forum Discussion

rodgersh's avatar
rodgersh
Occasional Contributor
15 years ago

SoapUITestCaseRunner and multiple projects

I am trying to automate my project's nightly build process to run all of our soapUI projects during out nightly build on Jenkins.

We have roughly 20 individual soapUI projects. I have written a JUnit test class that has a test case for each soapUI project (e.g., testSoapUIPorject1(), testSoapUIProject2, etc.) Each of these JUnit test cases instantiates a new SoapUITestCaseRunner, sets that runner's global properties, project filename, and project properties, and then calls runner.run()

This JUnit test class also has @BeforeClass, @Before, and @After methods in it to do one time setup, and setup/teardown per JUnit test case (typical JUnit lifecycle). I also have println statements in each method (including the individual test case methods) to trace execution order.

What I am seeing when I run my JUnit test class is that the @BeforeClass method executes, then @Before method, then the first JUnit test case method runs - and then SoapUITestCaseRunner takes over and runs *all* of my soapUI project files (in the order specified by the JUnit test case methods), but the @Before, @After, and remaining JUnit test case methods are not executed. It's not that my soapUI projects are not executed, it's that mu setup and teardown methods per JUnit test case are never executed again.

An example:

I have soapUI project1 and project2
My JunitTestClass has methods oneTimeSetup(), setup(), teardown(), testProject1(), and testProject2().

Expected execution order would be:
oneTimeSetup()
setup()
testProject1() //creates new SoapUITestCaseRunner
teardown()
setup()
testProject2() //creates new SoapUITestCaseRunner
teardown()

But actual execution order is:
oneTimeSetup()
setup()
testProject1()
testProject2()


And if I have 10 soapUI projects (with the associated 10 JUnit test case methods) and I put @Ignore on a couple of them, the first testProject1() method that executes honors the @Ignore annotations, knowing which soapUI projects to run and which not to run.

Can anyone help me understand why this is happening?

Thank you.
No RepliesBe the first to reply