sanity check on provider url params for connection factory

This commit is contained in:
gtully 2016-09-02 10:37:46 +01:00
parent bb8d32c04a
commit 508df5359c
1 changed files with 7 additions and 1 deletions

View File

@ -16,17 +16,23 @@
*/
package org.apache.activemq.jndi;
import org.apache.activemq.ActiveMQXAConnectionFactory;
import javax.jms.XAConnectionFactory;
import javax.naming.Context;
import javax.naming.NamingException;
public class XAConnectionFactoryTest extends ActiveMQInitialContextFactoryTest {
public void testConnectionFactoriesIsXA() throws NamingException {
assertTrue("connection factory implements XA", context.lookup(getConnectionFactoryLookupName()) instanceof XAConnectionFactory);
Object factory = context.lookup(getConnectionFactoryLookupName());
assertTrue("connection factory implements XA", factory instanceof XAConnectionFactory);
assertTrue("is always sync send", ((ActiveMQXAConnectionFactory)factory).isAlwaysSyncSend());
}
protected void configureEnvironment() {
environment.put("xa", "true");
environment.put(Context.PROVIDER_URL, "vm://locahost?jms.alwaysSyncSend=true");
super.configureEnvironment();
}
}