diff options
author | Henrik Paul <henrik@vaadin.com> | 2015-01-14 15:40:49 +0200 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2015-01-27 10:20:06 +0000 |
commit | abaec0217b3351d6f1835d7095ed2a3958fbfcdb (patch) | |
tree | d9e675ea5e57cef1c9a18988b255c5ca8b118b03 /server/tests/src/com/vaadin | |
parent | 627c4c40997148f2c55ff7f533669a4284fbba2d (diff) | |
download | vaadin-framework-abaec0217b3351d6f1835d7095ed2a3958fbfcdb.tar.gz vaadin-framework-abaec0217b3351d6f1835d7095ed2a3958fbfcdb.zip |
Grid now uses ObjectRenderer by default (#15417)
Change-Id: I2aa8105c0eadbadb29f9aab9e3e3aeb21629f6f3
Diffstat (limited to 'server/tests/src/com/vaadin')
-rw-r--r-- | server/tests/src/com/vaadin/tests/server/renderer/RendererTest.java | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/server/tests/src/com/vaadin/tests/server/renderer/RendererTest.java b/server/tests/src/com/vaadin/tests/server/renderer/RendererTest.java index 464d409543..767c72f5d9 100644 --- a/server/tests/src/com/vaadin/tests/server/renderer/RendererTest.java +++ b/server/tests/src/com/vaadin/tests/server/renderer/RendererTest.java @@ -18,6 +18,7 @@ package com.vaadin.tests.server.renderer; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; +import static org.junit.Assert.assertTrue; import java.util.Locale; @@ -36,6 +37,7 @@ import com.vaadin.ui.ConnectorTracker; import com.vaadin.ui.Grid; import com.vaadin.ui.Grid.Column; import com.vaadin.ui.UI; +import com.vaadin.ui.renderer.ObjectRenderer; import com.vaadin.ui.renderer.TextRenderer; import elemental.json.JsonValue; @@ -44,6 +46,11 @@ public class RendererTest { private static class TestBean { int i = 42; + + @Override + public String toString() { + return "TestBean [" + i + "]"; + } } private static class ExtendedBean extends TestBean { @@ -130,15 +137,16 @@ public class RendererTest { @Test public void testDefaultRendererAndConverter() throws Exception { - assertSame(TextRenderer.class, foo.getRenderer().getClass()); - assertSame(StringToIntegerConverter.class, foo.getConverter() - .getClass()); + assertTrue("Foo default renderer should be a type of ObjectRenderer", + foo.getRenderer() instanceof ObjectRenderer); - assertSame(TextRenderer.class, bar.getRenderer().getClass()); + assertTrue("Bar default renderer should be a type of ObjectRenderer", + bar.getRenderer() instanceof ObjectRenderer); // String->String; converter not needed assertNull(bar.getConverter()); - assertSame(TextRenderer.class, baz.getRenderer().getClass()); + assertTrue("Baz default renderer should be a type of ObjectRenderer", + baz.getRenderer() instanceof ObjectRenderer); // MyBean->String; converter not found assertNull(baz.getConverter()); } @@ -166,6 +174,11 @@ public class RendererTest { @Test public void testEncoding() throws Exception { + /* + * For some strange reason, this test seems to fail locally, but not on + * TeamCity. + */ + assertEquals("42", render(foo, 42).asString()); foo.setRenderer(renderer()); assertEquals("renderer(42)", render(foo, 42).asString()); @@ -177,7 +190,7 @@ public class RendererTest { @Test public void testEncodingWithoutConverter() throws Exception { - assertEquals("", render(baz, new TestBean()).asString()); + assertEquals("TestBean [42]", render(baz, new TestBean()).asString()); } @Test |