Package org.springframework.mock.web

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


  @Test
  public void mDotTabletDeviceNoPreferenceTabletIsMobile() throws Exception {
    device.setDeviceType(DeviceType.TABLET);
    SiteSwitcherRequestFilter mDot = new SiteSwitcherRequestFilter();
    MockFilterConfig filterConfig = new MockFilterConfig();
    filterConfig.addInitParameter("switcherMode", "mDot");
    filterConfig.addInitParameter("serverName", "app.com");
    filterConfig.addInitParameter("tabletIsMobile", "true");
    mDot.init(filterConfig);
    mDot.doFilter(request, response, filterChain);
    assertEquals(0, response.getCookies().length);
View Full Code Here


  public void mDotTabletDeviceNoPreferenceTabletIsMobile() throws Exception {
    device.setDeviceType(DeviceType.TABLET);
    SiteSwitcherRequestFilter mDot = new SiteSwitcherRequestFilter();
    MockFilterConfig filterConfig = new MockFilterConfig();
    filterConfig.addInitParameter("switcherMode", "mDot");
    filterConfig.addInitParameter("serverName", "app.com");
    filterConfig.addInitParameter("tabletIsMobile", "true");
    mDot.init(filterConfig);
    mDot.doFilter(request, response, filterChain);
    assertEquals(0, response.getCookies().length);
    assertEquals("http://m.app.com", response.getRedirectedUrl());
View Full Code Here

    device.setDeviceType(DeviceType.TABLET);
    SiteSwitcherRequestFilter mDot = new SiteSwitcherRequestFilter();
    MockFilterConfig filterConfig = new MockFilterConfig();
    filterConfig.addInitParameter("switcherMode", "mDot");
    filterConfig.addInitParameter("serverName", "app.com");
    filterConfig.addInitParameter("tabletIsMobile", "true");
    mDot.init(filterConfig);
    mDot.doFilter(request, response, filterChain);
    assertEquals(0, response.getCookies().length);
    assertEquals("http://m.app.com", response.getRedirectedUrl());
  }
View Full Code Here

  @Test
  public void dotMobiNormalDeviceNoPreferenceTabletIsMobile() throws Exception {
    device.setDeviceType(DeviceType.NORMAL);
    SiteSwitcherRequestFilter mDot = new SiteSwitcherRequestFilter();
    MockFilterConfig filterConfig = new MockFilterConfig();
    filterConfig.addInitParameter("switcherMode", "mDot");
    filterConfig.addInitParameter("serverName", "app.com");
    filterConfig.addInitParameter("tabletIsMobile", "true");
    mDot.init(filterConfig);
    mDot.doFilter(request, response, filterChain);
    assertEquals(0, response.getCookies().length);
View Full Code Here

  public void dotMobiNormalDeviceNoPreferenceTabletIsMobile() throws Exception {
    device.setDeviceType(DeviceType.NORMAL);
    SiteSwitcherRequestFilter mDot = new SiteSwitcherRequestFilter();
    MockFilterConfig filterConfig = new MockFilterConfig();
    filterConfig.addInitParameter("switcherMode", "mDot");
    filterConfig.addInitParameter("serverName", "app.com");
    filterConfig.addInitParameter("tabletIsMobile", "true");
    mDot.init(filterConfig);
    mDot.doFilter(request, response, filterChain);
    assertEquals(0, response.getCookies().length);
    assertNull(response.getRedirectedUrl());
View Full Code Here

    device.setDeviceType(DeviceType.NORMAL);
    SiteSwitcherRequestFilter mDot = new SiteSwitcherRequestFilter();
    MockFilterConfig filterConfig = new MockFilterConfig();
    filterConfig.addInitParameter("switcherMode", "mDot");
    filterConfig.addInitParameter("serverName", "app.com");
    filterConfig.addInitParameter("tabletIsMobile", "true");
    mDot.init(filterConfig);
    mDot.doFilter(request, response, filterChain);
    assertEquals(0, response.getCookies().length);
    assertNull(response.getRedirectedUrl());
  }
View Full Code Here

  @Test
  public void dotMobiMobileDeviceNoPreferenceTabletIsMobile() throws Exception {
    device.setDeviceType(DeviceType.MOBILE);
    SiteSwitcherRequestFilter mDot = new SiteSwitcherRequestFilter();
    MockFilterConfig filterConfig = new MockFilterConfig();
    filterConfig.addInitParameter("switcherMode", "dotMobi");
    filterConfig.addInitParameter("serverName", "app.com");
    filterConfig.addInitParameter("tabletIsMobile", "true");
    mDot.init(filterConfig);
    mDot.doFilter(request, response, filterChain);
    assertEquals(0, response.getCookies().length);
View Full Code Here

  public void dotMobiMobileDeviceNoPreferenceTabletIsMobile() throws Exception {
    device.setDeviceType(DeviceType.MOBILE);
    SiteSwitcherRequestFilter mDot = new SiteSwitcherRequestFilter();
    MockFilterConfig filterConfig = new MockFilterConfig();
    filterConfig.addInitParameter("switcherMode", "dotMobi");
    filterConfig.addInitParameter("serverName", "app.com");
    filterConfig.addInitParameter("tabletIsMobile", "true");
    mDot.init(filterConfig);
    mDot.doFilter(request, response, filterChain);
    assertEquals(0, response.getCookies().length);
    assertEquals("http://app.mobi", response.getRedirectedUrl());
View Full Code Here

    device.setDeviceType(DeviceType.MOBILE);
    SiteSwitcherRequestFilter mDot = new SiteSwitcherRequestFilter();
    MockFilterConfig filterConfig = new MockFilterConfig();
    filterConfig.addInitParameter("switcherMode", "dotMobi");
    filterConfig.addInitParameter("serverName", "app.com");
    filterConfig.addInitParameter("tabletIsMobile", "true");
    mDot.init(filterConfig);
    mDot.doFilter(request, response, filterChain);
    assertEquals(0, response.getCookies().length);
    assertEquals("http://app.mobi", response.getRedirectedUrl());
  }
View Full Code Here

  @Test
  public void dotMobiTabletDeviceNoPreferenceTabletIsMobile() throws Exception {
    device.setDeviceType(DeviceType.TABLET);
    SiteSwitcherRequestFilter mDot = new SiteSwitcherRequestFilter();
    MockFilterConfig filterConfig = new MockFilterConfig();
    filterConfig.addInitParameter("switcherMode", "dotMobi");
    filterConfig.addInitParameter("serverName", "app.com");
    filterConfig.addInitParameter("tabletIsMobile", "true");
    mDot.init(filterConfig);
    mDot.doFilter(request, response, filterChain);
    assertEquals(0, response.getCookies().length);
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.