use of org.eclipse.scout.rt.platform.BeanMetaData in project scout.rt by eclipse.
the class TestingUtility method registerWithTestingOrder.
/**
* Register an existing bean with order {@link TESTING_BEAN_ORDER}
*/
public static IBean<?> registerWithTestingOrder(Class<?> beanClass) {
IBean<?> bean = BEANS.getBeanManager().getBean(beanClass);
BeanMetaData newBean = new BeanMetaData(bean).withOrder(TESTING_BEAN_ORDER);
return BEANS.getBeanManager().registerBean(newBean);
}
use of org.eclipse.scout.rt.platform.BeanMetaData in project scout.rt by eclipse.
the class SmartFieldTest method setUp.
@Before
public void setUp() throws Throwable {
m_reg = TestingUtility.registerBeans(new BeanMetaData(StyleLookupService.class).withApplicationScoped(true));
m_form = new TestForm();
m_form.startForm();
m_styleField = m_form.getStyleField();
}
use of org.eclipse.scout.rt.platform.BeanMetaData 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);
}
use of org.eclipse.scout.rt.platform.BeanMetaData in project scout.rt by eclipse.
the class CodeServiceInvalidateTest method before.
@Before
public void before() {
codeTypeBean = TestingUtility.registerBean(new BeanMetaData(TestCodeType.class).withProducer(new CodeTypeProducer()));
TestCodeType.INSTANCE_SEQ.set(0);
}
use of org.eclipse.scout.rt.platform.BeanMetaData in project scout.rt by eclipse.
the class ServiceTunnelServletTest method before.
@Before
public void before() throws ServletException, InstantiationException, IllegalAccessException {
m_serverSessionProviderSpy = spy(BEANS.get(ServerSessionProvider.class));
m_beans = TestingUtility.registerBeans(new BeanMetaData(StickySessionCacheService.class).withApplicationScoped(true), new BeanMetaData(ServerSessionProvider.class).withInitialInstance(m_serverSessionProviderSpy).withApplicationScoped(true));
m_testServiceTunnelServlet = new ServiceTunnelServlet();
m_testServiceTunnelServlet.lazyInit(null, null);
m_requestMock = mock(HttpServletRequest.class);
m_responseMock = mock(HttpServletResponse.class);
m_testHttpSession = mock(HttpSession.class);
when(m_requestMock.getSession()).thenReturn(m_testHttpSession);
when(m_requestMock.getSession(true)).thenReturn(m_testHttpSession);
}
Aggregations