-
[SoapUI et JUNIT]
Bonjour et bonne année 2011 !
Je cherche à tester des webservices avec l'api SoapUI à travers JUnit.
J'arrive à tester l'appel à mes ws mais je ne sais pas comment avec l'api soapUI récupérer la réponse.
Existe t'il des exemples ou un tutoriel sur l'api SoapUI ?
Ci-dessous le code Java de mon testcase Junit que j'ai écrit à ce jour :
public class TestWebServiceOK extends junit.framework.TestCase {
private WsdlProject _project=null;
private TestSuite _testSuite=null;
private TestCase _aTestCase=null;
private List<TestCase> _listTestCase=null;
protected void tearDown(){
}
protected void setUp() throws Exception
{
this._project = new WsdlProject( "E:/appft/projets SoapUI/Idalion-soapui-project.xml" ); // généré à partir du wsdl sous soapui
this._testSuite = this._project.getTestSuiteByName( "ftIdalion_testSuite" );
this._listTestCase=this._testSuite.getTestCaseList();
}
@Test
public void testCaseRunner() throws Exception
{
// create empty properties and run synchronously
PropertiesMap p=new PropertiesMap();
Iterator<TestCase> it= this._listTestCase.iterator();
while (it.hasNext() ) {
TestCase tc=it.next();
TestCaseRunner tcr=tc.run(p, false); // false = execution synchrone sinon true = asynchrone
assertEquals(tcr.getStatus().toString(),Status.FINISHED.toString());
}
}
}
Merci pour votre aide !