Package com.google.sitebricks.client

Examples of com.google.sitebricks.client.WebResponse


    RestfulWebService.Book book = new RestfulWebService.Book();
    book.setAuthor("JRR Tolkien");
    book.setName("The Flobbit");
    book.setPageCount(1); // what a lousy book!

    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/mimes_service")
        .transports(RestfulWebService.Book.class)
        .over(Json.class)
        .post(book);
View Full Code Here


*/
@Test(suiteName = AcceptanceTest.SUITE)
public class RestfuWebServiceWithMatrixParamsAcceptanceTest {

  public void shouldServiceTopLevelPath() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/matrixpath")
        .transports(String.class)
        .over(Json.class)
        .get();

    assert RestfulWebServiceWithMatrixParams.TOPLEVEL.equals(response.toString())
        : response.toString();
  }
View Full Code Here

    assert RestfulWebServiceWithMatrixParams.TOPLEVEL.equals(response.toString())
        : response.toString();
  }

  public void shouldServiceVariableThreeLevelSubPath() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/matrixpath/val;param1=val1;param2=val2/athing")
        .transports(String.class)
        .over(Json.class)
        .post("");

    assert ("{param1=[val1], param2=[val2]}"  // Multimap of matrix params
        + "_" + "val;param1=val1;param2=val2" // Variable path fragment #1
        + "_" + "athing")                     // Variable path fragment #2
        .equals(response.toString()) : response.toString();
  }
View Full Code Here

*/
@Test(suiteName = AcceptanceTest.SUITE)
public class RestfuWebServiceWithSubpaths2AcceptanceTest {

  public void shouldServiceTopLevelDynamicPath() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/superpath2/" + TOPLEVEL)
        .transports(String.class)
        .over(Json.class)
        .get();

    assert TOPLEVEL.equals(response.toString());
  }
View Full Code Here

    assert TOPLEVEL.equals(response.toString());
  }

  public void shouldServiceFirstLevelStaticPath() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/superpath2/junk/subpath1")
        .transports(String.class)
        .over(Json.class)
        .post("");

    assert RestfulWebServiceWithSubpaths2.PATH_1.equals(response.toString()) : response.toString();
  }
View Full Code Here

    assert RestfulWebServiceWithSubpaths2.PATH_1.equals(response.toString()) : response.toString();
  }

  public void shouldServiceSameFirstLevelStaticPathWithPutMethod() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/superpath2/junk/subpath1")
        .transports(String.class)
        .over(Json.class)
        .put("");

    assert RestfulWebServiceWithSubpaths2.PATH_1_PUT.equals(response.toString())
        : response.toString();
  }
View Full Code Here

    assert RestfulWebServiceWithSubpaths2.PATH_1_PUT.equals(response.toString())
        : response.toString();
  }

  public void shouldServiceSameFirstLevelStaticPathWithDeleteMethod() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/superpath2/junk/subpath1")
        .transports(String.class)
        .over(Json.class)
        .delete();

    assert RestfulWebServiceWithSubpaths2.PATH_1_DELETE.equals(response.toString())
        : response.toString();
  }
View Full Code Here

    assert RestfulWebServiceWithSubpaths2.PATH_1_DELETE.equals(response.toString())
        : response.toString();
  }

  public void shouldServiceTwoLevelDynamicPath() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/superpath2/junk/more_junk")
        .transports(String.class)
        .over(Json.class)
        .post("");

    assert "junk_more_junk".equals(response.toString()) : response.toString();
  }
View Full Code Here

    assert "junk_more_junk".equals(response.toString()) : response.toString();
  }

  public void shouldServiceTwoLevelDynamicPathWithDeleteMethod() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/superpath2/junk/more_junk")
        .transports(String.class)
        .over(Json.class)
        .delete();

    assert "delete:junk_more_junk".equals(response.toString()) : response.toString();
  }
View Full Code Here

    assert "delete:junk_more_junk".equals(response.toString()) : response.toString();
  }

  public void shouldServiceThreeLevelDynamicPathWithDeleteMethod() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.baseUrl() + "/superpath2/junk/more_junk/most_junk")
        .transports(String.class)
        .over(Json.class)
        .delete();

    assert "delete:junk_more_junk_most_junk".equals(response.toString()) : response.toString();
  }
View Full Code Here

TOP

Related Classes of com.google.sitebricks.client.WebResponse

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.