]> source.dussan.org Git - vaadin-framework.git/commitdiff
Provide a dummy Root to avoid NPE
authorArtur Signell <artur@vaadin.com>
Tue, 10 Apr 2012 12:51:37 +0000 (15:51 +0300)
committerArtur Signell <artur@vaadin.com>
Tue, 10 Apr 2012 18:28:33 +0000 (21:28 +0300)
tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java

index 9aeccdb56fa3baf40b92952d56ad4d6cacc3856e..851fece4d1925ccb57b66c324fd15089fb4a5cb4 100644 (file)
@@ -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() {