Examples of TestResponse


Examples of com.pugh.sockso.tests.TestResponse

       
    }
   
    public void testShowXspfPlayer() throws Exception {
       
        final TestResponse res = new TestResponse();
        final Player player = new Player();
        final String extraArgs = "foo=bar";
        final String[] playArgs = new String[] {};
        final TXspfPlayer tpl = new TXspfPlayer();
       
        player.setProperties( new StringProperties() );
        player.setResponse( res );
        player.showXspfPlayer( tpl, extraArgs, playArgs );
       
        final String data = res.getOutput();
       
        assertTrue( data.length() > 0 );
       
    }
View Full Code Here

Examples of de.odysseus.calyxo.base.test.TestResponse

  }

  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

Examples of de.odysseus.calyxo.base.test.TestResponse

  }

  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

Examples of de.odysseus.calyxo.base.test.TestResponse

  }

  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

Examples of de.odysseus.calyxo.base.test.TestResponse

  }

  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

Examples of de.odysseus.calyxo.base.test.TestResponse

  }

  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

Examples of de.odysseus.calyxo.base.test.TestResponse

  }

  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

Examples of de.odysseus.calyxo.base.test.TestResponse

  }

  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

Examples of de.odysseus.calyxo.base.test.TestResponse

  }

  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

Examples of de.odysseus.calyxo.base.test.TestResponse

  }

  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
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.