Package com.volantis.mcs.servlet

Examples of com.volantis.mcs.servlet.ServletEnvironmentContext


        requestContext = new MockMarinerServletRequestContext(servletRequest, new MockHTTPServletResponse());

        Project project = new RuntimeProjectMock("projectMock", expectations);
//        requestContext.pushProject(project);

        EnvironmentContext environmentContext = new ServletEnvironmentContext(
                requestContext);
        ContextInternals.setEnvironmentContext(requestContext,
                environmentContext);

        ExpressionFactory expressionFactory = ExpressionFactory.getDefaultInstance();

        ExpressionContext expressionContext =
                expressionFactory.createExpressionContext(
                        null,
                        NamespaceFactory.getDefaultInstance()
                        .createPrefixTracker());

        expressionContext.setProperty(MarinerRequestContext.class,
                                      requestContext, false);

        final CurrentProjectProviderMock projectProviderMock =
                new CurrentProjectProviderMock("projectProviderMock",
                        expectations);
        projectProviderMock.expects.getCurrentProject().returns(project).any();

        // Add a project provider in for resolving relative policy expressions
        // without a project into absolute IDs containing a project.
        expressionContext.setProperty(CurrentProjectProvider.class,
                projectProviderMock, false);

        environmentContext.setExpressionContext(expressionContext);
        return requestContext;
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.servlet.ServletEnvironmentContext

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.