Search in sources :

Example 1 with FakeHttpResponse

use of net.jforum.http.FakeHttpResponse in project jforum2 by rafaelsteil.

the class OnlineUsersTest method setUp.

protected void setUp() throws Exception {
    new SessionFacade().setCacheEngine(new DefaultCacheEngine());
    RequestContext requestContext = new WebRequestContext(new FakeHttpRequest());
    ResponseContext responseContext = new WebResponseContext(new FakeHttpResponse());
    ForumContext forumContext = new JForumContext(requestContext.getContextPath(), SystemGlobals.getValue(ConfigKeys.SERVLET_EXTENSION), requestContext, responseContext, false);
    JForumExecutionContext ex = JForumExecutionContext.get();
    ex.setForumContext(forumContext);
    JForumExecutionContext.set(ex);
    SystemGlobals.setValue(ConfigKeys.ANONYMOUS_USER_ID, Integer.toString(ANONYMOUS));
}
Also used : WebResponseContext(net.jforum.context.web.WebResponseContext) WebRequestContext(net.jforum.context.web.WebRequestContext) FakeHttpResponse(net.jforum.http.FakeHttpResponse) ResponseContext(net.jforum.context.ResponseContext) WebResponseContext(net.jforum.context.web.WebResponseContext) DefaultCacheEngine(net.jforum.cache.DefaultCacheEngine) JForumContext(net.jforum.context.JForumContext) ForumContext(net.jforum.context.ForumContext) RequestContext(net.jforum.context.RequestContext) WebRequestContext(net.jforum.context.web.WebRequestContext) FakeHttpRequest(net.jforum.http.FakeHttpRequest) JForumContext(net.jforum.context.JForumContext)

Aggregations

DefaultCacheEngine (net.jforum.cache.DefaultCacheEngine)1 ForumContext (net.jforum.context.ForumContext)1 JForumContext (net.jforum.context.JForumContext)1 RequestContext (net.jforum.context.RequestContext)1 ResponseContext (net.jforum.context.ResponseContext)1 WebRequestContext (net.jforum.context.web.WebRequestContext)1 WebResponseContext (net.jforum.context.web.WebResponseContext)1 FakeHttpRequest (net.jforum.http.FakeHttpRequest)1 FakeHttpResponse (net.jforum.http.FakeHttpResponse)1