resolve some timing issues with slow tests and potential jmx port clash

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@826700 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2009-10-19 15:28:29 +00:00
parent d50a3ca5ce
commit 2c73c3df8c
4 changed files with 18 additions and 14 deletions

View File

@ -79,9 +79,9 @@ public class QueueConsumerPriorityTest extends TestCase {
Message msg = senderSession.createTextMessage("test");
for (int i =0; i< 10000;i++) {
producer.send(msg);
Assert.assertNotNull("null on iteration: " + i, highConsumer.receive(200));
Assert.assertNotNull("null on iteration: " + i, highConsumer.receive(500));
}
Assert.assertNull( lowConsumer.receive(500));
Assert.assertNull(lowConsumer.receive(2000));
} finally {

View File

@ -102,7 +102,7 @@ public class AMQ2021Test extends TestCase implements ExceptionListener, Uncaught
c1.start();
}
assertTrue(started.await(5, TimeUnit.SECONDS));
assertTrue(started.await(10, TimeUnit.SECONDS));
Thread producer = new Thread() {
@Override

View File

@ -48,16 +48,16 @@ public class SecurityJMXTest extends TestCase {
public void tearDown() throws Exception {
}
public void testMoveMessages() throws Exception {
JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi");
JMXConnector connector = JMXConnectorFactory.connect(url, null);
connector.connect();
MBeanServerConnection connection = connector.getMBeanServerConnection();
ObjectName name = new ObjectName("org.apache.activemq:BrokerName=localhost,Type=Queue,Destination=TEST.Q");
QueueViewMBean queueMbean = (QueueViewMBean) MBeanServerInvocationHandler.newProxyInstance(connection, name, QueueViewMBean.class, true);
String msgId = queueMbean.sendTextMessage("test", "system", "manager");
queueMbean.moveMessageTo(msgId, "TEST1.Q");
}
public void testMoveMessages() throws Exception {
JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:1199/jmxrmi");
JMXConnector connector = JMXConnectorFactory.connect(url, null);
connector.connect();
MBeanServerConnection connection = connector.getMBeanServerConnection();
ObjectName name = new ObjectName("org.apache.activemq:BrokerName=localhost,Type=Queue,Destination=TEST.Q");
QueueViewMBean queueMbean = (QueueViewMBean) MBeanServerInvocationHandler.newProxyInstance(connection, name, QueueViewMBean.class, true);
String msgId = queueMbean.sendTextMessage("test", "system", "manager");
queueMbean.moveMessageTo(msgId, "TEST1.Q");
}
protected BrokerService createBroker() throws Exception {
return createBroker("org/apache/activemq/security/simple-auth-broker.xml");

View File

@ -22,6 +22,10 @@
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<broker useJmx="true" persistent="false" xmlns="http://activemq.apache.org/schema/core" populateJMSXUserID="true">
<!-- Use a non-default port in case the default port is in use -->
<managementContext>
<managementContext connectorPort="1199"/>
</managementContext>
<destinations>
<queue physicalName="TEST.Q" />
@ -62,4 +66,4 @@
</plugins>
</broker>
</beans>
</beans>