use of org.eclipse.scout.rt.shared.clientnotification.IClientNotificationService 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());
}
use of org.eclipse.scout.rt.shared.clientnotification.IClientNotificationService in project scout.rt by eclipse.
the class AccessControlServiceTest method setup.
@Before
public void setup() {
m_accessControlService = BeanInstanceUtil.createBean(TestAccessControlService.class);
BeanInstanceUtil.initializeBeanInstance(m_accessControlService);
// Register this IAccessControlService with an higher priority than AllAccessControlService registered in CustomServerTestEnvironment
m_registerServices = TestingUtility.registerBeans(new BeanMetaData(IAccessControlService.class).withInitialInstance(m_accessControlService).withApplicationScoped(true), new BeanMetaData(MaxNotificationBlockingTimeOut.class).withInitialInstance(new TestBlockingProperty()).withApplicationScoped(true));
// register test session
final IClientNotificationService registry = BEANS.get(IClientNotificationService.class);
registry.registerSession("testNode", "testSession", "testuser");
}
Aggregations