Search in sources :

Example 1 with ClusterNotificationProperties

use of org.eclipse.scout.rt.server.services.common.clustersync.internal.ClusterNotificationProperties in project scout.rt by eclipse.

the class ClusterSynchronizationService method getNotificationProperties.

@Override
public IClusterNotificationProperties getNotificationProperties() {
    ISession curentSession = ISession.CURRENT.get();
    String userid = curentSession != null ? curentSession.getUserId() : "";
    return new ClusterNotificationProperties(m_nodeId, userid);
}
Also used : ISession(org.eclipse.scout.rt.shared.ISession) ClusterNotificationProperties(org.eclipse.scout.rt.server.services.common.clustersync.internal.ClusterNotificationProperties)

Example 2 with ClusterNotificationProperties

use of org.eclipse.scout.rt.server.services.common.clustersync.internal.ClusterNotificationProperties in project scout.rt by eclipse.

the class ClusterNodeStatusInfoTest method setup.

@Before
public void setup() {
    m_message = mock(ClusterNotificationMessage.class);
    when(m_message.getProperties()).thenReturn(new ClusterNotificationProperties(TEST_NODE, TEST_USER));
}
Also used : ClusterNotificationMessage(org.eclipse.scout.rt.server.services.common.clustersync.internal.ClusterNotificationMessage) ClusterNotificationProperties(org.eclipse.scout.rt.server.services.common.clustersync.internal.ClusterNotificationProperties) Before(org.junit.Before)

Example 3 with ClusterNotificationProperties

use of org.eclipse.scout.rt.server.services.common.clustersync.internal.ClusterNotificationProperties in project scout.rt by eclipse.

the class ClusterSynchronizationServiceTest method before.

@Before
public void before() throws Exception {
    m_nullMomImplementorSpy = spy(NullMomImplementor.class);
    m_beans.add(TestingUtility.registerBean(new BeanMetaData(TestClusterMom.class)));
    m_beans.add(TestingUtility.registerBean(new BeanMetaData(NullMomImplementor.class).withProducer(new IBeanInstanceProducer<IMomImplementor>() {

        @Override
        public IMomImplementor produce(IBean<IMomImplementor> bean) {
            return m_nullMomImplementorSpy;
        }
    })));
    // verify that replacement works
    assertSame("NullMomImplementor-Spy expected", m_nullMomImplementorSpy, BEANS.get(NullMomImplementor.class));
    ClusterNotificationProperties testProps = new ClusterNotificationProperties(TEST_NODE, TEST_USER);
    m_message = new ClusterNotificationMessage("notification", testProps);
    m_svc = new ClusterSynchronizationService();
    m_svc.enable();
}
Also used : BeanMetaData(org.eclipse.scout.rt.platform.BeanMetaData) ClusterNotificationMessage(org.eclipse.scout.rt.server.services.common.clustersync.internal.ClusterNotificationMessage) IMomImplementor(org.eclipse.scout.rt.mom.api.IMomImplementor) ClusterNotificationProperties(org.eclipse.scout.rt.server.services.common.clustersync.internal.ClusterNotificationProperties) NullMomImplementor(org.eclipse.scout.rt.mom.api.NullMomImplementor) Before(org.junit.Before)

Aggregations

ClusterNotificationProperties (org.eclipse.scout.rt.server.services.common.clustersync.internal.ClusterNotificationProperties)3 ClusterNotificationMessage (org.eclipse.scout.rt.server.services.common.clustersync.internal.ClusterNotificationMessage)2 Before (org.junit.Before)2 IMomImplementor (org.eclipse.scout.rt.mom.api.IMomImplementor)1 NullMomImplementor (org.eclipse.scout.rt.mom.api.NullMomImplementor)1 BeanMetaData (org.eclipse.scout.rt.platform.BeanMetaData)1 ISession (org.eclipse.scout.rt.shared.ISession)1