lines.add("1374100685.556 4 192.168.5.178 TCP_CLIENT_REFRESH_MISS/200 1069 POST http://www.google.com/analytics/6b8f7d8a-5832-439b-8dcf-34f60108b3d5 mestevez DIRECT/192.168.5.117 text/html");
lines.add("1374100685.556 4 192.168.5.178 TCP_CLIENT_REFRESH_MISS/200 1315 GET http://www.twitter.com/30af5bdb-fa3e-4a8f-bcb1-bce6479dc413 mrodriguez DIRECT/192.168.5.117 text/html");
lines.add("1374100685.556 4 192.168.5.178 TCP_CLIENT_REFRESH_MISS/200 1318 POST http://www.google.com/analytics/f03c65be-459e-4358-8653-0fa0e971cfb6 mestevez DIRECT/192.168.5.117 text/html");
input.put("$INPUT1", lines);
Response output =
HiveBuilder.create()
.withClientProperties(TestingUtil.getDefaultProperties())
.hiveTestWithEmbeddedHive("src/test/resources/scripts/squid-logs.hql")
.outputForInput(input);
List<String> expected = Lists.newArrayList();
expected.add("http://www.maps.google.com/8314c8d5-7df9-4abe-8acb-9366b7c887c2\tGET\t1.374100685556E9");
assertEquals(expected, output.getResult());
}