Forum Discussion

Unibet_Support's avatar
Unibet_Support
Contributor
13 years ago

[Res] Content Assertion not working through JunitRunner?

Hello,
Are there any known issue around content assertion not working when we run soapui project files through junit?
Here is my code

SoapUIMockServiceRunner soapUIMockServiceRunner = new SoapUIMockServiceRunner();
soapUIMockServiceRunner.setBlock(false);

soapUIMockServiceRunner.setProjectFile(getClass().getClassLoader().getResource("project.xml").getPath());
soapUIMockServiceRunner.run();
SoapUITestCaseRunner runner = new SoapUITestCaseRunner();

runner.setProjectFile(getClass().getClassLoader().getResource("project.xml").getPath());

String testFilesDirectoryProperty = System.getProperty("testfilesdirectory");
String[] properties = new String[4];

properties[0] = "ENVIRONMENT=S1";
properties[1] = "SERVER=server.com";
properties[2] = "COMPONENT_PORTBASE=22480";
properties[3] = "testfilesdir=" + testFilesDirectoryProperty;
runner.setProjectProperties(properties);
runner.run();



But i can't see content assertions being asserted when the tests are triggered?

Thanks

2 Replies

  • Hi,

    please try using the SoapUIProTestCaseRunner instead - required for enabling pro-specific features.

    Hope this helps!

    regards,

    /Ole
    SmartBear Software