spec.setDestination("test");
spec.setMinSession(1);
spec.setMaxSession(15);
HornetQActivation activation = new HornetQActivation(ra, new MessageEndpointFactory(), spec);
ServerLocatorImpl serverLocator = (ServerLocatorImpl)ra.getDefaultHornetQConnectionFactory().getServerLocator();
Field f = Class.forName(ServerLocatorImpl.class.getName()).getDeclaredField("factories");
Set<XARecoveryConfig> resources = ra.getRecoveryManager().getResources();
f.setAccessible(true);
Set<ClientSessionFactoryInternal> factories = (Set<ClientSessionFactoryInternal>)f.get(serverLocator);
for (int i = 0; i < 10; i++)
{
System.out.println(i);
assertEquals(factories.size(), 0);
activation.start();
assertEquals(factories.size(), 15);
assertEquals(1, resources.size());
activation.stop();
assertEquals(factories.size(), 0);
}
System.out.println("before RA stop => " + factories.size());
ra.stop();