[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/transport/web ...

Tom Elrod tom.elrod at jboss.com
Mon Jul 17 00:54:01 EDT 2006


  User: telrod  
  Date: 06/07/17 00:54:01

  Modified:    src/tests/org/jboss/test/remoting/transport/web 
                        WebInvokerTestClient.java
  Log:
  JBREM-544 - changed http client invoker to throw exception upon web server error by default.  Can be configured to not throw exception and just return as response if desired.
  
  Revision  Changes    Path
  1.11      +17 -1     JBossRemoting/src/tests/org/jboss/test/remoting/transport/web/WebInvokerTestClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: WebInvokerTestClient.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/transport/web/WebInvokerTestClient.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -b -r1.10 -r1.11
  --- WebInvokerTestClient.java	15 Jul 2006 04:40:13 -0000	1.10
  +++ WebInvokerTestClient.java	17 Jul 2006 04:54:01 -0000	1.11
  @@ -25,7 +25,9 @@
   import junit.framework.TestCase;
   import org.jboss.remoting.Client;
   import org.jboss.remoting.InvokerLocator;
  +import org.jboss.remoting.transport.http.HTTPMetadataConstants;
   import org.jboss.remoting.transport.web.WebUtil;
  +import org.jboss.test.remoting.transport.http.WebServerError;
   
   import java.util.HashMap;
   import java.util.Map;
  @@ -116,7 +118,21 @@
      protected void makeExceptionInvocation(Client remotingClient, Map metadata)
            throws Throwable
      {
  -      Object response = remotingClient.invoke(WebInvocationHandler.THROW_EXCEPTION_PARAM, metadata);
  +
  +
  +      Object response = null;
  +      try
  +      {
  +         response = remotingClient.invoke(WebInvocationHandler.THROW_EXCEPTION_PARAM, metadata);
  +         assertTrue("Should have thrown WebServerError and not made it to here.", false);
  +      }
  +      catch (WebServerError error)
  +      {
  +         assertTrue(true);
  +      }
  +
  +      metadata.put(HTTPMetadataConstants.NO_THROW_ON_ERROR, "true");
  +      response = remotingClient.invoke(WebInvocationHandler.THROW_EXCEPTION_PARAM, metadata);
         if(response instanceof Exception)
         {
            System.out.println("Return from invocation is of type Exception as expected.");
  
  
  



More information about the jboss-cvs-commits mailing list