From: John Ahlroos Date: Thu, 9 Jan 2014 08:34:26 +0000 (+0200) Subject: Converted TestUIWidgetset test to TB3 and fixed wrong text in assertion. X-Git-Tag: 7.1.10~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3595685b81779e7c10fc3f2d9fe9b1e35d4f39d2;p=vaadin-framework.git Converted TestUIWidgetset test to TB3 and fixed wrong text in assertion. Change-Id: Ie1d5374280381f9ff81415ce9d9d82773718800c --- diff --git a/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetset.java b/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetset.java new file mode 100644 index 0000000000..f674567a2d --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetset.java @@ -0,0 +1,28 @@ +package com.vaadin.tests.components.ui; + +import com.vaadin.annotations.Widgetset; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent; + +@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet") +public class ComponentIncludedInCustomWidgetset extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + MissingFromDefaultWidgetsetComponent component = new MissingFromDefaultWidgetsetComponent(); + component.setId("missing-component"); + addComponent(component); + } + + @Override + public String getTestDescription() { + return "This contents if this UI should work as the component is present in TestingWidgetSet"; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(7885); + } + +} 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/ComponentMissingFromDefaultWidgetset.java b/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetset.java new file mode 100644 index 0000000000..554a461c37 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetset.java @@ -0,0 +1,26 @@ +package com.vaadin.tests.components.ui; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent; + +public class ComponentMissingFromDefaultWidgetset extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + MissingFromDefaultWidgetsetComponent component = new MissingFromDefaultWidgetsetComponent(); + component.setId("missing-component"); + addComponent(component); + } + + @Override + public String getTestDescription() { + return "This contents if this UI should not work as the component is not present in DefaultWidgetSet"; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(7885); + } + +} 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.
- - diff --git a/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.java b/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.java deleted file mode 100644 index e837321b56..0000000000 --- a/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.vaadin.tests.components.ui; - -import com.vaadin.annotations.Widgetset; -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent; - -@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet") -public class TestUIWidgetset extends AbstractTestUI { - - @Override - protected void setup(VaadinRequest request) { - addComponent(new MissingFromDefaultWidgetsetComponent()); - } - - @Override - public String getTestDescription() { - return "This contents if this UI should work as the component is present in TestingWidgetSet"; - } - - @Override - protected Integer getTicketNumber() { - return Integer.valueOf(7885); - } - -} diff --git a/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset2.java b/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset2.java deleted file mode 100644 index a68cd91a5e..0000000000 --- a/uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset2.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.vaadin.tests.components.ui; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.tests.components.AbstractTestUI; -import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent; - -public class TestUIWidgetset2 extends AbstractTestUI { - - @Override - protected void setup(VaadinRequest request) { - addComponent(new MissingFromDefaultWidgetsetComponent()); - } - - @Override - public String getTestDescription() { - return "This contents if this UI should not work as the component is not present in DefaultWidgetSet"; - } - - @Override - protected Integer getTicketNumber() { - return Integer.valueOf(7885); - } - -}