Search in sources :

Example 6 with EnhancedServer

use of org.wildfly.swarm.messaging.EnhancedServer 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 7 with EnhancedServer

use of org.wildfly.swarm.messaging.EnhancedServer 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

EnhancedServer (org.wildfly.swarm.messaging.EnhancedServer)7 Test (org.junit.Test)6 RemoteConnection (org.wildfly.swarm.messaging.RemoteConnection)5 List (java.util.List)1 ApplicationScoped (javax.enterprise.context.ApplicationScoped)1 Any (javax.enterprise.inject.Any)1 Inject (javax.inject.Inject)1 Named (javax.inject.Named)1 Server (org.wildfly.swarm.config.messaging.activemq.Server)1 PooledConnectionFactory (org.wildfly.swarm.config.messaging.activemq.server.PooledConnectionFactory)1 RemoteConnector (org.wildfly.swarm.config.messaging.activemq.server.RemoteConnector)1 MessagingFraction (org.wildfly.swarm.messaging.MessagingFraction)1 Customizer (org.wildfly.swarm.spi.api.Customizer)1 OutboundSocketBinding (org.wildfly.swarm.spi.api.OutboundSocketBinding)1 SocketBindingGroup (org.wildfly.swarm.spi.api.SocketBindingGroup)1 Post (org.wildfly.swarm.spi.runtime.annotations.Post)1