use of models.ChatRoom.Join in project play-cookbook by spinscale.
the class ActiveMqTest method assertThatPluginSendsMessages.
@Test
public void assertThatPluginSendsMessages() throws Exception {
assertEquals(0, ChatRoom.get().archive().size());
Event event = new Join("user");
ChatRoom.get().publish(event);
// Check chatroom
int currentEventCount = ChatRoom.get().archive().size();
assertEquals(1, currentEventCount);
// Check for messages
Message msg = receiveSubscriber.receive(2000);
Event evt = (ChatRoom.Event) ((ObjectMessage) msg).getObject();
assertEquals("join", evt.type);
}
use of models.ChatRoom.Join in project play-cookbook by spinscale.
the class ActiveMqTest method assertThatPluginSendsMessages.
@Test
public void assertThatPluginSendsMessages() throws Exception {
assertEquals(0, ChatRoom.get().archive().size());
Event event = new Join("user");
ChatRoom.get().publish(event);
// Check chatroom
int currentEventCount = ChatRoom.get().archive().size();
assertEquals(1, currentEventCount);
// Check for messages
Message msg = receiveSubscriber.receive(2000);
Event evt = (ChatRoom.Event) ((ObjectMessage) msg).getObject();
assertEquals("join", evt.type);
}