Package de.odysseus.calyxo.control.impl

Examples of de.odysseus.calyxo.control.impl.DefaultDispatcher.dispatch()


  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());
  }

  public void testPathRedirect() throws Exception {
View Full Code Here


  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());
  }

  public void testQuery() throws Exception {
View Full Code Here

  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());
  }

  public void testParamConfigs() throws Exception {
View Full Code Here

    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);
View Full Code Here

    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());
  }

  public void testQueryAndParamConfig() throws Exception {
View Full Code Here

    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());
  }

  public void testAnchor() throws Exception {
View Full Code Here

  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());
  }

  public void testQueryAndAnchorAndParamConfig() throws Exception {
View Full Code Here

    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());
  }

  public void testAction() throws Exception {
View Full Code Here

  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());
  }

  public void testActionRedirect() throws Exception {
View Full Code Here

  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());
  }

  public static void main(String[] args) {
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.