Repository: oozie Updated Branches: refs/heads/branch-5.1 7d3787a6a -> 50b164408
OOZIE-3376 [tests] TestGraphGenerator should assume JDK8 minor version at least 1.8.0_u40 (andras.piros) Project: http://git-wip-us.apache.org/repos/asf/oozie/repo Commit: http://git-wip-us.apache.org/repos/asf/oozie/commit/50b16440 Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/50b16440 Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/50b16440 Branch: refs/heads/branch-5.1 Commit: 50b164408d8d97d2182c711b8ea2b42f0dfe5d2a Parents: 7d3787a Author: Andras Piros <andras.pi...@cloudera.com> Authored: Mon Nov 5 16:56:33 2018 +0100 Committer: Andras Piros <andras.pi...@cloudera.com> Committed: Mon Nov 5 16:58:26 2018 +0100 ---------------------------------------------------------------------- core/src/main/resources/oozie-log4j.properties | 1 + .../oozie/util/graph/TestGraphGenerator.java | 65 ++++++++++++++++++++ docs/src/site/markdown/WebServicesAPI.md | 2 + release-log.txt | 1 + 4 files changed, 69 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/oozie/blob/50b16440/core/src/main/resources/oozie-log4j.properties ---------------------------------------------------------------------- diff --git a/core/src/main/resources/oozie-log4j.properties b/core/src/main/resources/oozie-log4j.properties index ba8d7b9..e0ee393 100644 --- a/core/src/main/resources/oozie-log4j.properties +++ b/core/src/main/resources/oozie-log4j.properties @@ -60,3 +60,4 @@ log4j.logger.org.apache.hadoop=INFO, test log4j.logger.org.mortbay=INFO, test log4j.logger.org.hsqldb=INFO, test log4j.logger.org.apache.oozie.util.db=INFO, test +log4j.logger.org.apache.oozie.util.graph=DEBUG, test \ No newline at end of file http://git-wip-us.apache.org/repos/asf/oozie/blob/50b16440/core/src/test/java/org/apache/oozie/util/graph/TestGraphGenerator.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/oozie/util/graph/TestGraphGenerator.java b/core/src/test/java/org/apache/oozie/util/graph/TestGraphGenerator.java index 9b0e263..4e8cf0d 100644 --- a/core/src/test/java/org/apache/oozie/util/graph/TestGraphGenerator.java +++ b/core/src/test/java/org/apache/oozie/util/graph/TestGraphGenerator.java @@ -24,7 +24,10 @@ import org.apache.oozie.client.WorkflowAction; import org.apache.oozie.service.Services; import org.apache.oozie.test.XTestCase; import org.apache.oozie.util.IOUtils; +import org.apache.oozie.util.XLog; import org.junit.Assert; +import org.junit.Assume; +import org.junit.internal.AssumptionViolatedException; import javax.imageio.ImageIO; import java.io.BufferedReader; @@ -36,6 +39,8 @@ import java.io.IOException; import java.io.OutputStream; public class TestGraphGenerator extends XTestCase { + private static final XLog LOG = XLog.getLog(TestGraphGenerator.class); + private static final String GRAPH_WORKFLOW_DECISION_FORK_JOIN_XML = "graph-workflow-decision-fork-join.xml"; private static final String GRAPH_WORKFLOW_MANY_ACTIONS_XML = "graph-workflow-many-actions.xml"; private static final String GRAPH_WORKFLOW_SIMPLE_XML = "graph-workflow-simple.xml"; @@ -59,6 +64,15 @@ public class TestGraphGenerator extends XTestCase { } public void testSimpleGraphPng() { + try { + assumeJDKVersion(); + } + catch (final AssumptionViolatedException ave) { + // Due to JUnit38ClassRunner we have to check that explicitly instead of relying on junit.framework + LOG.warn(ave.getMessage()); + return; + } + final WorkflowJobBean jsonWFJob = createSimpleWorkflow(); generateAndAssertPng(jsonWFJob, GRAPH_WORKFLOW_SIMPLE_XML, false); @@ -103,6 +117,15 @@ public class TestGraphGenerator extends XTestCase { } public void testSimpleGraphDot() { + try { + assumeJDKVersion(); + } + catch (final AssumptionViolatedException ave) { + // Due to JUnit38ClassRunner we have to check that explicitly instead of relying on junit.framework + LOG.warn(ave.getMessage()); + return; + } + final WorkflowJobBean jsonWFJob = createSimpleWorkflow(); File outputDot = null; @@ -127,6 +150,15 @@ public class TestGraphGenerator extends XTestCase { } public void testSimpleGraphSvg() { + try { + assumeJDKVersion(); + } + catch (final AssumptionViolatedException ave) { + // Due to JUnit38ClassRunner we have to check that explicitly instead of relying on junit.framework + LOG.warn(ave.getMessage()); + return; + } + final WorkflowJobBean jsonWFJob = createSimpleWorkflow(); File outputDot = null; @@ -151,6 +183,15 @@ public class TestGraphGenerator extends XTestCase { } public void testGraphWithManyNodes() throws Exception { + try { + assumeJDKVersion(); + } + + catch (final AssumptionViolatedException ave) { + // Due to JUnit38ClassRunner we have to check that explicitly instead of relying on junit.framework + LOG.warn(ave.getMessage()); + return; + } new GraphGenerator(readXmlFromClasspath(GRAPH_WORKFLOW_MANY_ACTIONS_XML), createWorkflowInProgress(25), true, @@ -163,6 +204,15 @@ public class TestGraphGenerator extends XTestCase { } public void testGraphWithDecisionForkJoin() throws Exception { + try { + assumeJDKVersion(); + } + catch (final AssumptionViolatedException ave) { + // Due to JUnit38ClassRunner we have to check that explicitly instead of relying on junit.framework + LOG.warn(ave.getMessage()); + return; + } + new GraphGenerator(readXmlFromClasspath(GRAPH_WORKFLOW_DECISION_FORK_JOIN_XML), createWorkflowWithDecisionForkJoin(), true, @@ -219,6 +269,21 @@ public class TestGraphGenerator extends XTestCase { return workflowActionBean; } + /** + * Due to {@code guru.nidi:graphviz-java} >= 0.5.1 we need to check whether we have the proper minor version when running on + * JDK8. + * @see <a href="https://github.com/nidi3/graphviz-java/commit/b7cf5761f97f1491d3bdc65367ec00e38d66291d">this commit</a> + */ + private void assumeJDKVersion() { + final String version = System.getProperty("java.version"); + if (version.startsWith("1.8.0_")) { + try { + Assume.assumeTrue("An old version of Java 1.8 is used, skipping.", Integer.parseInt(version.substring(6)) >= 40); + } + catch (final NumberFormatException ignored) {} + } + } + private static class NullOutputStream extends OutputStream { @Override public void write(final int b) throws IOException { http://git-wip-us.apache.org/repos/asf/oozie/blob/50b16440/docs/src/site/markdown/WebServicesAPI.md ---------------------------------------------------------------------- diff --git a/docs/src/site/markdown/WebServicesAPI.md b/docs/src/site/markdown/WebServicesAPI.md index a303802..928e893 100644 --- a/docs/src/site/markdown/WebServicesAPI.md +++ b/docs/src/site/markdown/WebServicesAPI.md @@ -1712,6 +1712,8 @@ The node labels are the node names provided in the workflow XML. This API returns `HTTP 400` when run on a resource other than a workflow, viz. bundle and coordinator. +Note that when running on JDK8 the supported minimum minor version for this feature is `1.8.0_u40`. + #### Job Status An `HTTP GET` request that returns the current status (e.g. `SUCCEEDED`, `KILLED`, etc) of a given job. If you are only interested http://git-wip-us.apache.org/repos/asf/oozie/blob/50b16440/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index 19ba139..229dee4 100644 --- a/release-log.txt +++ b/release-log.txt @@ -1,5 +1,6 @@ -- Oozie 5.1.0 release +OOZIE-3376 [tests] TestGraphGenerator should assume JDK8 minor version at least 1.8.0_u40 (andras.piros) OOZIE-3370 amend Property filtering is not consistent across job submission (andras.piros) OOZIE-3370 Property filtering is not consistent across job submission (andras.piros) OOZIE-3369 [core] Upgrade guru.nidi:graphviz-java to 0.7.0 (andras.piros)