db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fuzzylo...@apache.org
Subject svn commit: r531596 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/SQLToJUnit.java
Date Mon, 23 Apr 2007 20:59:38 GMT
Author: fuzzylogic
Date: Mon Apr 23 13:59:37 2007
New Revision: 531596

URL: http://svn.apache.org/viewvc?view=rev&rev=531596
Log:
SQLToJUnit utility would try to print an array for an empty result set if a
row count followed the empty result set. Fix it so that the row count line is
completely ignored.

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?view=diff&rev=531596&r1=531595&r2=531596
==============================================================================
--- 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
Mon Apr 23 13:59:37 2007
@@ -1,6 +1,7 @@
 package org.apache.derbyTesting.functionTests.util;
 
 import java.io.*;
+import java.util.Enumeration;
 import java.util.Properties;
 import java.util.StringTokenizer;
 
@@ -264,8 +265,20 @@
 
             System.out.println("\n  ==> Ignored " + numIgnored + " lines and left " +
                 numUnconverted + " lines unconverted.\n  ==> Output is in '" +
-                jTestName + ".junit'.\n\nDone.\n");
+                jTestName + ".junit'.\n\n");
+            
+            if (multipleUserConnections) {
+            	System.out.print("Found multiple users: ");
+            	for (Enumeration e = userConnections.elements(); e.hasMoreElements(); )
+            	{
+            		System.out.print("\"");
+            		System.out.print(e.nextElement());
+            		System.out.print("\"");
+            		System.out.print((e.hasMoreElements() ? ", " : ""));
+            	}
+            }
 
+            System.out.println("\n\nDone.\n");
             junit.flush();
     
         } catch (Exception e) {
@@ -939,8 +952,15 @@
         {
             // Second row is just "underlining" of the column names,
             // so skip it.
-            if ((rowCount == 1) || (getLineType(row) == ROW_COUNT))
+            if (rowCount == 1)
                 continue;
+            
+            // ignore last line ROW_COUNTs
+            // continue to write out assert statement.
+            if (getLineType(row) == ROW_COUNT) {
+            	rowCount--;
+            	continue;
+            }
 
             // First row is column names.
             if (rowCount == 0)



Mime
View raw message