From 6cc33ff6167da0d18dd9a5ff0f15ba544c40aef8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Tue, 29 May 2012 13:49:17 +0300 Subject: [PATCH] Verify that @Widgetset loads the right widgetset (#7885) This is testable now that we have a separate widgetset for testing. --- .../components/root/TestRootWidgetset.html | 0 .../components/root/TestRootWidgetset.java | 7 ++--- .../components/root/TestRootWidgetset2.java | 24 +++++++++++++++++ .../MissingFromDefaultWidgetsetConnector.java | 26 +++++++++++++++++++ .../MissingFromDefaultWidgetsetComponent.java | 10 +++++++ 5 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.html create mode 100644 tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset2.java create mode 100644 tests/testbench/com/vaadin/tests/widgetset/client/MissingFromDefaultWidgetsetConnector.java create mode 100644 tests/testbench/com/vaadin/tests/widgetset/server/MissingFromDefaultWidgetsetComponent.java 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 index 0000000000..e69de29bb2 diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java b/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java index c9c001deb6..b92815eeed 100644 --- a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java +++ b/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java @@ -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 index 0000000000..d3be29215e --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset2.java @@ -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 index 0000000000..5b7c6d8712 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/widgetset/client/MissingFromDefaultWidgetsetConnector.java @@ -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 index 0000000000..44f91538b6 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/widgetset/server/MissingFromDefaultWidgetsetComponent.java @@ -0,0 +1,10 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ +package com.vaadin.tests.widgetset.server; + +import com.vaadin.ui.AbstractComponent; + +public class MissingFromDefaultWidgetsetComponent extends AbstractComponent { + +} -- 2.39.5