More explicit failure message - fixed FindBugs nags
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 1 Mar 2011 08:50:40 +0000 (08:50 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 1 Mar 2011 08:50:40 +0000 (08:50 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1075713 13f79535-47bb-0310-9956-ffa450edef68

test/org/apache/catalina/servlets/TestDefaultServlet.java

index cf01d5d..606c5db 100644 (file)
@@ -153,7 +153,10 @@ public class TestDefaultServlet extends TomcatBaseTest {
      */
     public void testCustomErrorPage() throws Exception {
         File appDir = new File(getTemporaryDirectory(), "MyApp");
-        new File(appDir, "WEB-INF").mkdirs();
+        File webInf = new File(appDir, "WEB-INF");
+        if (!webInf.mkdirs()) {
+            fail("Unable to create directory [" + webInf + "]");
+        }
         Writer w = new OutputStreamWriter(new FileOutputStream(new File(appDir,
                 "WEB-INF/web.xml")), "UTF-8");
         try {
@@ -234,7 +237,10 @@ public class TestDefaultServlet extends TomcatBaseTest {
      */
     public void testCustomErrorPageMissing() throws Exception {
         File appDir = new File(getTemporaryDirectory(), "MyApp");
-        new File(appDir, "WEB-INF").mkdirs();
+        File webInf = new File(appDir, "WEB-INF");
+        if (!webInf.mkdirs()) {
+            fail("Unable to create directory [" + webInf + "]");
+        }
         Writer w = new OutputStreamWriter(new FileOutputStream(new File(appDir,
                 "WEB-INF/web.xml")), "UTF-8");
         try {