You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by le...@apache.org on 2011/07/24 19:48:25 UTC

svn commit: r1150444 - /pdfbox/trunk/preflight/src/test/java/org/apache/padaf/preflight/TestIsartorValidationFromClasspath.java

Author: lehmi
Date: Sun Jul 24 17:48:24 2011
New Revision: 1150444

URL: http://svn.apache.org/viewvc?rev=1150444&view=rev
Log:
PDFBOX-1056: don't run the test without input files

Modified:
    pdfbox/trunk/preflight/src/test/java/org/apache/padaf/preflight/TestIsartorValidationFromClasspath.java

Modified: pdfbox/trunk/preflight/src/test/java/org/apache/padaf/preflight/TestIsartorValidationFromClasspath.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/test/java/org/apache/padaf/preflight/TestIsartorValidationFromClasspath.java?rev=1150444&r1=1150443&r2=1150444&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/test/java/org/apache/padaf/preflight/TestIsartorValidationFromClasspath.java (original)
+++ pdfbox/trunk/preflight/src/test/java/org/apache/padaf/preflight/TestIsartorValidationFromClasspath.java Sun Jul 24 17:48:24 2011
@@ -140,27 +140,32 @@ result.getErrorsList().get(0).getErrorCo
      }
 
      @Parameters
-     public static Collection<Object[]> initializeParameters() throws 
-Exception {
+     public static Collection<Object[]> initializeParameters() throws Exception 
+     {
          // load expected errors
-         InputStream expected = IsartorTargetFileInformation.class
-         .getResourceAsStream("/expected_errors.txt");
+         InputStream expected = IsartorTargetFileInformation.class.getResourceAsStream("/expected_errors.txt");
          Properties props = new Properties();
          props.load(expected);
          IOUtils.closeQuietly(expected);
          // prepare config
          List<Object[]> data = new ArrayList<Object[]>();
          InputStream is = Class.class.getResourceAsStream("/Isartor testsuite.list");
-         BufferedReader reader = new BufferedReader(new 
-InputStreamReader(is));
-         String line = reader.readLine();
-         while (line!=null) {
-             String fn = new File(line).getName();
-              String error = new StringTokenizer(props.getProperty(fn), 
-"//").nextToken().trim();
-              Object[] tmp = new Object[] { "/"+line, error };
-             data.add(tmp);
-             line = reader.readLine();
+         if (is != null)
+         {
+	         BufferedReader reader = new BufferedReader(new InputStreamReader(is));
+	         String line = reader.readLine();
+	         while (line!=null) 
+	         {
+	        	 String fn = new File(line).getName();
+	        	 String error = new StringTokenizer(props.getProperty(fn), "//").nextToken().trim();
+	        	 Object[] tmp = new Object[] { "/"+line, error };
+	             data.add(tmp);
+	             line = reader.readLine();
+	         }
+         }
+         else
+         {
+        	 System.out.println("TestIsartorValidationFromClasspath.initializeParameters(): No input files found");
          }
          return data;
      }