MCPcopy Create free account
hub / github.com/apache/pig / testZoneDST

Method testZoneDST

test/org/apache/pig/test/TestDateTime.java:200–215  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

198 }
199
200 @Test
201 public void testZoneDST() throws Exception {
202 String defaultDTZ = "America/New_York"; // a timezone that uses DST
203 pigServerLocal.getPigContext().getProperties().setProperty("pig.datetime.default.tz", defaultDTZ);
204 pigServerLocal.registerQuery("a = load '"
205 + Util.encodeEscape(Util.generateURI(tmpFile.toString(), pigServerLocal.getPigContext()))
206 + "' as (test:datetime);");
207 pigServerLocal.registerQuery("b = filter a by test > ToDate('2014-01-01T00:00:00.000');");
208 pigServerLocal.registerQuery("c = foreach b generate ToString(test, 'Z') as tz;");
209 Iterator<Tuple> actualItr = pigServerLocal.openIterator("c");
210
211 Tuple est = actualItr.next();
212 assertEquals(Util.buildTuple("-0500"), est);
213 Tuple edt = actualItr.next();
214 assertEquals(Util.buildTuple("-0400"), edt);
215 }
216
217 private static Iterator<Tuple> generateExpectedResults(DateTimeZone dtz)
218 throws Exception {

Callers

nothing calls this directly

Calls 11

encodeEscapeMethod · 0.95
generateURIMethod · 0.95
buildTupleMethod · 0.95
openIteratorMethod · 0.80
setPropertyMethod · 0.65
getPropertiesMethod · 0.45
getPigContextMethod · 0.45
registerQueryMethod · 0.45
toStringMethod · 0.45
nextMethod · 0.45
assertEqualsMethod · 0.45

Tested by

no test coverage detected