Package org.tamacat.httpd.exception

Examples of org.tamacat.httpd.exception.HttpException


              parameters.setParameter(keyValue[0],
                  decode(keyValue[1], encoding));
            }
          }
        } catch (IOException e) {
          throw new HttpException(BasicHttpStatus.SC_BAD_REQUEST, e);
        } finally {
          IOUtils.close(reader);
          IOUtils.close(in);
        }
      }
View Full Code Here


  public void testGetPrintErrorPage() {
    VelocityErrorPage template = new VelocityErrorPage(props);
    HttpRequest request = new BasicHttpRequest("GET", "http://localhost/test");
    HttpResponse response = new BasicHttpResponse(
        new BasicStatusLine(new ProtocolVersion("HTTP",1,1), 404, "Not Found"));
    HttpException exception = new NotFoundException();
    String page = template.getErrorPage(request, response, exception);
    assertNotNull(page);
  }
View Full Code Here

  public void testGetErrorPageHttpRequestHttpResponseHttpException() {
    HttpRequest request = HttpObjectFactory.createHttpRequest("GET", "/test/");
    HttpResponse response = HttpObjectFactory.createHttpResponse(200, "OK");
    VelocityErrorPage page = new VelocityErrorPage(props);
    try {
      HttpException exception = new HttpException(
        BasicHttpStatus.SC_INTERNAL_SERVER_ERROR, "Test Error.");
      String html = page.getErrorPage(request, response, exception);
      assertNotNull(html);
    } catch (Exception e) {
      fail();
View Full Code Here

TOP

Related Classes of org.tamacat.httpd.exception.HttpException

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.