From 167c2b9619f3db37948bd857a294169151a94eb7 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 10 Apr 2012 15:51:37 +0300 Subject: [PATCH] Provide a dummy Root to avoid NPE --- .../abstractfield/RemoveListenersOnDetach.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java b/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java index 9aeccdb56f..851fece4d1 100644 --- a/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java +++ b/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java @@ -7,7 +7,9 @@ import org.junit.Test; import com.vaadin.data.Property; import com.vaadin.data.util.AbstractProperty; import com.vaadin.data.util.converter.Converter.ConversionException; +import com.vaadin.terminal.WrappedRequest; import com.vaadin.ui.AbstractField; +import com.vaadin.ui.Root; public class RemoveListenersOnDetach { @@ -15,6 +17,15 @@ public class RemoveListenersOnDetach { int numReadOnlyChanges = 0; AbstractField field = new AbstractField() { + private Root root = new Root() { + + @Override + protected void init(WrappedRequest request) { + + } + + }; + @Override public Class getType() { return null; @@ -32,6 +43,11 @@ public class RemoveListenersOnDetach { super.readOnlyStatusChange(event); numReadOnlyChanges++; } + + @Override + public com.vaadin.ui.Root getRoot() { + return root; + }; }; Property property = new AbstractProperty() { -- 2.39.5