From 3595685b81779e7c10fc3f2d9fe9b1e35d4f39d2 Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Thu, 9 Jan 2014 10:34:26 +0200 Subject: [PATCH] Converted TestUIWidgetset test to TB3 and fixed wrong text in assertion. Change-Id: Ie1d5374280381f9ff81415ce9d9d82773718800c --- ...> ComponentIncludedInCustomWidgetset.java} | 6 ++- ...omponentIncludedInCustomWidgetsetTest.java | 41 ++++++++++++++++++ ...ComponentMissingFromDefaultWidgetset.java} | 6 ++- ...ponentMissingFromDefaultWidgetsetTest.java | 42 +++++++++++++++++++ .../tests/components/ui/TestUIWidgetset.html | 36 ---------------- 5 files changed, 91 insertions(+), 40 deletions(-) rename uitest/src/com/vaadin/tests/components/ui/{TestUIWidgetset.java => ComponentIncludedInCustomWidgetset.java} (72%) create mode 100644 uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java rename uitest/src/com/vaadin/tests/components/ui/{TestUIWidgetset2.java => ComponentMissingFromDefaultWidgetset.java} (68%) create mode 100644 uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java delete mode 100644 uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.html diff --git a/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.java b/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetset.java similarity index 72% rename from uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.java rename to uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetset.java index e837321b56..f674567a2d 100644 --- a/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.java +++ b/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetset.java @@ -6,11 +6,13 @@ import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent; @Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet") -public class TestUIWidgetset extends AbstractTestUI { +public class ComponentIncludedInCustomWidgetset extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - addComponent(new MissingFromDefaultWidgetsetComponent()); + MissingFromDefaultWidgetsetComponent component = new MissingFromDefaultWidgetsetComponent(); + component.setId("missing-component"); + addComponent(component); } @Override diff --git a/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java b/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java new file mode 100644 index 0000000000..f27ef5d789 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java @@ -0,0 +1,41 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.ui; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Tests if a component is included in a custom widgetset + * (com.vaadin.tests.widgetset.TestingWidgetSet) + * + * @author Vaadin Ltd + */ +public class ComponentIncludedInCustomWidgetsetTest extends MultiBrowserTest { + + @Test + public void testComponentInTestingWidgetsetNotInDefaultWidgetset() { + openTestURL(); + WebElement component = vaadinElementById("missing-component"); + assertEquals( + "This component is available in TestingWidgetset, but not in DefaultWidgetset", + component.getText()); + } +} diff --git a/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset2.java b/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetset.java similarity index 68% rename from uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset2.java rename to uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetset.java index a68cd91a5e..554a461c37 100644 --- a/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset2.java +++ b/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetset.java @@ -4,11 +4,13 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent; -public class TestUIWidgetset2 extends AbstractTestUI { +public class ComponentMissingFromDefaultWidgetset extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - addComponent(new MissingFromDefaultWidgetsetComponent()); + MissingFromDefaultWidgetsetComponent component = new MissingFromDefaultWidgetsetComponent(); + component.setId("missing-component"); + addComponent(component); } @Override diff --git a/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java b/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java new file mode 100644 index 0000000000..ec8add75e0 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java @@ -0,0 +1,42 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.ui; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test for testing if a component is missing from a widgetset. + * + * @author Vaadin Ltd + */ +public class ComponentMissingFromDefaultWidgetsetTest extends MultiBrowserTest { + + @Test + public void testComponentInTestingWidgetset() { + openTestURL(); + WebElement component = vaadinElementById("missing-component"); + assertTrue(component + .getText() + .startsWith( + "Widgetset 'com.vaadin.DefaultWidgetSet' does not contain implementation for com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent.")); + + } +} diff --git a/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.html b/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.html deleted file mode 100644 index 4c10dc4275..0000000000 --- a/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - -Ticket4607 - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ticket4607
open/run/com.vaadin.tests.components.ui.TestUIWidgetset?restartApplication
assertTextvaadin=runcomvaadintestscomponentsuiTestUIWidgetset::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]This component is available in TestingWidgetset, but not in DefaultWidgetset
open/run/com.vaadin.tests.components.ui.TestUIWidgetset2?restartApplication
assertTextvaadin=runcomvaadintestscomponentsuiTestUIWidgetset2::/VVerticalLayout[0]/VVerticalLayout[0]/VUnknownComponent[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]Widgetset does not contain implementation for com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent. Check its component connector's @Connect mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions.
- - -- 2.39.5