Forum Discussion

msimmerson's avatar
msimmerson
Occasional Contributor
14 years ago

JUnit & SOAP UI

Hi

I am running SOAPUI 4.0.1.

I have a number of projects that have one or more test suites in them. Some of these tests use mock services to provide response and 2 of these mock services provide a number of response in a sequence order. In the SOAP UI GUI, I can run all the tests as frequently and quickly as I like. However, running the same tests from JUnit (under Eclipse) causes the mock services to send out of sequence mock responses causing my tests to fail as there are assertions that are applied to the responses.

I am not sure why this happens, but it would be great if there is a setting or similar that I need to alter when running from JUnit. In my JUnit setupBeforeClass() method I have the following line to load the Workspace (which in turn starts all the mock services).

workspace = new WorkspaceImpl("default-soapui-workspace.xml", new StringToStringMap());

All my projects etc are then accessed through the various methods provided by WorkspaceImpl.

Help would be appreciated.

Cheers

Matt

2 Replies

  • Hi Matt,

    hmm.. how are you starting the MockServices before running these tests? Can you perhaps share the entire test source with us?

    regards,

    /Ole
    SmartBear Software
  • msimmerson's avatar
    msimmerson
    Occasional Contributor
    Hi

    The JUnit test source has been uploaded as TestMiddleware.txt (for some reason it won't allow the .java extension). There are several test methods that depend on the order of the mock service responses namely

    testConnectionNotificationService
    testProvisionNotificationService

    Also, the mock services for testConnectionNotificationService and testProvisionNotificationService provide a provide basic authentication over https interface.

    Cheers

    Matt