private void internalTest(final boolean route) throws Exception
{
final FakeBinding fake = new FakeBinding(new SimpleString("a"));
final BindingsImpl bind = new BindingsImpl(null, null, null);
bind.addBinding(fake);
bind.addBinding(new FakeBinding(new SimpleString("a")));
bind.addBinding(new FakeBinding(new SimpleString("a")));
Thread t = new Thread()
{
@Override
public void run()
{
try
{
bind.removeBinding(fake);
}
catch (Exception e)
{
e.printStackTrace();
}
}
};
Queue queue = new FakeQueue(new SimpleString("a"));
t.start();
for (int i = 0; i < 100; i++)
{
if (route)
{
bind.route(new ServerMessageImpl(i, 100), new RoutingContextImpl(new FakeTransaction()));
}
else
{
bind.redistribute(new ServerMessageImpl(i, 100), queue, new RoutingContextImpl(new FakeTransaction()));
}
}
}