Author: kahatlen
Date: Tue Nov 6 13:20:18 2012
New Revision: 1406125
URL: http://svn.apache.org/viewvc?rev=1406125&view=rev
Log:
DERBY-5971: Improve test coverage for SQLBoolean class
Cover the hashCode() method by testing SELECT DISTINCT, which performs
a hash scan.
Modified:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/BooleanValuesTest.java
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/BooleanValuesTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/BooleanValuesTest.java?rev=1406125&r1=1406124&r2=1406125&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/BooleanValuesTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/BooleanValuesTest.java
Tue Nov 6 13:20:18 2012
@@ -1670,6 +1670,21 @@ public class BooleanValuesTest extends
{ null , null , null },
});
}
+
+ /**
+ * Verify that SELECT DISTINCT works as expected on boolean columns.
+ */
+ public void test_23_select_distinct() throws SQLException {
+ setAutoCommit(false);
+
+ Statement s = createStatement();
+ assertUpdateCount(s, 6, "insert into boolean_table(boolean_col) "
+ + "values true, true, false, false, null, null");
+
+ JDBC.assertUnorderedResultSet(
+ s.executeQuery("select distinct boolean_col from boolean_table"),
+ new String[][] { {"true"}, {"false"}, {null} });
+ }
/**
* <p>
|