[jboss-remoting-commits] JBoss Remoting SVN: r6290 - remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/socket/accept.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Mon Mar 21 12:58:20 EDT 2011


Author: ron.sigal at jboss.com
Date: 2011-03-21 12:58:20 -0400 (Mon, 21 Mar 2011)
New Revision: 6290

Modified:
   remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/socket/accept/AcceptThreadPriorityTestCase.java
Log:
JBREM-1277: Test worker threads priority.

Modified: remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/socket/accept/AcceptThreadPriorityTestCase.java
===================================================================
--- remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/socket/accept/AcceptThreadPriorityTestCase.java	2011-03-21 16:57:12 UTC (rev 6289)
+++ remoting2/branches/2.x/src/tests/org/jboss/test/remoting/transport/socket/accept/AcceptThreadPriorityTestCase.java	2011-03-21 16:58:20 UTC (rev 6290)
@@ -25,7 +25,10 @@
 import java.lang.reflect.Field;
 import java.net.InetAddress;
 import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import javax.management.MBeanServer;
 
@@ -44,6 +47,7 @@
 import org.jboss.remoting.callback.InvokerCallbackHandler;
 import org.jboss.remoting.transport.Connector;
 import org.jboss.remoting.transport.PortUtil;
+import org.jboss.remoting.transport.socket.LRUPool;
 import org.jboss.remoting.transport.socket.SocketServerInvoker;
 
 
@@ -126,6 +130,29 @@
          
       }
       
+      // Test worker threads priority.
+      field = SocketServerInvoker.class.getDeclaredField("clientpool");
+      field.setAccessible(true);
+      LRUPool clientpool = (LRUPool) field.get((SocketServerInvoker) connector.getServerInvoker());
+      Iterator it = clientpool.getContents().iterator();
+      while (it.hasNext())
+      {
+         Thread t = (Thread) it.next();
+         log.info(t + " priority: " + t.getPriority());
+         assertEquals(Thread.NORM_PRIORITY, t.getPriority());
+      }
+      
+      field = SocketServerInvoker.class.getDeclaredField("threadpool");
+      field.setAccessible(true);
+      List threadpool = (List) field.get((SocketServerInvoker) connector.getServerInvoker());
+      it = threadpool.iterator();
+      while (it.hasNext())
+      {
+         Thread t = (Thread) it.next();
+         log.info(t + " priority: " + t.getPriority());
+         assertEquals(Thread.NORM_PRIORITY, t.getPriority());
+      }
+      
       client.disconnect();
       shutdownServer();
       log.info(getName() + " PASSES");
@@ -167,6 +194,29 @@
          
       }
       
+      // Test worker threads priority.
+      field = SocketServerInvoker.class.getDeclaredField("clientpool");
+      field.setAccessible(true);
+      LRUPool clientpool = (LRUPool) field.get((SocketServerInvoker) connector.getServerInvoker());
+      Iterator it = clientpool.getContents().iterator();
+      while (it.hasNext())
+      {
+         Thread t = (Thread) it.next();
+         log.info(t + " priority: " + t.getPriority());
+         assertEquals(Thread.NORM_PRIORITY, t.getPriority());
+      }
+      
+      field = SocketServerInvoker.class.getDeclaredField("threadpool");
+      field.setAccessible(true);
+      List threadpool = (List) field.get((SocketServerInvoker) connector.getServerInvoker());
+      it = threadpool.iterator();
+      while (it.hasNext())
+      {
+         Thread t = (Thread) it.next();
+         log.info(t + " priority: " + t.getPriority());
+         assertEquals(Thread.NORM_PRIORITY, t.getPriority());
+      }
+      
       client.disconnect();
       shutdownServer();
       log.info(getName() + " PASSES");



More information about the jboss-remoting-commits mailing list