Search in sources :

Example 1 with BaseJndiImplementation

use of com.adaptris.core.jms.jndi.BaseJndiImplementation in project interlok by adaptris.

the class JndiImplementationCase method testSetNewContextOnException.

@Test
public void testSetNewContextOnException() throws Exception {
    BaseJndiImplementation jv = createVendorImplementation();
    assertNull(jv.getNewContextOnException());
    assertFalse(jv.newContextOnException());
    jv.setNewContextOnException(Boolean.TRUE);
    assertEquals(Boolean.TRUE, jv.getNewContextOnException());
    assertTrue(jv.newContextOnException());
    jv.setNewContextOnException(null);
    assertNull(jv.getNewContextOnException());
    assertFalse(jv.newContextOnException());
}
Also used : BaseJndiImplementation(com.adaptris.core.jms.jndi.BaseJndiImplementation) Test(org.junit.Test)

Example 2 with BaseJndiImplementation

use of com.adaptris.core.jms.jndi.BaseJndiImplementation in project interlok by adaptris.

the class JndiImplementationCase method testSetJndiName.

@Test
public void testSetJndiName() throws Exception {
    BaseJndiImplementation jv = createVendorImplementation();
    jv.setJndiName("ABCDE");
    assertEquals("ABCDE", jv.getJndiName());
    try {
        jv.setJndiName("");
        fail();
    } catch (IllegalArgumentException expected) {
    }
    assertEquals("ABCDE", jv.getJndiName());
    try {
        jv.setJndiName(null);
        fail();
    } catch (IllegalArgumentException expected) {
    }
    assertEquals("ABCDE", jv.getJndiName());
}
Also used : BaseJndiImplementation(com.adaptris.core.jms.jndi.BaseJndiImplementation) Test(org.junit.Test)

Example 3 with BaseJndiImplementation

use of com.adaptris.core.jms.jndi.BaseJndiImplementation in project interlok by adaptris.

the class JndiImplementationCase method testSetEnableEncodedPasswords.

@Test
public void testSetEnableEncodedPasswords() throws Exception {
    BaseJndiImplementation vendorImp = createVendorImplementation();
    assertNull(vendorImp.getEnableEncodedPasswords());
    assertFalse(vendorImp.enableEncodedPasswords());
    vendorImp.setEnableEncodedPasswords(Boolean.TRUE);
    assertNotNull(vendorImp.getEnableEncodedPasswords());
    assertTrue(vendorImp.enableEncodedPasswords());
    vendorImp.setEnableEncodedPasswords(null);
    assertNull(vendorImp.getEnableEncodedPasswords());
    assertFalse(vendorImp.enableEncodedPasswords());
}
Also used : BaseJndiImplementation(com.adaptris.core.jms.jndi.BaseJndiImplementation) Test(org.junit.Test)

Example 4 with BaseJndiImplementation

use of com.adaptris.core.jms.jndi.BaseJndiImplementation in project interlok by adaptris.

the class JndiImplementationCase method testSetExtraConfiguration.

@Test
public void testSetExtraConfiguration() throws Exception {
    BaseJndiImplementation jv = createVendorImplementation();
    assertEquals(NoOpFactoryConfiguration.class, jv.getExtraFactoryConfiguration().getClass());
    jv.setExtraFactoryConfiguration(new SimpleFactoryConfiguration());
    assertEquals(SimpleFactoryConfiguration.class, jv.getExtraFactoryConfiguration().getClass());
    try {
        jv.setExtraFactoryConfiguration(null);
        fail();
    } catch (IllegalArgumentException expected) {
    }
    assertEquals(SimpleFactoryConfiguration.class, jv.getExtraFactoryConfiguration().getClass());
}
Also used : BaseJndiImplementation(com.adaptris.core.jms.jndi.BaseJndiImplementation) SimpleFactoryConfiguration(com.adaptris.core.jms.jndi.SimpleFactoryConfiguration) Test(org.junit.Test)

Example 5 with BaseJndiImplementation

use of com.adaptris.core.jms.jndi.BaseJndiImplementation in project interlok by adaptris.

the class JndiImplementationCase method testSetEnableJndiForQueues.

@Test
public void testSetEnableJndiForQueues() throws Exception {
    BaseJndiImplementation vendorImp = createVendorImplementation();
    assertNull(vendorImp.getUseJndiForQueues());
    assertFalse(vendorImp.useJndiForQueues());
    vendorImp.setUseJndiForQueues(Boolean.TRUE);
    assertNotNull(vendorImp.getUseJndiForQueues());
    assertTrue(vendorImp.useJndiForQueues());
    vendorImp.setUseJndiForQueues(null);
    assertNull(vendorImp.getUseJndiForQueues());
    assertFalse(vendorImp.useJndiForQueues());
}
Also used : BaseJndiImplementation(com.adaptris.core.jms.jndi.BaseJndiImplementation) Test(org.junit.Test)

Aggregations

BaseJndiImplementation (com.adaptris.core.jms.jndi.BaseJndiImplementation)7 Test (org.junit.Test)7 SimpleFactoryConfiguration (com.adaptris.core.jms.jndi.SimpleFactoryConfiguration)1 KeyValuePairSet (com.adaptris.util.KeyValuePairSet)1