Search in sources :

Example 1 with ClientNotificationClusterNotification

use of org.eclipse.scout.rt.server.clientnotification.ClientNotificationClusterNotification in project scout.rt by eclipse.

the class ClientNotificationClusterNotificationTest method testClientNotificationsReceived.

/**
 * Tests that the client notifications are added to the queue when received
 */
@SuppressWarnings("unchecked")
@Test
public void testClientNotificationsReceived() {
    IMessage<IClusterNotificationMessage> momMsg = mock(IMessage.class);
    ClientNotificationAddress address = ClientNotificationAddress.createAllNodesAddress();
    ClientNotificationMessage message = new ClientNotificationMessage(address, "test", true, "cid");
    ArrayList<ClientNotificationMessage> messages = new ArrayList<ClientNotificationMessage>();
    messages.add(message);
    when(momMsg.getTransferObject()).thenReturn(new ClusterNotificationMessage(new ClientNotificationClusterNotification(messages), m_testProps));
    m_svc.onMessage(momMsg);
    IClientNotificationService c = BEANS.get(IClientNotificationService.class);
    List<ClientNotificationMessage> notifications = c.getNotifications(TEST_NODE);
    assertEquals(1, notifications.size());
}
Also used : ClientNotificationClusterNotification(org.eclipse.scout.rt.server.clientnotification.ClientNotificationClusterNotification) ClientNotificationAddress(org.eclipse.scout.rt.shared.clientnotification.ClientNotificationAddress) ArrayList(java.util.ArrayList) ClusterNotificationMessage(org.eclipse.scout.rt.server.services.common.clustersync.internal.ClusterNotificationMessage) IClientNotificationService(org.eclipse.scout.rt.shared.clientnotification.IClientNotificationService) ClientNotificationMessage(org.eclipse.scout.rt.shared.clientnotification.ClientNotificationMessage) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 ClientNotificationClusterNotification (org.eclipse.scout.rt.server.clientnotification.ClientNotificationClusterNotification)1 ClusterNotificationMessage (org.eclipse.scout.rt.server.services.common.clustersync.internal.ClusterNotificationMessage)1 ClientNotificationAddress (org.eclipse.scout.rt.shared.clientnotification.ClientNotificationAddress)1 ClientNotificationMessage (org.eclipse.scout.rt.shared.clientnotification.ClientNotificationMessage)1 IClientNotificationService (org.eclipse.scout.rt.shared.clientnotification.IClientNotificationService)1 Test (org.junit.Test)1