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

Method testDateTimeWritables

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

Source from the content-addressed store, hash-verified

97 }
98
99 @Test
100 public void testDateTimeWritables() throws IOException {
101 Configuration jobConf = new Configuration();
102
103 DateTimeWritable.setupAvailableZoneIds();
104 UDFContext.getUDFContext().addJobConf(jobConf);
105
106 String[] testZones = new String[]{"America/Los_Angeles", "Europe/London", "Europe/Budapest", "Japan"};
107
108 DateTime testInputBase = DateTime.now();
109 for (String zoneId : testZones){
110 DateTimeZone customTZ = DateTimeZone.forID(zoneId);
111 //Test with timezone name as zone ID
112 testDateTimeForZone(new DateTime(testInputBase).withZoneRetainFields(customTZ));
113 //Test with offset as zone ID
114 testDateTimeForZone(new DateTime(testInputBase, DateTimeZone.forOffsetMillis(customTZ.getOffset(testInputBase))));
115 }
116
117 }
118
119 private void testDateTimeForZone(DateTime testIn) throws IOException {
120 DateTimeWritable in = new DateTimeWritable(testIn);

Callers

nothing calls this directly

Calls 5

setupAvailableZoneIdsMethod · 0.95
getUDFContextMethod · 0.95
testDateTimeForZoneMethod · 0.95
addJobConfMethod · 0.80
getOffsetMethod · 0.45

Tested by

no test coverage detected