tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1530217 - /tomcat/tc7.0.x/trunk/test/org/apache/catalina/mbeans/TestRegistration.java
Date Tue, 08 Oct 2013 10:36:18 GMT
Author: markt
Date: Tue Oct  8 10:36:17 2013
New Revision: 1530217

URL: http://svn.apache.org/r1530217
Log:
Extend the test case to cover RequestProcessors

Modified:
    tomcat/tc7.0.x/trunk/test/org/apache/catalina/mbeans/TestRegistration.java

Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/mbeans/TestRegistration.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/mbeans/TestRegistration.java?rev=1530217&r1=1530216&r2=1530217&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/test/org/apache/catalina/mbeans/TestRegistration.java (original)
+++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/mbeans/TestRegistration.java Tue Oct  8
10:36:17 2013
@@ -95,6 +95,14 @@ public class TestRegistration extends To
         }
     }
 
+    private static String[] requestMBeanNames(String port, String type) {
+        return new String[] {
+            "Tomcat:type=RequestProcessor,worker=" +
+                    ObjectName.quote("http-" + type + "-" + ADDRESS + "-" + port) +
+                    ",name=HttpRequest1",
+        };
+    }
+
     private static String[] contextMBeanNames(String host, String context) {
         return new String[] {
             "Tomcat:j2eeType=WebModule,name=//" + host + context +
@@ -163,6 +171,8 @@ public class TestRegistration extends To
 
         tomcat.start();
 
+        getUrl("http://localhost:" + getPort());
+
         // Verify there are no Catalina MBeans
         onames = mbeanServer.queryNames(new ObjectName("Catalina:*"), null);
         log.info(MBeanDumper.dumpBeans(mbeanServer, onames));
@@ -176,8 +186,7 @@ public class TestRegistration extends To
         }
 
         // Create the list of expected MBean names
-        String protocol=
-            getTomcatInstance().getConnector().getProtocolHandlerClassName();
+        String protocol = tomcat.getConnector().getProtocolHandlerClassName();
         if (protocol.indexOf("Nio") > 0) {
             protocol = "nio";
         } else if (protocol.indexOf("Apr") > 0) {
@@ -185,12 +194,14 @@ public class TestRegistration extends To
         } else {
             protocol = "bio";
         }
-        String index = getTomcatInstance().getConnector().getProperty("nameIndex").toString();
+        String index = tomcat.getConnector().getProperty("nameIndex").toString();
         ArrayList<String> expected = new ArrayList<String>(Arrays.asList(basicMBeanNames()));
         expected.addAll(Arrays.asList(hostMBeanNames("localhost")));
         expected.addAll(Arrays.asList(contextMBeanNames("localhost", contextName)));
         expected.addAll(Arrays.asList(connectorMBeanNames("auto-" + index, protocol)));
         expected.addAll(Arrays.asList(optionalMBeanNames("localhost")));
+        expected.addAll(Arrays.asList(requestMBeanNames(
+                "auto-" + index + "-" + getPort(), protocol)));
 
         // Did we find all expected MBeans?
         ArrayList<String> missing = new ArrayList<String>(expected);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message