Package org.apache.clerezza.triaxrs.mock

Examples of org.apache.clerezza.triaxrs.mock.RequestURIImpl


  }

  @Test
  public void testGetOnMySubResource() throws Exception{
    JaxRsHandler handler = HandlerCreator.getHandler(MyRootResource.class, MySubResource.class);
    RequestURIImpl uri = new RequestURIImpl();
    RequestImpl request = new RequestImpl();
    ResponseImpl response = new ResponseImpl();

    uri.setPath("sub");
    request.setRequestURI(uri);
    request.setMethod(Method.GET);

    handler.handle(request, response);
View Full Code Here


  }

  @Test
  public void testGetOnMyRootResource() throws Exception{
    JaxRsHandler handler = HandlerCreator.getHandler(MyRootResource.class, MySubResource.class);
    RequestURIImpl uri = new RequestURIImpl();
    RequestImpl request = new RequestImpl();
    ResponseImpl response = new ResponseImpl();

    uri.setPath("");
    request.setRequestURI(uri);
    request.setMethod(Method.GET);

    handler.handle(request, response);
View Full Code Here

  }

  @Test
  public void testSubMethodOnMySubResource() throws Exception{
    JaxRsHandler handler = HandlerCreator.getHandler(MyRootResource.class, MySubResource.class);
    RequestURIImpl uri = new RequestURIImpl();
    RequestImpl request = new RequestImpl();
    ResponseImpl response = new ResponseImpl();

    uri.setPath("sub/sub");
    request.setRequestURI(uri);
    request.setMethod(Method.GET);

    handler.handle(request, response);
View Full Code Here

  public void testPathParamInjectionIntoMethod() throws Exception {

    JaxRsHandler handler = HandlerCreator.getHandler(TestResourceForDefaultValue.class);

    RequestImpl request = new RequestImpl();
    RequestURIImpl uri = new RequestURIImpl();
    uri.setPath("/test-resource/path/");

    request.setRequestURI(uri);
    request.setMethod(Method.GET);

    Response response = new ResponseImpl();
View Full Code Here

  public void testMatrixParamInjectionIntoMethod() throws Exception {

    JaxRsHandler handler = HandlerCreator.getHandler(TestResourceForDefaultValue.class);

    RequestImpl request = new RequestImpl();
    RequestURIImpl uri = new RequestURIImpl();
    uri.setPath("/test-resource/add");
    //uri.setQuery(";lat=50;long=20");
    request.setRequestURI(uri);
    request.setMethod(Method.POST);

    Response response = new ResponseImpl();
View Full Code Here

  @Test
  public void testQueryParamInjectionIntoMethodPost() throws Exception {
    JaxRsHandler handler = HandlerCreator.getHandler(TestResourceForDefaultValue.class);

    RequestImpl request = new RequestImpl();
    RequestURIImpl uri = new RequestURIImpl();
    uri.setPath("/test-resource/add");
    uri.setQuery("test2=mySecondValue");
    request.setRequestURI(uri);
    request.setMethod(Method.POST);


    Response response = new ResponseImpl();
View Full Code Here

  @Test
  public void testQueryParamInjectionIntoMethodGet() throws Exception {
    JaxRsHandler handler = HandlerCreator.getHandler(TestResourceForDefaultValue.class);

    RequestImpl request = new RequestImpl();
    RequestURIImpl uri = new RequestURIImpl();
    uri.setPath("/test-resource/getId");
    request.setRequestURI(uri);
    request.setMethod(Method.GET);

    Response response = new ResponseImpl();
    handler.handle(request, response);
View Full Code Here

  @Test
  public void testFormParamInjectionIntoMethod() throws Exception {
   
    JaxRsHandler handler = HandlerCreator.getHandler(TestResourceForDefaultValue.class);
    RequestImpl request = new RequestImpl();
    RequestURIImpl uri = new RequestURIImpl();
    uri.setPath("/test-resource/setForm");
    String[] values = new String[1];
    values[0] = "application/x-www-form-urlencoded";
    request.setHeader(HeaderName.CONTENT_TYPE, values);
    request.setMessageBody(new MessageBody2Write() {
View Full Code Here

 
  @Test
  public void testCookieParamInjectionIntoMethod() throws Exception {
    JaxRsHandler handler = HandlerCreator.getHandler(TestResourceForDefaultValue.class);
    RequestImpl request = new RequestImpl();
    RequestURIImpl uri = new RequestURIImpl();
    uri.setPath("/test-resource/addcookie");
    String[] values = new String[2];
    values[0] = "xyz=22eueu.uo";
    values[1] = "abc=1231241";
    request.setHeader(HeaderName.COOKIE, values);
    request.setRequestURI(uri);
View Full Code Here

TOP

Related Classes of org.apache.clerezza.triaxrs.mock.RequestURIImpl

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.