提交 45c6eb1d 编写于 作者: S Sam Brannen

[SPR-8089] re-ignoring JMX tests that require the presence of jmxremote_optional.jar.

上级 309fa921
......@@ -186,8 +186,10 @@ public class MBeanClientInterceptorTests extends AbstractMBeanServerTests {
}
}
// @Ignore has no effect for JUnit 3.8 tests; however, we leave it
// here so that developers can easily search for ignored tests.
// @Ignore should have no effect for JUnit 3.8 tests; however, it appears
// that tests on the CI server -- as well as those in Eclipse -- do in
// fact get ignored. So we leave @Ignore here so that developers can
// easily search for ignored tests.
//
// Once fixed, renamed to test* instead of ignore*.
@Ignore("Requires jmxremote_optional.jar; see comments in AbstractMBeanServerTests for details.")
......
......@@ -26,24 +26,30 @@ import javax.management.remote.JMXConnectorServer;
import javax.management.remote.JMXConnectorServerFactory;
import javax.management.remote.JMXServiceURL;
import org.junit.Ignore;
/**
* @author Rob Harrop
*/
// @Ignore should have no effect for JUnit 3.8 tests; however, it appears
// that tests on the CI server -- as well as those in Eclipse -- do in
// fact get ignored. So we leave @Ignore here so that developers can
// easily search for ignored tests.
@Ignore("Requires jmxremote_optional.jar; see comments in AbstractMBeanServerTests for details.")
public class RemoteMBeanClientInterceptorTests extends MBeanClientInterceptorTests {
private static final String SERVICE_URL = "service:jmx:jmxmp://localhost:9876";
private JMXConnectorServer connectorServer;
private JMXConnector connector;
private JMXConnector connector;
public void onSetUp() throws Exception {
super.onSetUp();
this.connectorServer = JMXConnectorServerFactory.newJMXConnectorServer(getServiceUrl(), null, getServer());
try {
this.connectorServer.start();
}
catch (BindException ex) {
} catch (BindException ex) {
// skipping tests, server already running at this port
runTests = false;
}
......@@ -58,7 +64,7 @@ public class RemoteMBeanClientInterceptorTests extends MBeanClientInterceptorTes
return this.connector.getMBeanServerConnection();
}
public void tearDown() throws Exception {
public void tearDown() throws Exception {
if (this.connector != null) {
this.connector.close();
}
......
......@@ -28,11 +28,17 @@ import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import org.junit.Ignore;
import org.springframework.jmx.AbstractMBeanServerTests;
/**
* @author Rob Harrop
*/
// @Ignore should have no effect for JUnit 3.8 tests; however, it appears
// that tests on the CI server -- as well as those in Eclipse -- do in
// fact get ignored. So we leave @Ignore here so that developers can
// easily search for ignored tests.
@Ignore("Requires jmxremote_optional.jar; see comments in AbstractMBeanServerTests for details.")
public class ConnectorServerFactoryBeanTests extends AbstractMBeanServerTests {
private static final String OBJECT_NAME = "spring:type=connector,name=test";
......
......@@ -23,6 +23,7 @@ import javax.management.remote.JMXConnectorServer;
import javax.management.remote.JMXConnectorServerFactory;
import javax.management.remote.JMXServiceURL;
import org.junit.Ignore;
import org.springframework.aop.support.AopUtils;
import org.springframework.jmx.AbstractMBeanServerTests;
......@@ -42,7 +43,14 @@ public class MBeanServerConnectionFactoryBeanTests extends AbstractMBeanServerTe
return JMXConnectorServerFactory.newJMXConnectorServer(getServiceUrl(), null, getServer());
}
public void testValidConnection() throws Exception {
// @Ignore should have no effect for JUnit 3.8 tests; however, it appears
// that tests on the CI server -- as well as those in Eclipse -- do in
// fact get ignored. So we leave @Ignore here so that developers can
// easily search for ignored tests.
//
// Once fixed, renamed to test* instead of ignore*.
@Ignore("Requires jmxremote_optional.jar; see comments in AbstractMBeanServerTests for details.")
public void ignoreTestValidConnection() throws Exception {
JMXConnectorServer connectorServer = getConnectorServer();
connectorServer.start();
......@@ -75,7 +83,14 @@ public class MBeanServerConnectionFactoryBeanTests extends AbstractMBeanServerTe
}
}
public void testWithLazyConnection() throws Exception {
// @Ignore should have no effect for JUnit 3.8 tests; however, it appears
// that tests on the CI server -- as well as those in Eclipse -- do in
// fact get ignored. So we leave @Ignore here so that developers can
// easily search for ignored tests.
//
// Once fixed, renamed to test* instead of ignore*.
@Ignore("Requires jmxremote_optional.jar; see comments in AbstractMBeanServerTests for details.")
public void ignoreTestWithLazyConnection() throws Exception {
MBeanServerConnectionFactoryBean bean = new MBeanServerConnectionFactoryBean();
bean.setServiceUrl(SERVICE_URL);
bean.setConnectOnStartup(false);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册