catch (Exception e)
{
fail("Unable to create broker: " + e);
}
InitialContextFactory factory = new PropertiesFileInitialContextFactory();
Hashtable<String, String> env = new Hashtable<String, String>();
if (_clientID == null)
{
_clientID = this.getClass().getName();
}
if (_virtualhost == null)
{
_virtualhost = "/test";
}
if (_brokerlist == null)
{
_brokerlist = "vm://:1";
}
env.put("connectionfactory.connection", "amqp://guest:guest@" + _clientID + _virtualhost + "?brokerlist='"
+ _brokerlist + "'");
for (Map.Entry<String, String> c : _connections.entrySet())
{
env.put("connectionfactory." + c.getKey(), c.getValue());
}
env.put("queue.queue", "queue");
for (Map.Entry<String, String> q : _queues.entrySet())
{
env.put("queue." + q.getKey(), q.getValue());
}
env.put("topic.topic", "topic");
for (Map.Entry<String, String> t : _topics.entrySet())
{
env.put("topic." + t.getKey(), t.getValue());
}
_context = factory.getInitialContext(env);
}