You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by br...@apache.org on 2012/08/06 16:25:37 UTC

svn commit: r1369856 - /continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/listener/CaptureScreenShotsListener.java

Author: brett
Date: Mon Aug  6 14:25:36 2012
New Revision: 1369856

URL: http://svn.apache.org/viewvc?rev=1369856&view=rev
Log:
only error when the directory really failed, not just existed already

Modified:
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/listener/CaptureScreenShotsListener.java

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/listener/CaptureScreenShotsListener.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/listener/CaptureScreenShotsListener.java?rev=1369856&r1=1369855&r2=1369856&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/listener/CaptureScreenShotsListener.java (original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/listener/CaptureScreenShotsListener.java Mon Aug  6 14:25:36 2012
@@ -85,9 +85,10 @@ public class CaptureScreenShotsListener
         int lNumber = stackTrace[index].getLineNumber();
         String lineNumber = Integer.toString( lNumber );
         String className = cName.substring( cName.lastIndexOf( '.' ) + 1 );
-        if ( !targetPath.mkdirs() )
+        if ( !targetPath.exists() && !targetPath.mkdirs() )
         {
             System.out.println( "Unable to create screenshots directory" );
+            return;
         }
         String fileBaseName = methodName + "_" + className + ".java_" + lineNumber + "-" + time;
         try