You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by an...@apache.org on 2018/11/05 15:57:50 UTC

oozie git commit: OOZIE-3376 [tests] TestGraphGenerator should assume JDK8 minor version at least 1.8.0_u40 (andras.piros)

Repository: oozie
Updated Branches:
  refs/heads/master 38ab52f59 -> 89248dd26


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/89248dd2
Tree: http://git-wip-us.apache.org/repos/asf/oozie/tree/89248dd2
Diff: http://git-wip-us.apache.org/repos/asf/oozie/diff/89248dd2

Branch: refs/heads/master
Commit: 89248dd26d9312e5a7390752939e1a73f8da8d07
Parents: 38ab52f
Author: Andras Piros <an...@cloudera.com>
Authored: Mon Nov 5 16:56:33 2018 +0100
Committer: Andras Piros <an...@cloudera.com>
Committed: Mon Nov 5 16:56:33 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/89248dd2/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/89248dd2/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/89248dd2/docs/src/site/markdown/WebServicesAPI.md
----------------------------------------------------------------------
diff --git a/docs/src/site/markdown/WebServicesAPI.md b/docs/src/site/markdown/WebServicesAPI.md
index 7cf62e5..3ffa984 100644
--- a/docs/src/site/markdown/WebServicesAPI.md
+++ b/docs/src/site/markdown/WebServicesAPI.md
@@ -1800,6 +1800,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/89248dd2/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 374719b..70156a4 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -9,6 +9,7 @@ OOZIE-3277 [build] Check for star imports (kmarton via andras.piros)
 
 -- 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)