Package de.odysseus.calyxo.control.misc

Examples of de.odysseus.calyxo.control.misc.DynamicDispatchConfig


    group.setTestModuleContext(request, module1);
  }

  public void testPath() throws Exception {
    DefaultDispatcher dispatcher = new DefaultDispatcher(module1);
    DispatchConfig dispatch = new DynamicDispatchConfig("/path", false);
    TestResponse response = new TestResponse(false);
    dispatcher.dispatch(request, response, dispatch);
    assertEquals("/path", request.getRecentRequestDispatchPath());
    assertNull(response.getRedirectURL());
  }
View Full Code Here


    assertNull(response.getRedirectURL());
  }

  public void testPathRedirect() throws Exception {
    DefaultDispatcher dispatcher = new DefaultDispatcher(module1);
    DispatchConfig dispatch = new DynamicDispatchConfig("/path", true);
    TestResponse response = new TestResponse(false);
    dispatcher.dispatch(request, response, dispatch);
    assertNull(request.getRecentRequestDispatchPath());
    assertEquals("encodeRedirect(/context/path)", response.getRedirectURL());
  }
View Full Code Here

    assertEquals("encodeRedirect(/context/path)", response.getRedirectURL());
  }

  public void testQuery() throws Exception {
    DefaultDispatcher dispatcher = new DefaultDispatcher(module1);
    DispatchConfig dispatch = new DynamicDispatchConfig("/path?foo=bar", false);
    TestResponse response = new TestResponse(false);
    dispatcher.dispatch(request, response, dispatch);
    assertEquals("/path?foo=bar", request.getRecentRequestDispatchPath());
    assertNull(response.getRedirectURL());
  }
View Full Code Here

    assertNull(response.getRedirectURL());
  }

  public void testParamConfigs() throws Exception {
    DefaultDispatcher dispatcher = new DefaultDispatcher(module1);
    DynamicDispatchConfig dispatch = new DynamicDispatchConfig("/path", false);
    TestResponse response = new TestResponse(false);

    dispatch.addParam("foo", "bar");
    dispatcher.dispatch(request, response, dispatch);
    assertEquals("/path?foo=bar", request.getRecentRequestDispatchPath());
    assertNull(response.getRedirectURL());

    dispatch.addParam("foo2", "bar2");
    dispatcher.dispatch(request, response, dispatch);
    assertEquals("/path?foo=bar&foo2=bar2", request.getRecentRequestDispatchPath());
    assertNull(response.getRedirectURL());
  }
View Full Code Here

    assertNull(response.getRedirectURL());
  }

  public void testQueryAndParamConfig() throws Exception {
    DefaultDispatcher dispatcher = new DefaultDispatcher(module1);
    DynamicDispatchConfig dispatch = new DynamicDispatchConfig("/path?foo=bar", false);
    TestResponse response = new TestResponse(false);

    dispatch.addParam("foo2", "bar2");
    dispatcher.dispatch(request, response, dispatch);
    assertEquals("/path?foo=bar&foo2=bar2", request.getRecentRequestDispatchPath());
    assertNull(response.getRedirectURL());
  }
View Full Code Here

    assertNull(response.getRedirectURL());
  }

  public void testAnchor() throws Exception {
    DefaultDispatcher dispatcher = new DefaultDispatcher(module1);
    DispatchConfig dispatch = new DynamicDispatchConfig("/path#abc", false);
    TestResponse response = new TestResponse(false);
    dispatcher.dispatch(request, response, dispatch);
    assertEquals("/path#abc", request.getRecentRequestDispatchPath());
    assertNull(response.getRedirectURL());
  }
View Full Code Here

    assertNull(response.getRedirectURL());
  }

  public void testQueryAndAnchorAndParamConfig() throws Exception {
    DefaultDispatcher dispatcher = new DefaultDispatcher(module1);
    DynamicDispatchConfig dispatch = new DynamicDispatchConfig("/path?foo=bar#abc", false);
    TestResponse response = new TestResponse(false);

    dispatch.addParam("foo2", "bar2");
    dispatcher.dispatch(request, response, dispatch);
    assertEquals("/path?foo=bar&foo2=bar2#abc", request.getRecentRequestDispatchPath());
    assertNull(response.getRedirectURL());
  }
View Full Code Here

    assertNull(response.getRedirectURL());
  }

  public void testAction() throws Exception {
    DefaultDispatcher dispatcher = new DefaultDispatcher(module1);
    DispatchConfig dispatch = new DynamicDispatchConfig(null, "/action", false);
    TestResponse response = new TestResponse(false);
    dispatcher.dispatch(request, response, dispatch);
    assertEquals("/module1/action", request.getRecentRequestDispatchPath());
    assertNull(response.getRedirectURL());
  }
View Full Code Here

    assertNull(response.getRedirectURL());
  }

  public void testActionRedirect() throws Exception {
    DefaultDispatcher dispatcher = new DefaultDispatcher(module1);
    DispatchConfig dispatch = new DynamicDispatchConfig(null, "/action", true);
    TestResponse response = new TestResponse(false);
    dispatcher.dispatch(request, response, dispatch);
    assertNull(request.getRecentRequestDispatchPath());
    assertEquals("encodeRedirect(/context/module1/action)", response.getRedirectURL());
  }
View Full Code Here

TOP

Related Classes of de.odysseus.calyxo.control.misc.DynamicDispatchConfig

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.