Search in sources :

Example 1 with RemoteConnection

use of org.wildfly.swarm.messaging.RemoteConnection in project wildfly-swarm by wildfly-swarm.

the class RemoteConnectionInstallingCustomizerTest method testIfMqNameSet.

@Test
public void testIfMqNameSet() {
    customizer.name.set("postoffice");
    customizer.customize();
    assertThat(fraction.subresources().servers()).hasSize(1);
    EnhancedServer server = (EnhancedServer) fraction.subresources().server("default");
    assertThat(server).isNotNull();
    assertThat(server.remoteConnections()).hasSize(1);
    RemoteConnection connection = server.remoteConnections().get(0);
    assertThat(connection.name()).isEqualTo("postoffice");
    assertThat(connection.host()).isEqualTo(MessagingProperties.DEFAULT_REMOTE_HOST);
    assertThat(connection.port()).isEqualTo(MessagingProperties.DEFAULT_REMOTE_PORT);
    assertThat(connection.jndiName()).isEqualTo("java:/jms/postoffice");
}
Also used : EnhancedServer(org.wildfly.swarm.messaging.EnhancedServer) RemoteConnection(org.wildfly.swarm.messaging.RemoteConnection) Test(org.junit.Test)

Example 2 with RemoteConnection

use of org.wildfly.swarm.messaging.RemoteConnection in project wildfly-swarm by wildfly-swarm.

the class RemoteConnectionInstallingCustomizerTest method testIfRemoteFlagSet.

@Test
public void testIfRemoteFlagSet() {
    customizer.enabled.set(true);
    customizer.customize();
    assertThat(fraction.subresources().servers()).hasSize(1);
    EnhancedServer server = (EnhancedServer) fraction.subresources().server("default");
    assertThat(server).isNotNull();
    assertThat(server.remoteConnections()).hasSize(1);
    RemoteConnection connection = server.remoteConnections().get(0);
    assertThat(connection.name()).isEqualTo(MessagingProperties.DEFAULT_REMOTE_MQ_NAME);
    assertThat(connection.host()).isEqualTo(MessagingProperties.DEFAULT_REMOTE_HOST);
    assertThat(connection.port()).isEqualTo(MessagingProperties.DEFAULT_REMOTE_PORT);
    assertThat(connection.jndiName()).isEqualTo(MessagingProperties.DEFAULT_REMOTE_JNDI_NAME);
}
Also used : EnhancedServer(org.wildfly.swarm.messaging.EnhancedServer) RemoteConnection(org.wildfly.swarm.messaging.RemoteConnection) Test(org.junit.Test)

Example 3 with RemoteConnection

use of org.wildfly.swarm.messaging.RemoteConnection in project wildfly-swarm by wildfly-swarm.

the class RemoteConnectionInstallingCustomizerTest method testIfJndiNameSet.

@Test
public void testIfJndiNameSet() {
    customizer.jndiName.set("java:/jms/iliketacos");
    customizer.customize();
    assertThat(fraction.subresources().servers()).hasSize(1);
    EnhancedServer server = (EnhancedServer) fraction.subresources().server("default");
    assertThat(server).isNotNull();
    assertThat(server.remoteConnections()).hasSize(1);
    RemoteConnection connection = server.remoteConnections().get(0);
    assertThat(connection.name()).isEqualTo(MessagingProperties.DEFAULT_REMOTE_MQ_NAME);
    assertThat(connection.host()).isEqualTo(MessagingProperties.DEFAULT_REMOTE_HOST);
    assertThat(connection.port()).isEqualTo(MessagingProperties.DEFAULT_REMOTE_PORT);
    assertThat(connection.jndiName()).isEqualTo("java:/jms/iliketacos");
}
Also used : EnhancedServer(org.wildfly.swarm.messaging.EnhancedServer) RemoteConnection(org.wildfly.swarm.messaging.RemoteConnection) Test(org.junit.Test)

Example 4 with RemoteConnection

use of org.wildfly.swarm.messaging.RemoteConnection in project wildfly-swarm by wildfly-swarm.

the class RemoteConnectionInstallingCustomizerTest method testIfPortSet.

@Test
public void testIfPortSet() {
    customizer.port.set(61666);
    customizer.customize();
    assertThat(fraction.subresources().servers()).hasSize(1);
    EnhancedServer server = (EnhancedServer) fraction.subresources().server("default");
    assertThat(server).isNotNull();
    assertThat(server.remoteConnections()).hasSize(1);
    RemoteConnection connection = server.remoteConnections().get(0);
    assertThat(connection.name()).isEqualTo(MessagingProperties.DEFAULT_REMOTE_MQ_NAME);
    assertThat(connection.host()).isEqualTo(MessagingProperties.DEFAULT_REMOTE_HOST);
    assertThat(connection.port()).isEqualTo(61666);
    assertThat(connection.jndiName()).isEqualTo(MessagingProperties.DEFAULT_REMOTE_JNDI_NAME);
}
Also used : EnhancedServer(org.wildfly.swarm.messaging.EnhancedServer) RemoteConnection(org.wildfly.swarm.messaging.RemoteConnection) Test(org.junit.Test)

Example 5 with RemoteConnection

use of org.wildfly.swarm.messaging.RemoteConnection in project wildfly-swarm by wildfly-swarm.

the class RemoteConnectionInstallingCustomizerTest method testIfHostSet.

@Test
public void testIfHostSet() {
    customizer.host.set("mq.foo.com");
    customizer.customize();
    assertThat(fraction.subresources().servers()).hasSize(1);
    EnhancedServer server = (EnhancedServer) fraction.subresources().server("default");
    assertThat(server).isNotNull();
    assertThat(server.remoteConnections()).hasSize(1);
    RemoteConnection connection = server.remoteConnections().get(0);
    assertThat(connection.name()).isEqualTo(MessagingProperties.DEFAULT_REMOTE_MQ_NAME);
    assertThat(connection.host()).isEqualTo("mq.foo.com");
    assertThat(connection.port()).isEqualTo(MessagingProperties.DEFAULT_REMOTE_PORT);
    assertThat(connection.jndiName()).isEqualTo(MessagingProperties.DEFAULT_REMOTE_JNDI_NAME);
}
Also used : EnhancedServer(org.wildfly.swarm.messaging.EnhancedServer) RemoteConnection(org.wildfly.swarm.messaging.RemoteConnection) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)5 EnhancedServer (org.wildfly.swarm.messaging.EnhancedServer)5 RemoteConnection (org.wildfly.swarm.messaging.RemoteConnection)5