]> source.dussan.org Git - vaadin-framework.git/commitdiff
Verify that @Widgetset loads the right widgetset (#7885)
authorLeif Åstrand <leif@vaadin.com>
Tue, 29 May 2012 10:49:17 +0000 (13:49 +0300)
committerLeif Åstrand <leif@vaadin.com>
Tue, 29 May 2012 10:49:17 +0000 (13:49 +0300)
This is testable now that we have a separate widgetset for testing.

tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.html [new file with mode: 0644]
tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java
tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset2.java [new file with mode: 0644]
tests/testbench/com/vaadin/tests/widgetset/client/MissingFromDefaultWidgetsetConnector.java [new file with mode: 0644]
tests/testbench/com/vaadin/tests/widgetset/server/MissingFromDefaultWidgetsetComponent.java [new file with mode: 0644]

diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.html b/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.html
new file mode 100644 (file)
index 0000000..e69de29
index c9c001deb6da4b766e1459fcb6d328d58984f9ce..b92815eeed8b2d0f9e00e1f58b8d14284d10498d 100644 (file)
@@ -3,18 +3,19 @@ package com.vaadin.tests.components.root;
 import com.vaadin.annotations.Widgetset;
 import com.vaadin.terminal.WrappedRequest;
 import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent;
 
-@Widgetset("invalid")
+@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
 public class TestRootWidgetset extends AbstractTestRoot {
 
     @Override
     protected void setup(WrappedRequest request) {
-        // Nothing here
+        addComponent(new MissingFromDefaultWidgetsetComponent());
     }
 
     @Override
     public String getTestDescription() {
-        return "This root should never load, as the widgetset can not be loaded";
+        return "This contents if this root should work as the component is present in TestingWidgetSet";
     }
 
     @Override
diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset2.java b/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset2.java
new file mode 100644 (file)
index 0000000..d3be292
--- /dev/null
@@ -0,0 +1,24 @@
+package com.vaadin.tests.components.root;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent;
+
+public class TestRootWidgetset2 extends AbstractTestRoot {
+
+    @Override
+    protected void setup(WrappedRequest request) {
+        addComponent(new MissingFromDefaultWidgetsetComponent());
+    }
+
+    @Override
+    public String getTestDescription() {
+        return "This contents if this root should not work as the component is not present in DefaultWidgetSet";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return Integer.valueOf(7885);
+    }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/MissingFromDefaultWidgetsetConnector.java b/tests/testbench/com/vaadin/tests/widgetset/client/MissingFromDefaultWidgetsetConnector.java
new file mode 100644 (file)
index 0000000..5b7c6d8
--- /dev/null
@@ -0,0 +1,26 @@
+/* 
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.widgetset.client;
+
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
+import com.vaadin.terminal.gwt.client.ui.Connect;
+import com.vaadin.terminal.gwt.client.ui.label.VLabel;
+import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent;
+
+@Connect(MissingFromDefaultWidgetsetComponent.class)
+public class MissingFromDefaultWidgetsetConnector extends
+        AbstractComponentConnector {
+    @Override
+    public VLabel getWidget() {
+        return (VLabel) super.getWidget();
+    }
+
+    @Override
+    protected void init() {
+        getWidget()
+                .setText(
+                        "This component is available in TestingWidgetset, but not in DefaultWidgetset");
+        super.init();
+    }
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/server/MissingFromDefaultWidgetsetComponent.java b/tests/testbench/com/vaadin/tests/widgetset/server/MissingFromDefaultWidgetsetComponent.java
new file mode 100644 (file)
index 0000000..44f9153
--- /dev/null
@@ -0,0 +1,10 @@
+/* 
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.widgetset.server;
+
+import com.vaadin.ui.AbstractComponent;
+
+public class MissingFromDefaultWidgetsetComponent extends AbstractComponent {
+
+}