[jboss-cvs] JBoss Messaging SVN: r5770 - in branches/Branch_1_4: docs/examples/servlet/etc and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Jan 31 23:55:48 EST 2009


Author: gaohoward
Date: 2009-01-31 23:55:48 -0500 (Sat, 31 Jan 2009)
New Revision: 5770

Modified:
   branches/Branch_1_4/build-thirdparty-EAP4.xml
   branches/Branch_1_4/docs/examples/servlet/etc/messaging-servlet-service.xml
   branches/Branch_1_4/integration/EAP4/etc/remoting/remoting-servlet-service.xml
   branches/Branch_1_4/integration/EAP4/etc/remoting/servlet-invoker.war/WEB-INF/web.xml
   branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/RemotingConnectionConfigurationTest.java
Log:
JBMESSAGING-1131
also change the RemotingConnectionConfigurationTest as pollPeriod test is not valid anymore.


Modified: branches/Branch_1_4/build-thirdparty-EAP4.xml
===================================================================
--- branches/Branch_1_4/build-thirdparty-EAP4.xml	2009-01-30 19:46:41 UTC (rev 5769)
+++ branches/Branch_1_4/build-thirdparty-EAP4.xml	2009-02-01 04:55:48 UTC (rev 5770)
@@ -111,6 +111,7 @@
       <componentref name="jboss/profiler/jvmti" version="1.0.0.CR5-brew"/>
       <componentref name="jboss/jbossxb" version="1.0.0.SP1-brew"/>
       <componentref name="jboss/test14" version="1.0.0.GA"/>
+      <componentref name="sun-servlet" version="2.4"/>
 
       <!-- This is a non declared dependency of jboss/test14 -->
       <componentref name="jboss/jbossretro-rt" version="1.0.5.GA"/>

Modified: branches/Branch_1_4/docs/examples/servlet/etc/messaging-servlet-service.xml
===================================================================
--- branches/Branch_1_4/docs/examples/servlet/etc/messaging-servlet-service.xml	2009-01-30 19:46:41 UTC (rev 5769)
+++ branches/Branch_1_4/docs/examples/servlet/etc/messaging-servlet-service.xml	2009-02-01 04:55:48 UTC (rev 5770)
@@ -12,7 +12,7 @@
           name="jboss.messaging.destination:service=ServletConnectionFactory"
           xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
       <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-      <depends optional-attribute-name="Connector">jboss.remoting:service=connector,transport=servlet,target=jms</depends>
+      <depends optional-attribute-name="Connector">jboss.remoting:service=Connector,transport=servlet,target=jms</depends>
       <depends>jboss.messaging:service=PostOffice</depends>
       <attribute name="JNDIBindings">
          <bindings>

Modified: branches/Branch_1_4/integration/EAP4/etc/remoting/remoting-servlet-service.xml
===================================================================
--- branches/Branch_1_4/integration/EAP4/etc/remoting/remoting-servlet-service.xml	2009-01-30 19:46:41 UTC (rev 5769)
+++ branches/Branch_1_4/integration/EAP4/etc/remoting/remoting-servlet-service.xml	2009-02-01 04:55:48 UTC (rev 5770)
@@ -1,13 +1,13 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-     Servlet-based Remoting service deployment descriptor.
+<?xml version="1.0" encoding="UTF-8"?>
 
- -->
-
-<server>
+<!--
+     Servlet-based Remoting service deployment descriptor.
+
+ -->
+
+<server>
    <mbean code="org.jboss.remoting.transport.Connector"
-          name="jboss.remoting:service=connector,transport=servlet,target=jms"
+          name="jboss.remoting:service=Connector,transport=servlet,target=jms"
           display-name="JMS Servlet transport Connector">
       <attribute name="Configuration">
          <config>
@@ -58,4 +58,4 @@
       </attribute>
    </mbean>
 
-</server>
+</server>

Modified: branches/Branch_1_4/integration/EAP4/etc/remoting/servlet-invoker.war/WEB-INF/web.xml
===================================================================
--- branches/Branch_1_4/integration/EAP4/etc/remoting/servlet-invoker.war/WEB-INF/web.xml	2009-01-30 19:46:41 UTC (rev 5769)
+++ branches/Branch_1_4/integration/EAP4/etc/remoting/servlet-invoker.war/WEB-INF/web.xml	2009-02-01 04:55:48 UTC (rev 5770)
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE web-app PUBLIC
-   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
-   "http://java.sun.com/dtd/web-app_2_3.dtd">
-
-<!-- The the JBossRemoting server invoker servlet web.xml descriptor
-$Id: web.xml,v 1.2 2006/07/17 03:44:00 telrod Exp $
--->
-<web-app>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app PUBLIC
+   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+   "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<!-- The the JBossRemoting server invoker servlet web.xml descriptor
+$Id: web.xml,v 1.2 2006/07/17 03:44:00 telrod Exp $
+-->
+<web-app>
   
   <servlet>
     <servlet-name>JmsServerInvokerServlet</servlet-name>
@@ -30,5 +30,5 @@
     <url-pattern>/JmsServerInvokerServlet/*</url-pattern>
   </servlet-mapping>
 
-</web-app>
-
+</web-app>
+

Modified: branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/RemotingConnectionConfigurationTest.java
===================================================================
--- branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/RemotingConnectionConfigurationTest.java	2009-01-30 19:46:41 UTC (rev 5769)
+++ branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/RemotingConnectionConfigurationTest.java	2009-02-01 04:55:48 UTC (rev 5770)
@@ -1,212 +1,206 @@
-/*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
-package org.jboss.test.messaging.jms;
-
-import java.lang.reflect.Field;
-import java.net.InetAddress;
-import java.util.HashSet;
-import java.util.Map;
-
-import org.jboss.jms.client.JBossConnection;
-import org.jboss.jms.client.delegate.ClientConnectionDelegate;
-import org.jboss.jms.client.remoting.JMSRemotingConnection;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.callback.CallbackPoller;
-import org.jboss.remoting.callback.InvokerCallbackHandler;
-import org.jboss.remoting.transport.Connector;
-import org.jboss.remoting.transport.PortUtil;
-import org.jboss.test.messaging.tools.ServerManagement;
-import org.jboss.test.messaging.tools.container.ServiceContainer;
-
-/**
- *  
- * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
- * @author <a href="ovidiu at feodorov.com">Ovidiu Feodorov</a>
- *
- * $Id$
- */
-public class RemotingConnectionConfigurationTest extends JMSTestCase
-{
-   // Constants -----------------------------------------------------
-
-   // Static --------------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   public RemotingConnectionConfigurationTest(String name)
-   {
-      super(name);
-   }
-   // Public --------------------------------------------------------
-
-   /**
-    * It only makes sense to run remote. Exclude it from "invm-tests" target configuration.
-    */
-   public void testDefaultHTTPCallbackPollPeriod() throws Exception
-   {
-      if (!ServerManagement.isRemote())
-      {
-         return;
-      }
-
-      JBossConnection connection = null;
-
-      try
-      {
-         connection = (JBossConnection)cf.createConnection();
-         connection.start();
-
-         ClientConnectionDelegate delegate = (ClientConnectionDelegate)connection.getDelegate();
-         JMSRemotingConnection remotingConnection = delegate.getRemotingConnection();
-         Client client = remotingConnection.getRemotingClient();
-
-         Field field = JMSRemotingConnection.class.getDeclaredField("serverLocator");
-         field.setAccessible(true);
-         InvokerLocator locator = (InvokerLocator)field.get(remotingConnection);
-         String transport = locator.getProtocol();
-
-         if (!"http".equals(transport))
-         {
-            // not interesting
-            return;
-         }
-
-         field = Client.class.getDeclaredField("callbackPollers");
-         field.setAccessible(true);
-         Map callbackPollers = (Map)field.get(client);
-         assertEquals(1, callbackPollers.size());
-
-         CallbackPoller callbackPoller = (CallbackPoller)callbackPollers.values().iterator().next();
-
-         field = CallbackPoller.class.getDeclaredField("pollPeriod");
-         field.setAccessible(true);
-         Long pollPeriod = (Long)field.get(callbackPoller);
-         assertEquals(ServiceContainer.HTTP_CONNECTOR_CALLBACK_POLL_PERIOD, pollPeriod.longValue());
-      }
-      finally
-      {
-         if (connection != null)
-         {
-            connection.close();
-         }
-      }
-   }
-
-
-   /**
-    * It only makes sense to run remote. Exclude it from "invm-tests" target configuration.
-    */
-   public void testConnectionConfiguration() throws Exception
-   {
-      if (!ServerManagement.isRemote())
-      {
-         return;
-      }
-
-      JBossConnection connection = null;
-
-      try
-      {
-         String address = InetAddress.getLocalHost().getHostAddress();
-         System.setProperty("jboss.messaging.callback.bind.address", address);
-         
-         int freePort = PortUtil.findFreePort(InetAddress.getLocalHost().getHostName());
-         System.setProperty("jboss.messaging.callback.bind.port", Integer.toString(freePort));
-
-         String pollPeriod = "654";
-         System.setProperty("jboss.messaging.callback.pollPeriod", pollPeriod);
-
-         System.setProperty("jboss.messaging.callback.reportPollingStatistics", "true");
-         
-         connection = (JBossConnection)cf.createConnection();
-         connection.start();
-
-         ClientConnectionDelegate delegate = (ClientConnectionDelegate)connection.getDelegate();
-         JMSRemotingConnection remotingConnection = delegate.getRemotingConnection();
-         Client client = remotingConnection.getRemotingClient();
-
-         Field field = JMSRemotingConnection.class.getDeclaredField("serverLocator");
-         field.setAccessible(true);
-         InvokerLocator locator = (InvokerLocator)field.get(remotingConnection);
-         String transport = locator.getProtocol();
-
-         if ("socket".equals(transport)
-               || "sslsocket".equals(transport)
-               || "bisocket".equals(transport)
-               || "sslbisocket".equals(transport))
-         {
-            field = Client.class.getDeclaredField("callbackConnectors");
-            field.setAccessible(true);
-            Map callbackConnectors = (Map)field.get(client);
-
-            InvokerCallbackHandler callbackHandler = remotingConnection.getCallbackManager();
-            HashSet map = (HashSet) callbackConnectors.get(callbackHandler);
-            Connector connector = (Connector)map.iterator().next();
-            locator = new InvokerLocator(connector.getInvokerLocator());
-            assertEquals(address, locator.getHost());
-            assertEquals(freePort, locator.getPort());
-         }
-         else if ("http".equals(transport))
-         {
-            field = Client.class.getDeclaredField("callbackPollers");
-            field.setAccessible(true);
-            Map callbackPollers = (Map)field.get(client);
-            assertEquals(1, callbackPollers.size());
-
-            CallbackPoller callbackPoller =
-               (CallbackPoller)callbackPollers.values().iterator().next();
-
-            field = CallbackPoller.class.getDeclaredField("pollPeriod");
-            field.setAccessible(true);
-
-            assertEquals(pollPeriod, ((Long)field.get(callbackPoller)).toString());
-            
-            field = CallbackPoller.class.getDeclaredField("reportStatistics");
-            field.setAccessible(true);
-            assertEquals(true, ((Boolean) field.get(callbackPoller)).booleanValue());
-         }
-         else
-         {
-            fail("Unrecognized transport: " + transport);
-         }
-      }
-      finally
-      {
-         if (connection != null)
-         {
-            connection.close();
-         }
-         
-         System.clearProperty("jboss.messaging.callback.bind.address");
-         
-         System.clearProperty("jboss.messaging.callback.bind.port");
-
-         System.clearProperty("jboss.messaging.callback.pollPeriod");
-
-         System.clearProperty("jboss.messaging.callback.reportPollingStatistics");
-         
-      }
-   }
-}
+/*
+  * JBoss, Home of Professional Open Source
+  * Copyright 2005, JBoss Inc., and individual contributors as indicated
+  * by the @authors tag. See the copyright.txt in the distribution for a
+  * full listing of individual contributors.
+  *
+  * This is free software; you can redistribute it and/or modify it
+  * under the terms of the GNU Lesser General Public License as
+  * published by the Free Software Foundation; either version 2.1 of
+  * the License, or (at your option) any later version.
+  *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
+  * License along with this software; if not, write to the Free
+  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+  */
+package org.jboss.test.messaging.jms;
+
+import java.lang.reflect.Field;
+import java.net.InetAddress;
+import java.util.HashSet;
+import java.util.Map;
+
+import org.jboss.jms.client.JBossConnection;
+import org.jboss.jms.client.delegate.ClientConnectionDelegate;
+import org.jboss.jms.client.remoting.JMSRemotingConnection;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.callback.CallbackPoller;
+import org.jboss.remoting.callback.InvokerCallbackHandler;
+import org.jboss.remoting.transport.Connector;
+import org.jboss.remoting.transport.PortUtil;
+import org.jboss.test.messaging.tools.ServerManagement;
+import org.jboss.test.messaging.tools.container.ServiceContainer;
+
+/**
+ *  
+ * @author <a href="ron.sigal at jboss.com">Ron Sigal</a>
+ * @author <a href="ovidiu at feodorov.com">Ovidiu Feodorov</a>
+ * @author <a href="hgao at redhat.com">Howard Gao</a>
+ *
+ * $Id$
+ */
+public class RemotingConnectionConfigurationTest extends JMSTestCase
+{
+   // Constants -----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   public RemotingConnectionConfigurationTest(String name)
+   {
+      super(name);
+   }
+   // Public --------------------------------------------------------
+
+   /**
+    * It only makes sense to run remote. Exclude it from "invm-tests" target configuration.
+    */
+   //disable it because it doesn't make sense to test pollPeriod in blocking mode.
+   //see JBMESSAGING-1131 Ron's comments.
+/*
+   public void testDefaultHTTPCallbackPollPeriod() throws Exception
+   {
+      if (!ServerManagement.isRemote())
+      {
+         return;
+      }
+
+      JBossConnection connection = null;
+
+      try
+      {
+         connection = (JBossConnection)cf.createConnection();
+         connection.start();
+
+         ClientConnectionDelegate delegate = (ClientConnectionDelegate)connection.getDelegate();
+         JMSRemotingConnection remotingConnection = delegate.getRemotingConnection();
+         Client client = remotingConnection.getRemotingClient();
+
+         Field field = JMSRemotingConnection.class.getDeclaredField("serverLocator");
+         field.setAccessible(true);
+         InvokerLocator locator = (InvokerLocator)field.get(remotingConnection);
+         String transport = locator.getProtocol();
+
+         if (!"http".equals(transport))
+         {
+            // not interesting
+            return;
+         }
+
+         field = Client.class.getDeclaredField("callbackPollers");
+         field.setAccessible(true);
+         Map callbackPollers = (Map)field.get(client);
+         assertEquals(1, callbackPollers.size());
+
+         CallbackPoller callbackPoller = (CallbackPoller)callbackPollers.values().iterator().next();
+
+         field = CallbackPoller.class.getDeclaredField("pollPeriod");
+         field.setAccessible(true);
+         Long pollPeriod = (Long)field.get(callbackPoller);
+         assertEquals(ServiceContainer.HTTP_CONNECTOR_CALLBACK_POLL_PERIOD, pollPeriod.longValue());
+      }
+      finally
+      {
+         if (connection != null)
+         {
+            connection.close();
+         }
+      }
+   }
+*/
+
+   /**
+    * It only makes sense to run remote. Exclude it from "invm-tests" target configuration.
+    */
+   public void testConnectionConfiguration() throws Exception
+   {
+      if (!ServerManagement.isRemote())
+      {
+         return;
+      }
+
+      JBossConnection connection = null;
+
+      try
+      {
+         String address = InetAddress.getLocalHost().getHostAddress();
+         System.setProperty("jboss.messaging.callback.bind.address", address);
+         
+         int freePort = PortUtil.findFreePort(InetAddress.getLocalHost().getHostName());
+         System.setProperty("jboss.messaging.callback.bind.port", Integer.toString(freePort));
+
+         System.setProperty("jboss.messaging.callback.reportPollingStatistics", "true");
+         
+         connection = (JBossConnection)cf.createConnection();
+         connection.start();
+
+         ClientConnectionDelegate delegate = (ClientConnectionDelegate)connection.getDelegate();
+         JMSRemotingConnection remotingConnection = delegate.getRemotingConnection();
+         Client client = remotingConnection.getRemotingClient();
+
+         Field field = JMSRemotingConnection.class.getDeclaredField("serverLocator");
+         field.setAccessible(true);
+         InvokerLocator locator = (InvokerLocator)field.get(remotingConnection);
+         String transport = locator.getProtocol();
+
+         if ("socket".equals(transport)
+               || "sslsocket".equals(transport)
+               || "bisocket".equals(transport)
+               || "sslbisocket".equals(transport))
+         {
+            field = Client.class.getDeclaredField("callbackConnectors");
+            field.setAccessible(true);
+            Map callbackConnectors = (Map)field.get(client);
+
+            InvokerCallbackHandler callbackHandler = remotingConnection.getCallbackManager();
+            HashSet map = (HashSet) callbackConnectors.get(callbackHandler);
+            Connector connector = (Connector)map.iterator().next();
+            locator = new InvokerLocator(connector.getInvokerLocator());
+            assertEquals(address, locator.getHost());
+            assertEquals(freePort, locator.getPort());
+         }
+         else if ("http".equals(transport))
+         {
+            field = Client.class.getDeclaredField("callbackPollers");
+            field.setAccessible(true);
+            Map callbackPollers = (Map)field.get(client);
+            assertEquals(1, callbackPollers.size());
+
+            CallbackPoller callbackPoller =
+               (CallbackPoller)callbackPollers.values().iterator().next();
+
+            field = CallbackPoller.class.getDeclaredField("reportStatistics");
+            field.setAccessible(true);
+            assertEquals(true, ((Boolean) field.get(callbackPoller)).booleanValue());
+         }
+         else
+         {
+            fail("Unrecognized transport: " + transport);
+         }
+      }
+      finally
+      {
+         if (connection != null)
+         {
+            connection.close();
+         }
+         
+         System.clearProperty("jboss.messaging.callback.bind.address");
+         
+         System.clearProperty("jboss.messaging.callback.bind.port");
+
+         System.clearProperty("jboss.messaging.callback.reportPollingStatistics");
+      }
+   }
+}
+




More information about the jboss-cvs-commits mailing list