Forum Discussion

Sonalee's avatar
Sonalee
Occasional Contributor
8 years ago

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();

 

    • Sonalee's avatar
      Sonalee
      Occasional Contributor

      Hi  Rao,

       

      Thanks for your quick  reply . The link  which  you  have provided I have gone through  this.  I have written  the similar piece of code to  run the  xml  .

       

      SoapUITestCaseRunner runner = new SoapUITestCaseRunner();

                  // Set xml path
                  runner.setProjectFile((String) detail.get("testcasepath"));

                  // Set output folder
                  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) {

                      LOGGER.error("Execution failed due to : ");
                      e1.printStackTrace();
                  }

       

      But the issue  here is the test  cases is running fine when running from a standalone program but  while invoking the same program from a webapplication  the  JBOSS server is getting stuck  at that  point.  Server is not  responding no more.We need to  restart  the server again to  respond as usual.

      • nmrao's avatar
        nmrao
        Champion Level 3
        test case runner can be run, of course, as standalone program either from command line etc.

        What is the relationship with jboss (hope your service might be running there)?