abstractdog commented on code in PR #408:
URL: https://github.com/apache/tez/pull/408#discussion_r2313554288
##########
tez-common/src/test/java/org/apache/tez/common/TestTezUtils.java:
##########
@@ -291,4 +301,30 @@ public void testPopulateConfProtoFromEntries() {
assertEquals(confBuilder.getConfKeyValuesList().size(), 1);
}
+ @Test(timeout = 5000)
+ public void testReadTezConfigurationXmlFromClasspath() throws IOException {
+ InputStream is =
ClassLoader.getSystemResourceAsStream(TezConfiguration.TEZ_SITE_XML);
+ Configuration conf = TezUtilsInternal.readTezConfigurationXml(is);
+ assertEquals(conf.get("tez.lib.uris"), "tez.tar.gz");
+ }
+
+ @Test(timeout = 5000)
+ public void testPluginsDescriptorFromJSON() throws IOException {
+ InputStream is =
ClassLoader.getSystemResourceAsStream(TezConstants.SERVICE_PLUGINS_DESCRIPTOR_JSON);
+ ServicePluginsDescriptor spd =
TezClientUtils.createPluginsDescriptorFromJSON(is);
+ TaskSchedulerDescriptor tsd = spd.getTaskSchedulerDescriptors()[0];
+ ContainerLauncherDescriptor cld = spd.getContainerLauncherDescriptors()[0];
+ TaskCommunicatorDescriptor tcd = spd.getTaskCommunicatorDescriptors()[0];
+
+ assertFalse(spd.areContainersEnabled());
+ assertTrue(spd.isUberEnabled());
+ assertEquals(tsd.getClassName(), "testScheduler0_class");
+ assertEquals(tsd.getEntityName(), "testScheduler0");
+ assertEquals(cld.getClassName(), "testLauncher0_class");
+ assertEquals(cld.getEntityName(), "testLauncher0");
+ assertEquals(tcd.getClassName(), "testComm0_class");
+ assertEquals(tcd.getEntityName(), "testComm0");
+ assertEquals(tcd.getUserPayload().getVersion(), 1);
+ assertArrayEquals(tcd.getUserPayload().deepCopyAsArray(), new byte[] {0,
0, 0, 1});
Review Comment:
good catch, let me fix
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]