Search in sources :

Example 1 with JndiContext

use of org.jaffa.modules.messaging.services.configdomain.JndiContext in project jaffa-framework by jaffa-projects.

the class ConfigurationServiceTest method testGetJmsConfig.

/**
 * Test of getJmsConfig method, of class org.jaffa.modules.messaging.services.ConfigurationService.
 */
public void testGetJmsConfig() {
    ConfigurationService configurationService = ConfigurationService.getInstance();
    assertNotNull("Should have received an instance of the ConfigurationService", configurationService);
    JmsConfig jmsConfig = ConfigurationService.getInstance().getJmsConfig();
    assertNotNull("Should have received an instance of the JmsConfig", jmsConfig);
    assertEquals("ConnectionFactory", jmsConfig.getConnectionFactory());
    assertEquals("someUser", jmsConfig.getUser());
    assertEquals("somePassword", jmsConfig.getPassword());
    JndiContext jndiContext = jmsConfig.getJndiContext();
    assertNotNull("Should have received an instance of the JndiContext", jndiContext);
    assertNotNull("The JndiContext should have a List of param elements", jndiContext.getParam());
    assertEquals("The JndiContext should have a List of 3 param elements", 3, jndiContext.getParam().size());
    assertEquals("java.naming.factory.initial", jndiContext.getParam().get(0).getName());
    assertEquals("org.jnp.interfaces.NamingContextFactory", jndiContext.getParam().get(0).getValue());
    assertEquals("java.naming.factory.url.pkgs", jndiContext.getParam().get(1).getName());
    assertEquals("org.jnp.interfaces", jndiContext.getParam().get(1).getValue());
    assertEquals("java.naming.provider.url", jndiContext.getParam().get(2).getName());
    assertEquals("localhost", jndiContext.getParam().get(2).getValue());
}
Also used : JndiContext(org.jaffa.modules.messaging.services.configdomain.JndiContext) JmsConfig(org.jaffa.modules.messaging.services.configdomain.JmsConfig)

Aggregations

JmsConfig (org.jaffa.modules.messaging.services.configdomain.JmsConfig)1 JndiContext (org.jaffa.modules.messaging.services.configdomain.JndiContext)1