summaryrefslogtreecommitdiffstats
path: root/tests/server-side
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2011-09-30 08:21:07 +0000
committerArtur Signell <artur.signell@itmill.com>2011-09-30 08:21:07 +0000
commit8e8f30623a11211a153828b8105a63f3ffc81917 (patch)
tree6004650c930b989458ae7defaa8cc1fac3fe5004 /tests/server-side
parentc4b62e478ac9ab8f66c3ca4289619b0f9c8ee958 (diff)
downloadvaadin-framework-8e8f30623a11211a153828b8105a63f3ffc81917.tar.gz
vaadin-framework-8e8f30623a11211a153828b8105a63f3ffc81917.zip
#7697 SQLContainer.containsId logs a ClassCastException
svn changeset:21463/svn branch:6.7
Diffstat (limited to 'tests/server-side')
-rw-r--r--tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java b/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java
index d82909041f..6b3aed3203 100644
--- a/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java
+++ b/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java
@@ -7,6 +7,9 @@ import java.sql.Statement;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.logging.Handler;
+import java.util.logging.LogRecord;
+import java.util.logging.Logger;
import org.easymock.EasyMock;
import org.easymock.IAnswer;
@@ -814,6 +817,31 @@ public class SQLContainerTest {
}
@Test
+ public void containsId_unknownObject() throws SQLException {
+ SQLContainer container = new SQLContainer(new FreeformQuery(
+ "SELECT * FROM people", connectionPool, "ID"));
+ Logger logger = Logger.getLogger(SQLContainer.class.getName());
+ logger.addHandler(new Handler() {
+
+ @Override
+ public void publish(LogRecord record) {
+ Assert.fail("No messages should be logged");
+
+ }
+
+ @Override
+ public void flush() {
+ }
+
+ @Override
+ public void close() throws SecurityException {
+ }
+ });
+
+ Assert.assertFalse(container.containsId(new Object()));
+ }
+
+ @Test
public void removeItem_freeformOneAddedItem_removesTheAddedItem()
throws SQLException {
SQLContainer container = new SQLContainer(new FreeformQuery(