summaryrefslogtreecommitdiffstats
path: root/tests/server-side/com/vaadin/data/util
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2011-09-30 13:55:36 +0000
committerArtur Signell <artur.signell@itmill.com>2011-09-30 13:55:36 +0000
commite69daa1270137d3dbeaf783c295ec32a3b0f099c (patch)
treebfa1c9da81d03b947ca17ce72110a9dfe8efeefb /tests/server-side/com/vaadin/data/util
parentce46da1c3d92b0b8c0515e8937b5c8dee5ff8ac9 (diff)
downloadvaadin-framework-e69daa1270137d3dbeaf783c295ec32a3b0f099c.tar.gz
vaadin-framework-e69daa1270137d3dbeaf783c295ec32a3b0f099c.zip
#7697 Corrected test so it won't affect other tests
svn changeset:21478/svn branch:6.7
Diffstat (limited to 'tests/server-side/com/vaadin/data/util')
-rw-r--r--tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java19
1 files changed, 13 insertions, 6 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 6b3aed3203..56c9921a0b 100644
--- a/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java
+++ b/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java
@@ -818,10 +818,8 @@ 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() {
+
+ Handler ensureNoLogging = new Handler() {
@Override
public void publish(LogRecord record) {
@@ -836,9 +834,18 @@ public class SQLContainerTest {
@Override
public void close() throws SecurityException {
}
- });
+ };
+
+ SQLContainer container = new SQLContainer(new FreeformQuery(
+ "SELECT * FROM people", connectionPool, "ID"));
+ Logger logger = Logger.getLogger(SQLContainer.class.getName());
- Assert.assertFalse(container.containsId(new Object()));
+ logger.addHandler(ensureNoLogging);
+ try {
+ Assert.assertFalse(container.containsId(new Object()));
+ } finally {
+ logger.removeHandler(ensureNoLogging);
+ }
}
@Test