}
//https://issues.jboss.org/browse/JBPAPP-5790
public void testResourceAdapterSetup() throws Exception
{
HornetQResourceAdapter adapter = new HornetQResourceAdapter();
adapter.setDiscoveryAddress("231.1.1.1");
HornetQConnectionFactory factory = adapter.getDefaultHornetQConnectionFactory();
long initWait = factory.getDiscoveryGroupConfiguration().getDiscoveryInitialWaitTimeout();
long refresh = factory.getDiscoveryGroupConfiguration().getRefreshTimeout();
int port = factory.getDiscoveryGroupConfiguration().getGroupPort();
//defaults
assertEquals(10000l, refresh);
assertEquals(10000l, initWait);
assertEquals(9876, port);
adapter = new HornetQResourceAdapter();
adapter.setDiscoveryAddress("231.1.1.1");
adapter.setDiscoveryPort(9876);
adapter.setDiscoveryRefreshTimeout(1234l);
factory = adapter.getDefaultHornetQConnectionFactory();
initWait = factory.getDiscoveryGroupConfiguration().getDiscoveryInitialWaitTimeout();
refresh = factory.getDiscoveryGroupConfiguration().getRefreshTimeout();
//override refresh timeout
assertEquals(1234l, refresh);
assertEquals(10000l, initWait);
adapter = new HornetQResourceAdapter();
adapter.setDiscoveryAddress("231.1.1.1");
adapter.setDiscoveryPort(9876);
adapter.setDiscoveryInitialWaitTimeout(9999l);
factory = adapter.getDefaultHornetQConnectionFactory();
initWait = factory.getDiscoveryGroupConfiguration().getDiscoveryInitialWaitTimeout();
refresh = factory.getDiscoveryGroupConfiguration().getRefreshTimeout();
//override initial wait
assertEquals(10000l, refresh);
assertEquals(9999l, initWait);
adapter = new HornetQResourceAdapter();
adapter.setDiscoveryAddress("231.1.1.1");
adapter.setDiscoveryPort(9876);
adapter.setDiscoveryInitialWaitTimeout(9999l);
factory = adapter.getDefaultHornetQConnectionFactory();
initWait = factory.getDiscoveryGroupConfiguration().getDiscoveryInitialWaitTimeout();
refresh = factory.getDiscoveryGroupConfiguration().getRefreshTimeout();
//override initial wait
assertEquals(10000l, refresh);