Author: markt
Date: Sat Oct 5 23:18:14 2013
New Revision: 1529549
URL: http://svn.apache.org/r1529549
Log:
Extend the test case to cover RequestProcessors
Modified:
tomcat/trunk/test/org/apache/catalina/mbeans/TestRegistration.java
Modified: tomcat/trunk/test/org/apache/catalina/mbeans/TestRegistration.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/mbeans/TestRegistration.java?rev=1529549&r1=1529548&r2=1529549&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/mbeans/TestRegistration.java
(original)
+++ tomcat/trunk/test/org/apache/catalina/mbeans/TestRegistration.java Sat Oct
5 23:18:14 2013
@@ -96,6 +96,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<>(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<>(expected);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]