@Test public void testScenarios_publications() throws Exception { InMemoryClient client = new InMemoryClient( new InMemoryRoutingContext(), RecipientKind.DM ); RoboconfMessageQueue queue = new RoboconfMessageQueue(); client.setMessageQueue( queue ); MessagingContext ctx = new MessagingContext( RecipientKind.AGENTS, "domain", "app" ); Message msg = new MsgCmdAddInstance( new Instance( "" )); Assert.assertFalse( client.isConnected()); Assert.assertEquals( 0, queue.size()); client.publish( ctx, msg ); Assert.assertEquals( 0, queue.size()); client.openConnection(); Assert.assertTrue( client.isConnected()); client.publish( ctx, msg ); Assert.assertEquals( 0, queue.size()); client.subscribe( ctx ); client.publish( ctx, msg ); Assert.assertEquals( 1, queue.size()); Assert.assertEquals( msg, queue.element()); }
@Override public void setMessageQueue( RoboconfMessageQueue messageQueue ) { this.ctxToQueue.put( this.ownerId, messageQueue ); }
InMemoryClient extends AbstractRoutingClient<LinkedBlockingQueue<Message>> { @Override public void setMessageQueue( RoboconfMessageQueue messageQueue ) { this.ctxToQueue.put( this.ownerId, messageQueue ); } }
InMemoryClient extends AbstractRoutingClient<LinkedBlockingQueue<Message>> { @Override public void setMessageQueue( RoboconfMessageQueue messageQueue ) { this.ctxToQueue.put( this.ownerId, messageQueue ); } InMemoryClient( InMemoryRoutingContext routingContext, RecipientKind ownerKind ); }
InMemoryClient extends AbstractRoutingClient<LinkedBlockingQueue<Message>> { @Override public void setMessageQueue( RoboconfMessageQueue messageQueue ) { this.ctxToQueue.put( this.ownerId, messageQueue ); } InMemoryClient( InMemoryRoutingContext routingContext, RecipientKind ownerKind ); @Override void setMessageQueue( RoboconfMessageQueue messageQueue ); @Override String getMessagingType(); }
InMemoryClient extends AbstractRoutingClient<LinkedBlockingQueue<Message>> { @Override public void setMessageQueue( RoboconfMessageQueue messageQueue ) { this.ctxToQueue.put( this.ownerId, messageQueue ); } InMemoryClient( InMemoryRoutingContext routingContext, RecipientKind ownerKind ); @Override void setMessageQueue( RoboconfMessageQueue messageQueue ); @Override String getMessagingType();  }