OOZIE-3376 [tests] TestGraphGenerator should assume JDK8 minor version at least 1.8.0_u40 (andras.piros)
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.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
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.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.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 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 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 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 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 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 @@
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 {
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 @@
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
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)