Issue while Running SOAPUI xml from Java in a container like Jboss Server
I am trying to run the SOAP UI project xml from the Java end and that java project is a web application that has been deployed in Jboss server. The SOAPUI xml is running for the first time and report is generating but the server is getting hanged after that .. and also it is not allowing to do any successive run . I am closing the SOAPUI Thread also completely. Please find the code snippet which I have written for this.
//SOAPUI xml file path set here
runner.setProjectFile((String) detail.get("testcasepath"));
runner.setOutputFolder(filePath + timeStamp);
// Executing the xml and generating the report
runner.setJUnitReport(true);
runner.setPrintReport(true);
try {
LOGGER.error("Run Started");
runner.run();
} catch (Exception e1) {
System.out.println("Execution failed due to : ");
e1.printStackTrace();
}
}
// Need to shutdown all the threads invoked by each SoapUI TestSuite
SoapUI.getThreadPool().shutdown();
try {
SoapUI.getThreadPool().awaitTermination(1, TimeUnit.MINUTES);
} catch (InterruptedException e) {
e.printStackTrace();
}
// Now to shutdown the monitor thread setup by SoapUI
Thread[] tarray = new Thread[Thread.activeCount()];
Thread.enumerate(tarray);
for (Thread t : tarray) {
if (t instanceof SoapUIMultiThreadedHttpConnectionManager.IdleConnectionMonitorThread) {
((SoapUIMultiThreadedHttpConnectionManager.IdleConnectionMonitorThread) t)
.shutdown();
}
}
// Finally Shutdown SoapUI itself.
SoapUI.shutdown();