use of org.jboss.as.test.integration.common.jms.JMSOperations in project wildfly by wildfly.
the class ConnectionFactoryManagementTestCase method testWriteDiscoveryGroupAttributeWhenConnectorIsAlreadyDefined.
@Test
public void testWriteDiscoveryGroupAttributeWhenConnectorIsAlreadyDefined() throws Exception {
JMSOperations jmsOperations = JMSOperationsProvider.getInstance(managementClient.getControllerClient());
ModelNode attributes = new ModelNode();
attributes.get(CommonAttributes.CONNECTORS).add("in-vm");
jmsOperations.addJmsConnectionFactory(CF_NAME, "java:/jms/" + CF_NAME, attributes);
final ModelNode writeAttribute = new ModelNode();
writeAttribute.get(OP).set(WRITE_ATTRIBUTE_OPERATION);
writeAttribute.get(OP_ADDR).set(jmsOperations.getServerAddress().add("connection-factory", CF_NAME));
writeAttribute.get(NAME).set(CommonAttributes.DISCOVERY_GROUP);
writeAttribute.get(VALUE).set(randomUUID().toString());
try {
executeOperation(writeAttribute);
fail("it is not possible to define a discovery group when the connector attribute is already defined");
} catch (MgmtOperationException e) {
assertEquals(FAILED, e.getResult().get(OUTCOME).asString());
assertEquals(true, e.getResult().get(ROLLED_BACK).asBoolean());
assertTrue(e.getResult().get(FAILURE_DESCRIPTION).asString().contains("WFLYCTL0105"));
}
jmsOperations.removeJmsConnectionFactory(CF_NAME);
}
use of org.jboss.as.test.integration.common.jms.JMSOperations in project wildfly by wildfly.
the class ExportImportJournalTestCase method tearDown.
@After
public void tearDown() {
JMSOperations jmsOperations = JMSOperationsProvider.getInstance(managementClient.getControllerClient());
jmsOperations.removeJmsQueue(jmsQueueName);
jmsOperations.close();
}
use of org.jboss.as.test.integration.common.jms.JMSOperations in project wildfly by wildfly.
the class ClusteredMessagingTestCase method setUp.
@Before
public void setUp() throws Exception {
container.start(CONTAINER_0);
container.start(CONTAINER_1);
// both servers are started and configured
assertTrue(container.isStarted(CONTAINER_0));
assertTrue(container.isStarted(CONTAINER_1));
try (ModelControllerClient client = createClient1()) {
JMSOperations jmsOperations = JMSOperationsProvider.getInstance(client);
jmsOperations.createJmsQueue(jmsQueueName, "java:jboss/exported/" + jmsQueueLookup);
jmsOperations.createJmsTopic(jmsTopicName, "java:jboss/exported/" + jmsTopicLookup);
}
try (ModelControllerClient client = createClient2()) {
JMSOperations jmsOperations = JMSOperationsProvider.getInstance(client);
jmsOperations.createJmsQueue(jmsQueueName, "java:jboss/exported/" + jmsQueueLookup);
jmsOperations.createJmsTopic(jmsTopicName, "java:jboss/exported/" + jmsTopicLookup);
}
}
use of org.jboss.as.test.integration.common.jms.JMSOperations in project wildfly by wildfly.
the class LegacyJMSTestCase method tearDown.
@After
public void tearDown() throws IOException {
JMSOperations jmsOperations = JMSOperationsProvider.getInstance(managementClient.getControllerClient());
jmsOperations.removeJmsQueue(QUEUE_NAME);
jmsOperations.removeJmsTopic(TOPIC_NAME);
ModelNode legacyConnectionFactoryAddress = jmsOperations.getServerAddress().clone().add("legacy-connection-factory", CF_NAME);
ModelNode addLegacyConnectionFactoryOp = Util.createOperation(REMOVE, PathAddress.pathAddress(legacyConnectionFactoryAddress));
managementClient.getControllerClient().execute(addLegacyConnectionFactoryOp);
}
use of org.jboss.as.test.integration.common.jms.JMSOperations in project wildfly by wildfly.
the class LegacyJMSTestCase method setUp.
@Before
public void setUp() throws IOException {
JMSOperations jmsOperations = JMSOperationsProvider.getInstance(managementClient.getControllerClient());
ModelNode queueAttributes = new ModelNode();
queueAttributes.get("legacy-entries").add(LEGACY_QUEUE_ENTRY);
jmsOperations.createJmsQueue(QUEUE_NAME, QUEUE_ENTRY, queueAttributes);
ModelNode topicAttributes = new ModelNode();
topicAttributes.get("legacy-entries").add(LEGACY_TOPIC_ENTRY);
jmsOperations.createJmsTopic(TOPIC_NAME, TOPIC_ENTRY, topicAttributes);
ModelNode legacyConnectionFactoryAddress = jmsOperations.getServerAddress().clone().add("legacy-connection-factory", CF_NAME);
ModelNode addLegacyConnectionFactoryOp = Util.createOperation(ModelDescriptionConstants.ADD, PathAddress.pathAddress(legacyConnectionFactoryAddress));
addLegacyConnectionFactoryOp.get("connectors").add("http-connector");
addLegacyConnectionFactoryOp.get("entries").add(LEGACY_CF_ENTRY);
managementClient.getControllerClient().execute(addLegacyConnectionFactoryOp);
}
Aggregations