Search in sources :

Example 1 with NullMomImplementor

use of org.eclipse.scout.rt.mom.api.NullMomImplementor in project scout.rt by eclipse.

the class ClientNotificationClusterNotificationTest 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));
    m_svc = new ClusterSynchronizationService();
    m_svc.enable();
    ClientNotificationTestRegistry reg = new ClientNotificationTestRegistry();
    m_beans.add(TestingUtility.registerBean(new BeanMetaData(ClientNotificationRegistry.class, reg)));
    reg.registerSession(TEST_NODE, "test", TEST_USER);
}
Also used : BeanMetaData(org.eclipse.scout.rt.platform.BeanMetaData) IMomImplementor(org.eclipse.scout.rt.mom.api.IMomImplementor) NullMomImplementor(org.eclipse.scout.rt.mom.api.NullMomImplementor) Before(org.junit.Before)

Example 2 with NullMomImplementor

use of org.eclipse.scout.rt.mom.api.NullMomImplementor 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

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