[
https://issues.apache.org/jira/browse/OOZIE-2974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Attila Sasvari updated OOZIE-2974:
----------------------------------
Attachment: OOZIE-2974-01.patch
[~pbacsko], [~rkanter] can you please review? thanks. The change should not
cause problems in Oozie tests running with Hadoop 2.
> Change TestLiteWorkflowAppParser so that it works with Hadoop 3
> ---------------------------------------------------------------
>
> Key: OOZIE-2974
> URL: https://issues.apache.org/jira/browse/OOZIE-2974
> Project: Oozie
> Issue Type: Bug
> Reporter: Attila Sasvari
> Assignee: Attila Sasvari
> Attachments: OOZIE-2974-01.patch
>
>
> {{TestLiteWorkflowAppParser}} uses a
> [cleanupXML|https://github.com/apache/oozie/blob/branch-4.3/core/src/test/java/org/apache/oozie/workflow/lite/TestLiteWorkflowAppParser.java#L54]
> function to remove certain elements from a generated configuration XML when
> comparing with an expected value
> ([testParserGlobal()|https://github.com/apache/oozie/blob/branch-4.3/core/src/test/java/org/apache/oozie/workflow/lite/TestLiteWorkflowAppParser.java#L139]
> ):
> {code}
> private String cleanupXml(String xml) {
> xml = xml.replaceAll(" xmlns=?(\"|\')(\"|\')", "");
> xml = xml.replaceAll("\\s*<source>.*</source>", ""); // remove the
> <source> added by Hadoop 2
> return xml;
> }
> {code}
> [HADOOP-14216|https://issues.apache.org/jira/browse/HADOOP-14216] introduced
> a new "final" tag in the configuration that is set when hadoop 3 alpha 3 is
> used. See
> https://github.com/apache/hadoop/blob/branch-3.0.0-alpha3/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java#L2952
> If we run the the test {{TestLiteWorkflowAppParser#testParserGlobal}}, it
> currently fails with:
> {noformat}
> Failed tests:
> testParserGlobal(org.apache.oozie.workflow.lite.TestLiteWorkflowAppParser):
> null expected:<...(..)
> {noformat}
> generated config that is returned by {{app.getNode("d").getConf()}} is as
> follows:
> {noformat}
> <map-reducexmlns="uri:oozie:workflow:0.4">
> <prepare>
> <deletepath="/tmp"/>
> <mkdirpath="/tmp"/>
> </prepare>
> <streaming>
> <mapper>/mycat.sh</mapper>
> <reducer>/mywc.sh</reducer>
> </streaming>
> <file>/tmp</file>
> <archive>/tmp</archive>
> <name-node>bar</name-node>
> <job-tracker>${foo}</job-tracker>
> <configuration>
> <property>
> <name>b</name>
> <value>B</value>
> <final>false</final>
> </property>
> <property>
> <name>a</name>
> <value>A</value>
> <final>false</final>
> </property>
> </configuration>
> </map-reduce>
> {noformat}
> Tests pass, if we remove the {{final}} element. For example we can the
> following to {{cleanupXml()}}
> {code}
> xml = xml.replaceAll("\\s*<final>.*</final>", ""); // remove the <final>
> added by Hadoop 3
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)