Search in sources :

Example 1 with GoogleBidRequest

use of com.xrtb.exchanges.google.GoogleBidRequest in project XRTB by benmfaul.

the class MyReader method testGoogleProtobufBanner.

/**
	 * Test a valid bid response.
	 * 
	 * @throws Exception
	 *             on networking errors.
	 */
//@Test
public void testGoogleProtobufBanner() throws Exception {
    HttpPostGet http = new HttpPostGet();
    GoogleBidRequest google = GoogleBidRequest.fromRTBFile("./SampleBids/nexage.txt");
    byte[] protobytes = google.getInternal().toByteArray();
    byte[] returns = http.sendPost("http://" + Config.testHost + "/rtb/bids/google", protobytes, 300000, 300000);
    int code = http.getResponseCode();
    assertTrue(code == 200);
    assertNotNull(returns);
    GoogleBidResponse rr = new GoogleBidResponse(returns);
    System.out.println(rr.getInternal());
}
Also used : HttpPostGet(com.xrtb.common.HttpPostGet) GoogleBidRequest(com.xrtb.exchanges.google.GoogleBidRequest) GoogleBidResponse(com.xrtb.exchanges.google.GoogleBidResponse)

Example 2 with GoogleBidRequest

use of com.xrtb.exchanges.google.GoogleBidRequest in project XRTB by benmfaul.

the class MyReader method testGoogleProtobufVideo.

//@Test
public void testGoogleProtobufVideo() throws Exception {
    HttpPostGet http = new HttpPostGet();
    GoogleBidRequest google = GoogleBidRequest.fromRTBFile("./SampleBids/nexage.txt");
    byte[] protobytes = google.getInternal().toByteArray();
    byte[] returns = http.sendPost("http://" + Config.testHost + "/rtb/bids/google", protobytes, 300000, 300000);
    int code = http.getResponseCode();
    assertTrue(code == 200);
    assertNotNull(returns);
    GoogleBidResponse rr = new GoogleBidResponse(returns);
    System.out.println(rr.getInternal());
}
Also used : HttpPostGet(com.xrtb.common.HttpPostGet) GoogleBidRequest(com.xrtb.exchanges.google.GoogleBidRequest) GoogleBidResponse(com.xrtb.exchanges.google.GoogleBidResponse)

Aggregations

HttpPostGet (com.xrtb.common.HttpPostGet)2 GoogleBidRequest (com.xrtb.exchanges.google.GoogleBidRequest)2 GoogleBidResponse (com.xrtb.exchanges.google.GoogleBidResponse)2