You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by mo...@apache.org on 2013/01/25 19:00:57 UTC
svn commit: r1438623 - in /oozie/branches/branch-3.3:
core/src/main/java/org/apache/oozie/util/GraphGenerator.java
core/src/test/java/org/apache/oozie/util/TestGraphGenerator.java
release-log.txt
Author: mona
Date: Fri Jan 25 18:00:56 2013
New Revision: 1438623
URL: http://svn.apache.org/viewvc?rev=1438623&view=rev
Log:
OOZIE-1186 Image load for Job DAG visualization should handle resources better (mona)
Modified:
oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/util/GraphGenerator.java
oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/util/TestGraphGenerator.java
oozie/branches/branch-3.3/release-log.txt
Modified: oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/util/GraphGenerator.java
URL: http://svn.apache.org/viewvc/oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/util/GraphGenerator.java?rev=1438623&r1=1438622&r2=1438623&view=diff
==============================================================================
--- oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/util/GraphGenerator.java (original)
+++ oozie/branches/branch-3.3/core/src/main/java/org/apache/oozie/util/GraphGenerator.java Fri Jan 25 18:00:56 2013
@@ -84,7 +84,7 @@ public class GraphGenerator {
* Overridden to thwart finalizer attack
*/
@Override
- public void finalize() {
+ public final void finalize() {
// No-op; just to avoid finalizer attack
// as the constructor is throwing an exception
}
@@ -258,9 +258,24 @@ public class GraphGenerator {
try {
ImageIO.write(img, "png", out);
- } catch (IOException ioe) {
+ }
+ catch (IOException ioe) {
throw new SAXException(ioe);
}
+ finally {
+ try {
+ out.close(); //closing connection is imperative
+ //regardless of ImageIO.write throwing exception or not
+ //hence in finally block
+ }
+ catch (IOException e) {
+ XLog.getLog(getClass()).trace("Exception while closing OutputStream");
+ }
+ out = null;
+ img.flush();
+ g.dispose();
+ vis.removeAll();
+ }
}
@Override
Modified: oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/util/TestGraphGenerator.java
URL: http://svn.apache.org/viewvc/oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/util/TestGraphGenerator.java?rev=1438623&r1=1438622&r2=1438623&view=diff
==============================================================================
--- oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/util/TestGraphGenerator.java (original)
+++ oozie/branches/branch-3.3/core/src/test/java/org/apache/oozie/util/TestGraphGenerator.java Fri Jan 25 18:00:56 2013
@@ -31,13 +31,15 @@ public class TestGraphGenerator extends
public void testConstructor() {
try {
- GraphGenerator graphGenerator = new GraphGenerator(null, null);
- } catch(IllegalArgumentException iae) {
+ new GraphGenerator(null, null);
+ }
+ catch (IllegalArgumentException iae) {
Assert.assertTrue("Construction with illegal args failed as expected: " + iae.getMessage(), true);
}
try {
- GraphGenerator graphGenerator1 = new GraphGenerator("<workflow></workflow>", null);
- } catch(IllegalArgumentException iae) {
+ new GraphGenerator("<workflow></workflow>", null);
+ }
+ catch (IllegalArgumentException iae) {
Assert.assertTrue("Construction with illegal args failed as expected: " + iae.getMessage(), true);
}
Assert.assertNotNull(new GraphGenerator("<workflow></workflow>", new JsonWorkflowJob()));
@@ -60,7 +62,8 @@ public class TestGraphGenerator extends
try {
GraphGenerator g = new GraphGenerator(readFile("src/test/resources/graphWF.xml"), jsonWFJob);
g.write(new FileOutputStream(new File(png1)));
- } catch(Exception e) {
+ }
+ catch (Exception e) {
Assert.fail("Write PNG failed for graphWF.xml: " + e.getMessage());
}
@@ -68,14 +71,16 @@ public class TestGraphGenerator extends
try {
// Check if a valid file was written
Assert.assertNotNull(ImageIO.read(f1));
- } catch(IOException io) {
+ }
+ catch (IOException io) {
Assert.fail("Not a valid PNG: " + io.getMessage());
}
try {
GraphGenerator g = new GraphGenerator(readFile("src/test/resources/graphWF.xml"), jsonWFJob, true);
g.write(new FileOutputStream(new File(png2)));
- } catch(Exception e) {
+ }
+ catch (Exception e) {
Assert.fail("Write PNG failed for graphWF.xml: " + e.getMessage());
}
@@ -83,7 +88,8 @@ public class TestGraphGenerator extends
try {
// Check if a valid file was written
Assert.assertNotNull(ImageIO.read(f2));
- } catch(IOException io) {
+ }
+ catch (IOException io) {
Assert.fail("Not a valid PNG: " + io.getMessage());
}
@@ -94,7 +100,8 @@ public class TestGraphGenerator extends
try {
GraphGenerator g = new GraphGenerator(readFile("src/test/resources/invalidGraphWF.xml"), jsonWFJob, true);
g.write(new FileOutputStream(new File("src/test/resources/invalid.png")));
- } catch(Exception e) {
+ }
+ catch (Exception e) {
Assert.fail("Write PNG failed for invalidGraphWF.xml: " + e.getMessage());
}
new File("src/test/resources/invalid.png").delete();
@@ -102,7 +109,7 @@ public class TestGraphGenerator extends
private static String readFile(String path) throws IOException {
File f = new File(path);
- System.out.println(f.getAbsolutePath());
+ System.out.println("Reading input file " + f.getAbsolutePath());
FileInputStream stream = new FileInputStream(f);
try {
FileChannel fc = stream.getChannel();
Modified: oozie/branches/branch-3.3/release-log.txt
URL: http://svn.apache.org/viewvc/oozie/branches/branch-3.3/release-log.txt?rev=1438623&r1=1438622&r2=1438623&view=diff
==============================================================================
--- oozie/branches/branch-3.3/release-log.txt (original)
+++ oozie/branches/branch-3.3/release-log.txt Fri Jan 25 18:00:56 2013
@@ -1,3 +1,7 @@
+-- Oozie 3.3.2 release (unreleased)
+
+OOZIE-1186 Image load for Job DAG visualization should handle resources better (mona)
+
-- Oozie 3.3.1 release
OOZIE-1175 Update POM version to 3.3.1 for 3.3 branch (virag)