]> source.dussan.org Git - vaadin-framework.git/commitdiff
Converted TestUIWidgetset test to TB3 and fixed wrong text in assertion.
authorJohn Ahlroos <john@vaadin.com>
Thu, 9 Jan 2014 08:34:26 +0000 (10:34 +0200)
committerVaadin Code Review <review@vaadin.com>
Mon, 13 Jan 2014 09:27:33 +0000 (09:27 +0000)
Change-Id: Ie1d5374280381f9ff81415ce9d9d82773718800c

uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetset.java [new file with mode: 0644]
uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java [new file with mode: 0644]
uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetset.java [new file with mode: 0644]
uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java [new file with mode: 0644]
uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.html [deleted file]
uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset.java [deleted file]
uitest/src/com/vaadin/tests/components/ui/TestUIWidgetset2.java [deleted file]

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 (file)
index 0000000..f674567
--- /dev/null
@@ -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 (file)
index 0000000..f27ef5d
--- /dev/null
@@ -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 (file)
index 0000000..554a461
--- /dev/null
@@ -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 (file)
index 0000000..ec8add7
--- /dev/null
@@ -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 (file)
index 4c10dc4..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="" />
-<title>Ticket4607</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">Ticket4607</td></tr>
-</thead><tbody>
-<tr>
-       <td>open</td>
-       <td>/run/com.vaadin.tests.components.ui.TestUIWidgetset?restartApplication</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertText</td>
-       <td>vaadin=runcomvaadintestscomponentsuiTestUIWidgetset::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]</td>
-       <td>This component is available in TestingWidgetset, but not in DefaultWidgetset</td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/run/com.vaadin.tests.components.ui.TestUIWidgetset2?restartApplication</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertText</td>
-       <td>vaadin=runcomvaadintestscomponentsuiTestUIWidgetset2::/VVerticalLayout[0]/VVerticalLayout[0]/VUnknownComponent[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
-       <td>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.</td>
-</tr>
-</tbody></table>
-</body>
-</html>
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 (file)
index e837321..0000000
+++ /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 (file)
index a68cd91..0000000
+++ /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);
-    }
-
-}