commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1697208 - /commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/util/Class2HTMLTestCase.java
Date Sun, 23 Aug 2015 16:07:23 GMT
Author: sebb
Date: Sun Aug 23 16:07:23 2015
New Revision: 1697208

URL: http://svn.apache.org/r1697208
Log:
FindBUgs: Check return of mkdirs()

Modified:
    commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/util/Class2HTMLTestCase.java

Modified: commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/util/Class2HTMLTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/util/Class2HTMLTestCase.java?rev=1697208&r1=1697207&r2=1697208&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/util/Class2HTMLTestCase.java
(original)
+++ commons/proper/bcel/trunk/src/test/java/org/apache/commons/bcel6/util/Class2HTMLTestCase.java
Sun Aug 23 16:07:23 2015
@@ -21,6 +21,7 @@ import java.io.File;
 import java.io.FileInputStream;
 
 import org.apache.commons.bcel6.classfile.ClassParser;
+import org.junit.Assert;
 
 import junit.framework.TestCase;
 
@@ -28,7 +29,9 @@ public class Class2HTMLTestCase extends
 
     public void testConvertJavaUtil() throws Exception {
         File outputDir = new File("target/test-output/html");
-        outputDir.mkdirs();
+        if (!outputDir.mkdirs()) { // either was not created or already existed
+            Assert.assertTrue(outputDir.isDirectory()); // fail if missing
+        }
 
         FileInputStream file = new FileInputStream("target/test-classes/Java8Example.class");
 



Mime
View raw message