Package com.lbslocal.test.helpers

Examples of com.lbslocal.test.helpers.Response


 
  @Test
  public void shouldGetZoomRadius() throws Exception {
    String xmlToBeSent = TestConstants.XML_HEADER + xstream.toXML(createAZoomRadius());
   
    Response responseFromWs =
      HttpClient.doPost(
        TestConstants.getMapRenderUrl(),
        xmlToBeSent);
   
    String body = responseFromWs.getBody();
   
    Assert.assertEquals("200", responseFromWs.getStatusCode());   
    Assert.assertEquals("text/xml;charset=UTF-8", responseFromWs.getContentType());
    Assert.assertTrue(body.startsWith("<?xml version='1.0' encoding='UTF-8'?>"));
    Document xmlParsed = XmlParser.parse(body);
   
    Response responseFromImage =
      HttpClient.doGet(
        xmlParsed
          .getElementsByTagName("url")
          .item(0)
          .getFirstChild()
          .getNodeValue());
   
    Assert.assertEquals("200", responseFromImage.getStatusCode());
  }
View Full Code Here


    findAddressResource.setToken(TestConstants.getToken());
    findAddressResource.setOptions(this.options);
   
    String xmlToBeSent = TestConstants.XML_HEADER + xstream.toXML(findAddressResource);
   
    Response response =
      HttpClient.doPost(
        TestConstants.getAddressFinderUrl(),
        xmlToBeSent);
   
    String body = response.getBody();
   
    Assert.assertEquals("200", response.getStatusCode());   
    Assert.assertEquals("text/xml;charset=UTF-8", response.getContentType());
    Assert.assertTrue(body.startsWith("<?xml version='1.0' encoding='UTF-8'?>"));
    XmlParser.parse(body);
  }
View Full Code Here

    findCityResource.setOptions(this.options);
    findCityResource.setToken(TestConstants.getToken());
   
    String xmlToBeSent = TestConstants.XML_HEADER + xstream.toXML(findCityResource);
   
    Response response =
      HttpClient.doPost(
        TestConstants.getAddressFinderUrl(),
        xmlToBeSent);
   
    String body = response.getBody();
   
    Assert.assertEquals("200", response.getStatusCode());
    Assert.assertEquals("text/xml;charset=UTF-8", response.getContentType());
    Assert.assertTrue(body.startsWith("<?xml version='1.0' encoding='UTF-8'?>"));
    XmlParser.parse(body);
  }
View Full Code Here

    address.setOptions(this.options);
    address.setTolerance(5);
   
    String xmlToBeSent = TestConstants.XML_HEADER + xstream.toXML(address);
   
    Response response =
      HttpClient.doPost(
        TestConstants.getAddressFinderUrl(),
        xmlToBeSent);
   
    String body = response.getBody();
   
    Assert.assertEquals("200", response.getStatusCode());
    Assert.assertTrue(body.startsWith("<?xml version='1.0' encoding='UTF-8'?>"));
    XmlParser.parse(body);
  }
View Full Code Here

    getXY.setAddress(createAnAddress());
    getXY.setToken(TestConstants.getToken());
   
    String xmlToBeSent = TestConstants.XML_HEADER + xstream.toXML(getXY);
   
    Response response =
      HttpClient.doPost(
        TestConstants.getAddressFinderUrl(),
        xmlToBeSent);
   
    String body = response.getBody();
   
    Assert.assertEquals("200", response.getStatusCode());
    Assert.assertTrue(body.startsWith("<?xml version='1.0' encoding='UTF-8'?>"));
    XmlParser.parse(body);
  }
View Full Code Here

public class DraggableApiTest {

  @Test
  public void shouldRetrieveTheApiVersion() throws Exception {
    Response responseFromApi = HttpClient.doGet(TestConstants.getDraggableApiUrl());
   
    System.out.println(responseFromApi.getBody());
   
    Assert.assertEquals("200", responseFromApi.getStatusCode());

    Response responseFromApiGz = HttpClient.doGet(getApiGzUriFromResponseBody(responseFromApi.getBody()));
   
    System.out.println(responseFromApiGz.getBody());
   
    String[] versionAndRevision = getVersionFromResponseBody(responseFromApiGz.getBody());
   
    Assert.assertEquals("1.0", versionAndRevision[0]);
    Assert.assertEquals("1", versionAndRevision[1]);
  }
View Full Code Here

TOP

Related Classes of com.lbslocal.test.helpers.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.