MyBootstrapContext ctx = new MyBootstrapContext();
resourceAdapter.start(ctx);
HornetQRAConnectionManager qraConnectionManager = new HornetQRAConnectionManager();
HornetQRAManagedConnectionFactory mcf = new HornetQRAManagedConnectionFactory();
mcf.setResourceAdapter(resourceAdapter);
HornetQRAConnectionFactory qraConnectionFactory = new HornetQRAConnectionFactoryImpl(mcf, qraConnectionManager);
QueueConnection queueConnection = qraConnectionFactory.createQueueConnection();
QueueSession session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
ManagedConnection mc = ((HornetQRASession)session).getManagedConnection();
queueConnection.close();
mc.destroy();
queueConnection = qraConnectionFactory.createQueueConnection("testuser", "testpassword");
session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
mc = ((HornetQRASession)session).getManagedConnection();
queueConnection.close();
mc.destroy();