[jboss-cvs] JBossRemoting/src/tests/org/jboss/test/remoting/detection/multicast/deadlock ...

Tom Elrod tom.elrod at jboss.com
Sun Jul 23 22:07:56 EDT 2006


  User: telrod  
  Date: 06/07/23 22:07:56

  Modified:    src/tests/org/jboss/test/remoting/detection/multicast/deadlock   
                        DeadlockTestCase.java MulticastDetectorClient.java
                        MulticastDetectorServer.java
  Log:
  JBREM-553 - fix for abstract detector ping using connection validator holding pool lock too long.
  
  Revision  Changes    Path
  1.3       +1 -0      JBossRemoting/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/DeadlockTestCase.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: DeadlockTestCase.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/DeadlockTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- DeadlockTestCase.java	23 Jul 2006 19:14:25 -0000	1.2
  +++ DeadlockTestCase.java	24 Jul 2006 02:07:56 -0000	1.3
  @@ -58,6 +58,7 @@
            client.testDetection();
            server.tearDown();
            client.disconnect();
  +         Thread.sleep(5000);
            System.out.println("done testing.");
         }
         finally
  
  
  
  1.4       +29 -0     JBossRemoting/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorClient.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MulticastDetectorClient.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorClient.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- MulticastDetectorClient.java	23 Jul 2006 19:20:51 -0000	1.3
  +++ MulticastDetectorClient.java	24 Jul 2006 02:07:56 -0000	1.4
  @@ -130,6 +130,35 @@
         }
      }
   
  +   public static void main(String[] args)
  +   {
  +      MulticastDetectorClient client = new MulticastDetectorClient();
  +      try
  +      {
  +         client.setUp();
  +         client.testDetection();
  +         client.disconnect();
  +         Thread.sleep(5000);
  +         System.out.println("done testing.");
  +      }
  +      catch(Throwable t)
  +      {
  +         t.printStackTrace();
  +      }
  +      finally
  +      {
  +         try
  +         {
  +            client.tearDown();
  +         }
  +         catch (Exception e)
  +         {
  +            e.printStackTrace();
  +         }
  +      }
  +   }
  +
  +
      public class LocalHandler implements ServerInvocationHandler
      {
   
  
  
  
  1.4       +19 -8     JBossRemoting/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorServer.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: MulticastDetectorServer.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossRemoting/src/tests/org/jboss/test/remoting/detection/multicast/deadlock/MulticastDetectorServer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- MulticastDetectorServer.java	23 Jul 2006 19:20:51 -0000	1.3
  +++ MulticastDetectorServer.java	24 Jul 2006 02:07:56 -0000	1.4
  @@ -22,6 +22,7 @@
   
   /**
    * Test for JBREM-553
  + *
    * @author <a href="mailto:tom.elrod at jboss.com">Tom Elrod</a>
    */
   public class MulticastDetectorServer extends ServerTestCase
  @@ -99,6 +100,8 @@
         {
            MulticastDetectorServer test = new MulticastDetectorServer();
            test.setUp();
  +         Thread.currentThread().sleep(10000);
  +         test.tearDown();
         }
         catch (Exception e)
         {
  @@ -123,11 +126,14 @@
         public Object invoke(InvocationRequest invocation) throws Throwable
         {
            Object obj = invocation.getParameter();
  -         if(obj instanceof String)
  +         if (obj instanceof String)
            {
  -            String locator = (String)obj;
  +            String locator = (String) obj;
               ServerClient client = new ServerClient(locator);
  -            new Thread(client).start();
  +            Thread t = new Thread(client, "server_client_thread");
  +            //t.setDaemon(false);
  +            t.setDaemon(true);
  +            t.start();
            }
   
   
  @@ -159,13 +165,18 @@
   
            try
            {
  -            Client remotingClient = new Client(new InvokerLocator(locatorUrl), config);
  +            Client remotingClient = null;
  +            for (int x = 0; x < 2; x++)
  +            {
  +               remotingClient = new Client(new InvokerLocator(locatorUrl), config);
               remotingClient.connect();
               Object ret = remotingClient.invoke("bar");
               System.out.println("client returned " + ret);
               Thread.currentThread().sleep(3000);
  +            }
               remotingClient.disconnect();
               System.out.println("server client disconnected.");
  +
            }
            catch (Exception e)
            {
  
  
  



More information about the jboss-cvs-commits mailing list