Examples of addInitParameter()


Examples of org.springframework.mock.web.MockFilterConfig.addInitParameter()

  public void before() throws ServletException {
    MockFilterConfig filterConfig = new MockFilterConfig();
    filterConfig.addInitParameter("resource-server-key", "org.surfnet.oaaas.conext.mock-server-name");
    filterConfig.addInitParameter("resource-server-secret", UUID.randomUUID().toString());
    filterConfig.addInitParameter("authorization-server-url", "http://localhost:8088/org.surfnet.oaaas.conext.mock/endpoint");
    filterConfig.addInitParameter("type-information-is-included", "true");
    //enable caching as we want to test this
    filter = new AuthorizationServerFilter(){
      @Override
      protected boolean cacheAccessTokens() {
        return true;
View Full Code Here

Examples of org.springframework.mock.web.MockFilterConfig.addInitParameter()

        MockHttpServletRequest request = new MockHttpServletRequest(sc);
        MockHttpServletResponse response = new MockHttpServletResponse();

        MockFilterConfig filterConfig = new MockFilterConfig(wac.getServletContext(), "filter");
        MockFilterConfig filterConfig2 = new MockFilterConfig(wac.getServletContext(), "filter2");
        filterConfig2.addInitParameter("sessionFactoryBeanName", "mySessionFactory");

        MockFilterConfig filterConfig3 = new MockFilterConfig(wac.getServletContext(), "filter3");

        final OpenSessionInViewFilter filter = new OpenSessionInViewFilter();
        filter.init(filterConfig);
View Full Code Here

Examples of org.springframework.mock.web.MockFilterConfig.addInitParameter()

*/
public class ValidationContextFilterTests extends TestCase {

    public void testInit() throws Exception {
        MockFilterConfig filterConfig = new MockFilterConfig();
        filterConfig.addInitParameter(
                "validationContextUrlMappings",
                "/user/*=ctx1,ctx2\n" +
                "/admin/*=ctx3"
        );
        ValidationContextFilter filter = new ValidationContextFilter();
View Full Code Here

Examples of org.springframework.mock.web.MockServletConfig.addInitParameter()

        servlet =
            (HttpServlet)Class.forName("org.apache.wink.server.internal.servlet.RestServlet")
                .newInstance();
        MockServletConfig servletConfig = new MockServletConfig();
        servletConfig.addInitParameter("javax.ws.rs.Application", getApplicationClassName());

        String propertiesFile = getPropertiesFile();
        if (propertiesFile != null) {
            servletConfig.addInitParameter("propertiesLocation", propertiesFile);
        }
View Full Code Here

Examples of org.springframework.mock.web.MockServletContext.addInitParameter()

* To change this template use File | Settings | File Templates.
*/
public class SpringTapestryIntegrationTests extends TestCase {
    public void testSpringIntegration() throws Exception {
        MockServletContext servletContext = new MockServletContext();
        servletContext.addInitParameter(ContextLoader.CONFIG_LOCATION_PARAM, "classpath:org/springmodules/web/tapestry/applicationContext.xml");
        ContextLoader contextLoader = new ContextLoader();
        contextLoader.initWebApplicationContext(servletContext);

        MockServletConfig servletConfig = new MockServletConfig(servletContext, "servlet");
        ApplicationServlet servlet = new ApplicationServlet();
View Full Code Here

Examples of org.springframework.mock.web.portlet.MockPortletConfig.addInitParameter()

  public void testParseConfigWithBang() {
   
    MockPortletContext portletContext = new MockPortletContext();
    MockPortletConfig portletConfig = new MockPortletConfig(portletContext);

    portletConfig.addInitParameter("viewNamespace", "/view");
    portletConfig.addInitParameter("defaultViewAction", "index!input");

    Map<PortletMode, ActionMapping> actionMap = new HashMap<PortletMode, ActionMapping>();

    dispatcher.parseModeConfig(actionMap, portletConfig, PortletMode.VIEW,
View Full Code Here

Examples of org.springframework.mock.web.portlet.MockPortletConfig.addInitParameter()

   
    MockPortletContext portletContext = new MockPortletContext();
    MockPortletConfig portletConfig = new MockPortletConfig(portletContext);

    portletConfig.addInitParameter("viewNamespace", "/view");
    portletConfig.addInitParameter("defaultViewAction", "index!input");

    Map<PortletMode, ActionMapping> actionMap = new HashMap<PortletMode, ActionMapping>();

    dispatcher.parseModeConfig(actionMap, portletConfig, PortletMode.VIEW,
        "viewNamespace", "defaultViewAction");
View Full Code Here

Examples of org.springframework.mock.web.test.MockFilterConfig.addInitParameter()

    wac.getServletContext().setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, wac);
    CommonsMultipartResolver resolver = new CommonsMultipartResolver(wac.getServletContext());
    assertTrue(resolver.getFileItemFactory().getRepository().getAbsolutePath().endsWith("mytemp"));

    MockFilterConfig filterConfig = new MockFilterConfig(wac.getServletContext(), "filter");
    filterConfig.addInitParameter("class", "notWritable");
    filterConfig.addInitParameter("unknownParam", "someValue");
    final MultipartFilter filter = new MultipartFilter();
    filter.init(filterConfig);

    final List<MultipartFile> files = new ArrayList<MultipartFile>();
View Full Code Here

Examples of org.springframework.mock.web.test.MockServletConfig.addInitParameter()

  @Override
  protected void setUp() throws ServletException {
    servletConfig = new MockServletConfig(new MockServletContext(), "simple");
    MockServletConfig complexConfig = new MockServletConfig(servletConfig.getServletContext(), "complex");
    complexConfig.addInitParameter("publishContext", "false");
    complexConfig.addInitParameter("class", "notWritable");
    complexConfig.addInitParameter("unknownParam", "someValue");

    simpleDispatcherServlet = new DispatcherServlet();
    simpleDispatcherServlet.setContextClass(SimpleWebApplicationContext.class);
View Full Code Here

Examples of org.springframework.mock.web.test.MockServletContext.addInitParameter()

public final class ContextLoaderTests {

  @Test
  public void testContextLoaderListenerWithDefaultContext() {
    MockServletContext sc = new MockServletContext("");
    sc.addInitParameter(ContextLoader.CONFIG_LOCATION_PARAM,
        "/org/springframework/web/context/WEB-INF/applicationContext.xml " +
        "/org/springframework/web/context/WEB-INF/context-addition.xml");
    ServletContextListener listener = new ContextLoaderListener();
    ServletContextEvent event = new ServletContextEvent(sc);
    listener.contextInitialized(event);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.