Search in sources :

Example 1 with WebMockObjectFactory

use of com.mockrunner.mock.web.WebMockObjectFactory in project geode by apache.

the class SessionReplicationJUnitTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    WebMockObjectFactory factory = getWebMockObjectFactory();
    MockFilterConfig config = factory.getMockFilterConfig();
    config.setInitParameter(DistributionConfig.GEMFIRE_PREFIX + "property.mcast-port", "0");
    config.setInitParameter("cache-type", "peer-to-peer");
    factory.getMockServletContext().setContextPath(CONTEXT_PATH);
    factory.getMockRequest().setRequestURL("/test/foo/bar");
    factory.getMockRequest().setContextPath(CONTEXT_PATH);
    createFilter(SessionCachingFilter.class);
    createServlet(CallbackServlet.class);
    setDoChain(true);
}
Also used : WebMockObjectFactory(com.mockrunner.mock.web.WebMockObjectFactory) MockFilterConfig(com.mockrunner.mock.web.MockFilterConfig) Before(org.junit.Before)

Example 2 with WebMockObjectFactory

use of com.mockrunner.mock.web.WebMockObjectFactory in project geode by apache.

the class SessionReplicationLocalCacheJUnitTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    WebMockObjectFactory factory = getWebMockObjectFactory();
    MockFilterConfig config = factory.getMockFilterConfig();
    config.setInitParameter(DistributionConfig.GEMFIRE_PREFIX + "property.mcast-port", "0");
    config.setInitParameter("cache-type", "peer-to-peer");
    config.setInitParameter(DistributionConfig.GEMFIRE_PREFIX + "cache.enable_local_cache", "true");
    factory.getMockServletContext().setContextPath(CONTEXT_PATH);
    factory.getMockRequest().setRequestURL("/test/foo/bar");
    factory.getMockRequest().setContextPath(CONTEXT_PATH);
    createFilter(SessionCachingFilter.class);
    createServlet(CallbackServlet.class);
    setDoChain(true);
}
Also used : WebMockObjectFactory(com.mockrunner.mock.web.WebMockObjectFactory) MockFilterConfig(com.mockrunner.mock.web.MockFilterConfig) Before(org.junit.Before)

Aggregations

MockFilterConfig (com.mockrunner.mock.web.MockFilterConfig)2 WebMockObjectFactory (com.mockrunner.mock.web.WebMockObjectFactory)2 Before (org.junit.Before)2