You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2002/05/01 16:20:39 UTC

cvs commit: xml-axis/java/test/concurrency TestApplicationScope.java

gdaniels    02/05/01 07:20:39

  Modified:    java/test/concurrency TestApplicationScope.java
  Log:
  Add logging to display some detail when errors occur...
  
  Revision  Changes    Path
  1.2       +19 -1     xml-axis/java/test/concurrency/TestApplicationScope.java
  
  Index: TestApplicationScope.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/concurrency/TestApplicationScope.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestApplicationScope.java	22 Apr 2002 18:06:54 -0000	1.1
  +++ TestApplicationScope.java	1 May 2002 14:20:39 -0000	1.2
  @@ -64,6 +64,9 @@
   import org.apache.axis.client.Call;
   import org.apache.axis.client.Service;
   import org.apache.axis.AxisFault;
  +import org.apache.axis.MessageContext;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
   
   /**
    * Test the "application" scope option - lots of threads call the same service
  @@ -73,6 +76,9 @@
    * @author Glen Daniels (gdaniels@apache.org)
    */
   public class TestApplicationScope extends TestCase {
  +    protected static Log log =
  +        LogFactory.getLog(TestApplicationScope.class.getName());
  +
       private BasicServerConfig config;
       private AxisServer server;
       private String SERVICE_NAME = "TestService";
  @@ -114,8 +120,20 @@
               for (int i = 0; i < reps; i++) {
                   try {
                       String ret = (String)call.invoke("hello", null);
  +                    if (ret == null) {
  +                        MessageContext msgContext = call.getMessageContext();
  +                        String respStr = msgContext.getResponseMessage().getSOAPPart().getAsString();
  +
  +                        String reqStr = msgContext.getRequestMessage().getSOAPPart().getAsString();
  +                        log.fatal("Got null response! Request message:\r\n" + reqStr + "\r\n\r\n" +
  +                                  "Response message:\r\n" + respStr);
  +                    }
                       if (!ret.equals(TestService.MESSAGE)) {
  -                        setError(new Exception("Messages didn't match!"));
  +                        setError(new Exception("Messages didn't match (got '" +
  +                                               ret +
  +                                               "' wanted '" +
  +                                               TestService.MESSAGE +
  +                                               "'!"));
                           return;
                       }
                   } catch (AxisFault axisFault) {