Search in sources :

Example 16 with BeanMetaData

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);
}
Also used : BeanMetaData(org.eclipse.scout.rt.platform.BeanMetaData)

Example 17 with BeanMetaData

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();
}
Also used : BeanMetaData(org.eclipse.scout.rt.platform.BeanMetaData) Before(org.junit.Before)

Example 18 with BeanMetaData

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);
}
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 19 with BeanMetaData

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);
}
Also used : BeanMetaData(org.eclipse.scout.rt.platform.BeanMetaData) CodeTypeProducer(org.eclipse.scout.rt.shared.services.common.code.CodeTypeProducer) Before(org.junit.Before)

Example 20 with BeanMetaData

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);
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) BeanMetaData(org.eclipse.scout.rt.platform.BeanMetaData) HttpSession(javax.servlet.http.HttpSession) HttpServletResponse(javax.servlet.http.HttpServletResponse) StickySessionCacheService(org.eclipse.scout.rt.server.commons.cache.StickySessionCacheService) Before(org.junit.Before)

Aggregations

BeanMetaData (org.eclipse.scout.rt.platform.BeanMetaData)53 Test (org.junit.Test)18 Before (org.junit.Before)11 IBean (org.eclipse.scout.rt.platform.IBean)9 IBeanManager (org.eclipse.scout.rt.platform.IBeanManager)6 TestEnvironmentClientSession (org.eclipse.scout.rt.client.testenvironment.TestEnvironmentClientSession)5 Callable (java.util.concurrent.Callable)3 JobCompletionDelayOnSessionShutdown (org.eclipse.scout.rt.client.ClientConfigProperties.JobCompletionDelayOnSessionShutdown)3 IRunnable (org.eclipse.scout.rt.platform.util.concurrent.IRunnable)3 After (org.junit.After)3 ArrayList (java.util.ArrayList)2 Subject (javax.security.auth.Subject)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 HttpServletResponse (javax.servlet.http.HttpServletResponse)2 HttpSession (javax.servlet.http.HttpSession)2 IMomImplementor (org.eclipse.scout.rt.mom.api.IMomImplementor)2 NullMomImplementor (org.eclipse.scout.rt.mom.api.NullMomImplementor)2 PlatformException (org.eclipse.scout.rt.platform.exception.PlatformException)2 JaxWsImplementorSpecifics (org.eclipse.scout.rt.server.jaxws.implementor.JaxWsImplementorSpecifics)2 IClusterSynchronizationService (org.eclipse.scout.rt.server.services.common.clustersync.IClusterSynchronizationService)2