Package org.wymiwyg.wrhapi

Examples of org.wymiwyg.wrhapi.Response


  public void acceptHeaderBasedMethodSelectionWithQ4() throws Exception {

    JaxRsHandler handler = HandlerCreator.getHandler(MyResource.class);
   
    Request requestMock = EasyMock.createNiceMock(Request.class);
    Response responseMock = EasyMock.createNiceMock(Response.class);
    expect(requestMock.getMethod()).andReturn(Method.GET).anyTimes();
    String[] acceptHeaders = {"test/string6","test/string2;q=.9","*/*;q=.1"};
    expect(requestMock.getHeaderNames()).andReturn(
        Collections.singleton(HeaderName.ACCEPT)).anyTimes();
    expect(requestMock.getHeaderValues(HeaderName.ACCEPT))
 
View Full Code Here


    uri.setPath("/test-resource/path/");

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

    Response response = new ResponseImpl();
    handler.handle(request, response);

    assertNotNull(TestResourceForDefaultValue.pathParam);
    assertEquals("123", TestResourceForDefaultValue.pathParam);
  }
View Full Code Here

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

    Response response = new ResponseImpl();
    handler.handle(request, response);

    assertNotNull(TestResourceForDefaultValue.matrix);
    assertEquals("defaultMP", TestResourceForDefaultValue.matrix);
  }
View Full Code Here

    uri.setQuery("test2=mySecondValue");
    request.setRequestURI(uri);
    request.setMethod(Method.POST);


    Response response = new ResponseImpl();
    handler.handle(request, response);

    assertNotNull(TestResourceForDefaultValue.queryParam);
    assertEquals("defaultQP", TestResourceForDefaultValue.queryParam.toString());
  }
View Full Code Here

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

    Response response = new ResponseImpl();
    handler.handle(request, response);

    assertNotNull(TestResourceForDefaultValue.id);
    assertEquals("123", TestResourceForDefaultValue.id);
  }
View Full Code Here

            });
   
    request.setRequestURI(uri);
    request.setMethod(Method.POST);
   
    Response response = new ResponseImpl();
    handler.handle(request, response);

    assertEquals("defaultFP1", TestResourceForDefaultValue.username);
    assertEquals("defaultFP2", TestResourceForDefaultValue.password);
  }
View Full Code Here

    values[0] = "xyz=22eueu.uo";
    values[1] = "abc=1231241";
    request.setHeader(HeaderName.COOKIE, values);
    request.setRequestURI(uri);
    request.setMethod(Method.GET);
    Response response = new ResponseImpl();
    handler.handle(request, response);
   
    assertEquals("defaultCookie", TestResourceForDefaultValue.cookie.getName());
    assertEquals("foobar", TestResourceForDefaultValue.cookie.getValue());
  }
View Full Code Here

    String[] values = new String[1];
    values[0] = "6.10.2012";
    request.setHeader(HeaderName.LAST_MODIFIED, values);
    request.setRequestURI(uri);
    request.setMethod(Method.GET);
    Response response = new ResponseImpl();
    handler.handle(request, response);
   
    assertEquals("1.1.1970", TestResourceForDefaultValue.date);
 
View Full Code Here

    RequestURIImpl uri = new RequestURIImpl();
    uri.setPath("/field");
    uri.setQuery("wert=MyValue");
    request.setRequestURI(uri);
    request.setMethod(Method.GET);
    Response response = new ResponseImpl();
    handler.handle(request, response);
   
    assertEquals("defaultFV", MyFieldRessource.fieldValue);
  }
View Full Code Here

     request.setRequestURI(uri);
    request.setMethod(Method.GET);
    String[] values = new String[1];
    values[0] = "http://example.com";
    request.setHeader(HeaderName.HOST, values);
    Response response = new ResponseImpl();
    handler.handle(request, response);
   
    assertEquals("defaultCV", MyConstructorRessource.constructorValue);
  }
View Full Code Here

TOP

Related Classes of org.wymiwyg.wrhapi.Response

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.