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

Tom Elrod tom.elrod at jboss.com
Mon Jan 22 11:41:16 EST 2007


  User: telrod  
  Date: 07/01/22 11:41:16

  Modified:    src/tests/org/jboss/test/remoting/byvalue 
                        ByValueInvocationTestCase.java
  Log:
  JBREM-683 - fixed broken test.
  
  Revision  Changes    Path
  1.6       +30 -9     JBossRemoting/src/tests/org/jboss/test/remoting/byvalue/ByValueInvocationTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ByValueInvocationTestCase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/byvalue/ByValueInvocationTestCase.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- ByValueInvocationTestCase.java	7 Jul 2006 20:50:13 -0000	1.5
  +++ ByValueInvocationTestCase.java	22 Jan 2007 16:41:16 -0000	1.6
  @@ -38,14 +38,11 @@
    */
   public class ByValueInvocationTestCase extends TestCase
   {
  -   public ByValueInvocationTestCase(String name)
  -   {
  -      super(name);
  -   }
  +   private Connector connector = null;
   
  -   public static void setupConfiguration(InvokerLocator locator, ServerInvocationHandler invocationHandler) throws Exception
  +   public void setupConfiguration(InvokerLocator locator, ServerInvocationHandler invocationHandler) throws Exception
      {
  -      Connector connector = new Connector();
  +      connector = new Connector();
         connector.setInvokerLocator(locator.getLocatorURI());
         connector.start();
         connector.addInvocationHandler("mock", invocationHandler);
  @@ -57,8 +54,10 @@
                                                     InvokerLocator.BYVALUE + "=" + Boolean.TRUE.toString());
         ServerInvocationHandler invocationHandler = new MockServerInvocationHandler();
   
  +      try
  +      {
         // set up
  -      ByValueInvocationTestCase.setupConfiguration(locator, invocationHandler);
  +         setupConfiguration(locator, invocationHandler);
   
         Thread.sleep(3000);
   
  @@ -81,18 +80,30 @@
            assertTrue("Result of testByValue was not even of type Boolean.", false);
         }
         remotingClient.disconnect();
  +      }
  +      finally
  +      {
  +         if (connector != null)
  +         {
  +            connector.stop();
  +            connector.destroy();
  +            connector = null;
  +         }
  +      }
   
      }
   
      public void testJBossInvocation() throws Throwable
      {
  -      InvokerLocator locator = new InvokerLocator("rmi://localhost:5400/?" +
  +      InvokerLocator locator = new InvokerLocator("rmi://localhost:5401/?" +
                                                     InvokerLocator.BYVALUE + "=" + Boolean.TRUE.toString() + "&" +
                                                     InvokerLocator.SERIALIZATIONTYPE + "=" + "jboss");
         ServerInvocationHandler invocationHandler = new MockServerInvocationHandler();
   
  +      try
  +      {
         // set up
  -      ByValueInvocationTestCase.setupConfiguration(locator, invocationHandler);
  +         setupConfiguration(locator, invocationHandler);
   
         Thread.sleep(3000);
   
  @@ -115,6 +126,16 @@
            assertTrue("Result of testByValue was not even of type Boolean.", false);
         }
         remotingClient.disconnect();
  +      }
  +      finally
  +      {
  +         if (connector != null)
  +         {
  +            connector.stop();
  +            connector.destroy();
  +            connector = null;
  +         }
  +      }
   
      }
   
  
  
  



More information about the jboss-cvs-commits mailing list