Package net.sourceforge.stripes.mock

Examples of net.sourceforge.stripes.mock.MockHttpServletRequest


    public void setupServletContext(){
        StripesTestFixture.getServletContext();
    }
    //helper method
    private MockHttpServletRequest buildMockServletRequest(){
        MockHttpServletRequest request = new MockHttpServletRequest("/context", "/whatever");
        request.addLocale(Locale.US);
        return request;
    }
View Full Code Here


     * @return {@link WikiContext} associated to given {@link WikiPage}.
     * @throws WikiException problems while logging in.
     */
    WikiContext getJanneBasedWikiContextFor( WikiPage page ) throws WikiException
    {
        MockHttpServletRequest request = testEngine.newHttpRequest();
        WikiSession session =  WikiSession.getWikiSession( testEngine, request );
        testEngine.getAuthenticationManager().login( session,
                                                     request,
                                                     Users.JANNE,
                                                     Users.JANNE_PASS );
View Full Code Here

     * HttpSession and path.
     * @param path the path relative to the wiki context, for example "/Wiki.jsp"
     * @return the new request
     */
    public MockHttpServletRequest newHttpRequest( String path ) {
        MockHttpServletRequest request = new MockHttpServletRequest( "/JSPWiki", path );
        request.setSession( new MockHttpSession( this.getServletContext() ) );
        request.addLocale( new Locale( "" ) );
        return request;
    }
View Full Code Here

     */
    public void saveText( String pageName, String content )
        throws WikiException
    {
        // Build new request and associate our admin session
        MockHttpServletRequest request = newHttpRequest();
        WikiSession wikiSession = SessionMonitor.getInstance( this ).find( request.getSession() );
        this.getAuthenticationManager().login( wikiSession, request,
                Users.ADMIN,
                Users.ADMIN_PASS );

        // Create page and wiki context
View Full Code Here

    public void saveTextAsJanne( String pageName, String content )
        throws WikiException
    {
        // Build new request and associate our Janne session
        MockHttpServletRequest request = newHttpRequest();
        WikiSession wikiSession = SessionMonitor.getInstance( this ).find( request.getSession() );
        this.getAuthenticationManager().login( wikiSession, request,
                Users.JANNE,
                Users.JANNE_PASS );

        // Create page and wiki context
View Full Code Here

public class RedirectResolutionTest extends FilterEnabledTestBase {

    //helper method
    private MockHttpServletRequest buildMockServletRequest(){
        MockHttpServletRequest request = new MockHttpServletRequest("/context", "/whatever");
        request.addLocale(Locale.US);
        return request;
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.stripes.mock.MockHttpServletRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.