use of org.apache.activemq.command.DestinationInfo in project activemq-artemis by apache.
the class DestinationInfoTest method createObject.
@Override
public Object createObject() throws Exception {
DestinationInfo info = new DestinationInfo();
populateObject(info);
return info;
}
use of org.apache.activemq.command.DestinationInfo in project activemq-artemis by apache.
the class DestinationInfoTest method createObject.
@Override
public Object createObject() throws Exception {
DestinationInfo info = new DestinationInfo();
populateObject(info);
return info;
}
use of org.apache.activemq.command.DestinationInfo in project activemq-artemis by apache.
the class DestinationInfoTest method populateObject.
@Override
protected void populateObject(Object object) throws Exception {
super.populateObject(object);
DestinationInfo info = (DestinationInfo) object;
info.setConnectionId(createConnectionId("ConnectionId:1"));
info.setDestination(createActiveMQDestination("Destination:2"));
info.setOperationType((byte) 1);
info.setTimeout(1);
{
BrokerId[] value = new BrokerId[2];
for (int i = 0; i < 2; i++) {
value[i] = createBrokerId("BrokerPath:3");
}
info.setBrokerPath(value);
}
}
use of org.apache.activemq.command.DestinationInfo in project activemq-artemis by apache.
the class DestinationInfoTest method populateObject.
@Override
protected void populateObject(Object object) throws Exception {
super.populateObject(object);
DestinationInfo info = (DestinationInfo) object;
info.setConnectionId(createConnectionId("ConnectionId:1"));
info.setDestination(createActiveMQDestination("Destination:2"));
info.setOperationType((byte) 1);
info.setTimeout(1);
{
BrokerId[] value = new BrokerId[2];
for (int i = 0; i < 2; i++) {
value[i] = createBrokerId("BrokerPath:3");
}
info.setBrokerPath(value);
}
}
use of org.apache.activemq.command.DestinationInfo in project activemq-artemis by apache.
the class AdvisoryJmxTest method testCreateDeleteDestinations.
public void testCreateDeleteDestinations() 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:type=Broker,brokerName=localhost");
BrokerViewMBean brokerMbean = MBeanServerInvocationHandler.newProxyInstance(connection, name, BrokerViewMBean.class, true);
Connection conn = createConnection();
Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer consumer = sess.createConsumer(sess.createTopic("ActiveMQ.Advisory.Queue"));
conn.start();
Destination dest = sess.createQueue("test");
brokerMbean.addQueue("test");
ActiveMQMessage msg = (ActiveMQMessage) consumer.receive(1000);
assertNotNull(msg);
assertTrue(msg.getDataStructure() instanceof DestinationInfo);
assertEquals(((DestinationInfo) msg.getDataStructure()).getDestination(), dest);
assertEquals(((DestinationInfo) msg.getDataStructure()).getOperationType(), 0);
brokerMbean.removeQueue("test");
msg = (ActiveMQMessage) consumer.receive(1000);
assertNotNull(msg);
assertTrue(msg.getDataStructure() instanceof DestinationInfo);
assertEquals(((DestinationInfo) msg.getDataStructure()).getDestination(), dest);
assertEquals(((DestinationInfo) msg.getDataStructure()).getOperationType(), 1);
brokerMbean.addQueue("test");
msg = (ActiveMQMessage) consumer.receive(1000);
assertNotNull(msg);
assertTrue(msg.getDataStructure() instanceof DestinationInfo);
assertEquals(((DestinationInfo) msg.getDataStructure()).getDestination(), dest);
assertEquals(((DestinationInfo) msg.getDataStructure()).getOperationType(), 0);
assertEquals(((DestinationInfo) msg.getDataStructure()).getOperationType(), 0);
}
Aggregations