Package com.google.sitebricks.client

Examples of com.google.sitebricks.client.WebResponse


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

  public void shouldServiceVariableTwoLevelSubPath2() {
    String aString = "aoskdoaksd" + new Date().hashCode();
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.BASE_URL + "/superpath/subpath3/" + aString)
        .transports(String.class)
        .over(Json.class)
        .post("");

    // Should be reflected
    assert aString.equals(response.toString()) : response.toString();
  }
View Full Code Here


    assert "put:junk_more_junk_most_junk".equals(response.toString()) : response.toString();
  }

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

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

    assert "post:junk_more_junk_most_junk".equals(response.toString()) : response.toString();
  }

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

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

public class RestfuWebServiceWithCRUDAcceptanceTest {

  public void create() {
    String url = AcceptanceTest.BASE_URL + BASE_SERVICE_PATH;
    System.out.println("POST " + url);
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(url)
        .transports(String.class)
        .over(Json.class)
        .post("");

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

  }

  public void readCollection() {
    String url = AcceptanceTest.BASE_URL + BASE_SERVICE_PATH;
    System.out.println("GET " + url);
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(url)
        .transports(String.class)
        .over(Json.class)
        .get();

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

 

  public void readIndividual() {
    String url = AcceptanceTest.BASE_URL + BASE_SERVICE_PATH  + "/1";
    System.out.println("GET " + url);
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(url)
        .transports(String.class)
        .over(Json.class)
        .get();

    assert READ_INDIVIDUAL.equals(response.toString()) : response.toString();
 
View Full Code Here

 
 
  public void update() {
    String url = AcceptanceTest.BASE_URL + BASE_SERVICE_PATH  + "/1";
    System.out.println("PUT " + url);
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(url)
        .transports(String.class)
        .over(Json.class)
        .put("");

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

  }

  public void delete() {
    String url = AcceptanceTest.BASE_URL + BASE_SERVICE_PATH  + "/1";
    System.out.println("DELETE " + url);
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(url)
        .transports(String.class)
        .over(Json.class)
        .delete();

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

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

  public void shouldTransportJsonWithoutTemplate() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.BASE_URL + "/service")
        .transports(String.class)
        .over(Json.class)
        .get();
View Full Code Here

        }
      });
  }

  public void shouldRedirect() {
    WebResponse response = createInjector()
        .getInstance(Web.class)
        .clientOf(AcceptanceTest.BASE_URL + "/service")
        .transports(String.class)
        .over(Text.class)
        .post("");
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.