db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bpendle...@apache.org
Subject svn commit: r573432 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/SQLToJUnit.java
Date Fri, 07 Sep 2007 03:01:24 GMT
Author: bpendleton
Date: Thu Sep  6 20:01:24 2007
New Revision: 573432

URL: http://svn.apache.org/viewvc?rev=573432&view=rev
Log:
DERBY-2151: Fixer-upper utility to help convert ij canon tests to JUnit

This patch modifies SQLToJUnit.java so that it quietly skips entirely
blank lines. Prior to this patch, such lines could cause SQLToJUnit to
throw a NullPointerException. An example of a canon with entirely
blank lines is tests/lang/groupBy.sql.


Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/SQLToJUnit.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/SQLToJUnit.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/SQLToJUnit.java?rev=573432&r1=573431&r2=573432&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/SQLToJUnit.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/SQLToJUnit.java
Thu Sep  6 20:01:24 2007
@@ -1170,11 +1170,19 @@
         	}
         	int linetype;
         	
+            // Skip entirely blank lines:
+            while (nextline != null)
+            {
+                nextline = nextline.trim();
+                if (nextline.length() == 0)
+                    nextline = ijScript.readLine();	
+                else
+                    break;
+            }
         	if (nextline == null) {
         		c = -1;
         		break;
         	} else {
-        		nextline = nextline.trim();
         		linetype = getLineType(nextline);
         		// multiple lines of SQL comments will be condensed in convert().
         		// If we are inside a result set, allow the first line of a command



Mime
View raw message