Search in sources :

Example 1 with P2PNetworkMessage

use of jetbrains.communicator.p2p.commands.P2PNetworkMessage in project intellij-plugins by JetBrains.

the class AbstractMessageDispatcherTest method testPersistency.

public void testPersistency() throws Exception {
    Message failedMessage = new P2PNetworkMessage("foo", "foo2", new String[] { "test" });
    myDispatcher.performDispatch(myUser, failedMessage);
    myDispatcher.save();
    AbstractMessageDispatcher dispatcher = createDispatcher();
    assertEquals("queue should persist", 1, dispatcher.getPendingMessages(myUser).length);
    Message message = dispatcher.getPendingMessages(myUser)[0];
    assertTrue("queue should persist", message instanceof P2PNetworkMessage);
    assertEquals("test", ((P2PNetworkMessage) message).getParameters()[0]);
    dispatcher.dispose();
}
Also used : Message(jetbrains.communicator.core.dispatcher.Message) P2PNetworkMessage(jetbrains.communicator.p2p.commands.P2PNetworkMessage) MockMessage(jetbrains.communicator.mock.MockMessage) P2PNetworkMessage(jetbrains.communicator.p2p.commands.P2PNetworkMessage)

Aggregations

Message (jetbrains.communicator.core.dispatcher.Message)1 MockMessage (jetbrains.communicator.mock.MockMessage)1 P2PNetworkMessage (jetbrains.communicator.p2p.commands.P2PNetworkMessage)1