Author: davsclaus
Date: Mon Mar 25 13:23:32 2013
New Revision: 1460650
URL: http://svn.apache.org/r1460650
Log:
CAMEL-6027: Ensure cleanup for JMX tests with create connector. And dont run
some tests on solaris which wont work.
Modified:
camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxInstrumentationWithConnectorTest.java
camel/trunk/camel-core/src/test/java/org/apache/camel/management/ManagedRouteWithOnExceptionTest.java
Modified:
camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxInstrumentationWithConnectorTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxInstrumentationWithConnectorTest.java?rev=1460650&r1=1460649&r2=1460650&view=diff
==============================================================================
---
camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxInstrumentationWithConnectorTest.java
(original)
+++
camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxInstrumentationWithConnectorTest.java
Mon Mar 25 13:23:32 2013
@@ -48,12 +48,13 @@ public class JmxInstrumentationWithConne
String os = System.getProperty("os.name");
boolean aix = os.toLowerCase(Locale.ENGLISH).contains("aix");
boolean windows = os.toLowerCase(Locale.ENGLISH).contains("windows");
+ boolean solaris = os.toLowerCase(Locale.ENGLISH).contains("sunos");
- // Does not work on AIX and the problem is hard to identify, could be
issues not allowing to use a custom port
+ // Does not work on AIX / solaris and the problem is hard to identify,
could be issues not allowing to use a custom port
// java.io.IOException: Failed to retrieve RMIServer stub:
javax.naming.NameNotFoundException: jmxrmi/camel
// windows CI servers is often slow/tricky so skip as well
- return !aix && !windows;
+ return !aix && !solaris && !windows;
}
@Override
@@ -81,6 +82,14 @@ public class JmxInstrumentationWithConne
}
clientConnector = null;
}
+ // restore environment to original state
+ // the following properties may have been set by specialization of
this test class
+ System.clearProperty(JmxSystemPropertyKeys.USE_PLATFORM_MBS);
+ System.clearProperty(JmxSystemPropertyKeys.DOMAIN);
+ System.clearProperty(JmxSystemPropertyKeys.MBEAN_DOMAIN);
+ System.clearProperty(JmxSystemPropertyKeys.CREATE_CONNECTOR);
+ System.clearProperty(JmxSystemPropertyKeys.REGISTRY_PORT);
+
super.tearDown();
}
Modified:
camel/trunk/camel-core/src/test/java/org/apache/camel/management/ManagedRouteWithOnExceptionTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/management/ManagedRouteWithOnExceptionTest.java?rev=1460650&r1=1460649&r2=1460650&view=diff
==============================================================================
---
camel/trunk/camel-core/src/test/java/org/apache/camel/management/ManagedRouteWithOnExceptionTest.java
(original)
+++
camel/trunk/camel-core/src/test/java/org/apache/camel/management/ManagedRouteWithOnExceptionTest.java
Mon Mar 25 13:23:32 2013
@@ -30,6 +30,12 @@ public class ManagedRouteWithOnException
super.setUp();
}
+ @Override
+ protected void tearDown() throws Exception {
+ System.clearProperty(JmxSystemPropertyKeys.CREATE_CONNECTOR);
+ super.tearDown();
+ }
+
public void testShouldBeInstrumentedOk() throws Exception {
getMockEndpoint("mock:error").expectedMessageCount(0);
getMockEndpoint("mock:result").expectedMessageCount(1);