Forum Discussion

sridharaiyer's avatar
10 years ago

JUnit soapuitestcaserunner blanks out the property values

Hi All,
Kindly help me resolve this issue. When I use the JUnit soapuitestcaserunner to set some property values in my soap project and run the test, surprisingly it blanks out the values in my soap project xml and the test fails.

IDE - Eclipse Kepler
SOAPUI Open source source jar v5.1.2
MAVEN DEPENDENCY -
  <dependency>
<groupId>com.smartbear.soapui</groupId>
<artifactId>soapui-maven-plugin</artifactId>
<version>5.1.2</version>
</dependency>


Operating System: Win 7

Soap request before JUnit runs:
<tran:UniqueTransactionID>${#Project#UniqueID}</tran:UniqueTransactionID>
<tran:PrimaryInsuranceCompanyID>CCCT</tran:PrimaryInsuranceCompanyID>
<tran:CCCId code="039002951"/>
<tran:LossReferenceID>${#Project#UniqueID}</tran:LossReferenceID>


JUnit:
 
@Test
public void createAssignment() throws Exception {
String uniqueID = "soaptest1234";
String soapProjPath = "soapproj.xml";
SoapUITestCaseRunner runner = new SoapUITestCaseRunner();
runner.setProjectFile(soapProjPath);
String properties[] = {"UniqueID = " + uniqueID};
runner.setProjectProperties(properties);
System.out.println(runner.getProjectProperties()[0]); //I get this
runner.run();
}


The test fails due to fault request.

Soap request after the JUnit run:
<tran:UniqueTransactionID/>
<tran:PrimaryInsuranceCompanyID>CCCT</tran:PrimaryInsuranceCompanyID>
<tran:CCCId code="039002951"/>
<tran:LossReferenceID/>


As you can see, the tran:UniqueTransactionID and tran:LossReferenceID have blanked out.
No RepliesBe the first to reply