Some text after the iframe.
Some text after the iframe.
Some text after the iframe.
Some text after the iframe.
Some text after the iframe.
Some text after the iframe.
Some text after the iframe.
Some text after the iframe.
Some text after the iframe.
Some text after the iframe.
Some text after the iframe.
Some text after the iframe.
import static com.jayway.restassured.RestAssured.given;
import com.jayway.restassured.RestAssured;
import com.jayway.restassured.response.Response;
public class GoogleMapAPI extends BaseClass{
public GoogleMapAPI(String url){
RestAssured.baseURI=url;
}
public Response getAddressResponse(String url)
{ Response response=given().that().contentType( "application/json").when().get(url);
return response; }
}
import static com.jayway.restassured.RestAssured.given;
import static org.testng.Assert.*;
import java.util.ResourceBundle;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import com.google.map.api.util.BaseClass;
import com.google.map.api.util.GoogleMapAPI;
import com.jayway.restassured.response.Response;
public class TestGoogleMapApi extends BaseClass{
GoogleMapAPI object;
ResourceBundle bundle;
String caseId;
String app_id;
String url;
@BeforeClass
public void doSetUp()
{
bundle=ResourceBundle.getBundle("resource");
url = bundle.getString("URI");
object= new GoogleMapAPI(url) ;
}
@Test
public void testFindresponse()
{
System.out.println("===============Executing the TCs : Test testFindresponse ======================");
System.out.println("===============Executing the Method : testFindresponse ======================");
try{
Response response=object.getAddressResponse(url+"Patna");
System.out.println("The Response is "+response.asString());
assertNotNull(response);
System.out.println("===============Completed the Method : testFindresponse ======================");
}
catch(Exception Ex)
{
Ex.printStackTrace();
logger.error("==========================testFindresponse Method Failed==================");
}
}
}
import org.apache.log4j.Logger;
public class BaseClass {
protected final Logger logger = Logger.getLogger(this.getClass());
}
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>GoogleMapRestTest</groupId>
<artifactId>GoogleMapRestTest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>GoogleMapRestTest</name>
<description>GoogleMapRestTest</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.jayway.restassured</groupId>
<artifactId>rest-assured</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.39.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<testSourceDirectory>src/test/java</testSourceDirectory>
<testResources>
<testResource>
<directory>src/test/resources/properties</directory>
<includes>
<include>**/*</include>
</includes>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<fork>true</fork>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<configuration>
<forkMode>always</forkMode>
<testFailureIgnore>true</testFailureIgnore>
<suiteXmlFiles>
<suiteXmlFile>${suiteName}.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>google_testng</id>
<properties>
<suiteName>google_testng</suiteName>
</properties>
</profile>
</profiles>
<repositories>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots />
</repository>
<repository>
<id>central</id>
<name>Central</name>
<url>http://repo.maven.apache.org/maven2</url>
</repository>
</repositories>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite" parallel="none">
<test name="Test">
<classes>
<class name="com.google.map.api.test.TestGoogleMapApi"/>
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->