summaryrefslogtreecommitdiffstats
path: root/tests/testbench/com
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-07-05 14:12:18 +0300
committerLeif Åstrand <leif@vaadin.com>2012-07-05 14:12:18 +0300
commit04d043f95fbdeb698a3c0c39334e76b367afa749 (patch)
tree916f9928eeb22428f9706735b0da5f0f3c4e8aa8 /tests/testbench/com
parent9043c22ec506670b19e9071bbc90ca59e0c8284e (diff)
downloadvaadin-framework-04d043f95fbdeb698a3c0c39334e76b367afa749.tar.gz
vaadin-framework-04d043f95fbdeb698a3c0c39334e76b367afa749.zip
Explicit test for attaching extensions (#6690)
Diffstat (limited to 'tests/testbench/com')
-rw-r--r--tests/testbench/com/vaadin/tests/extensions/BasicExtension.java15
-rw-r--r--tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.html32
-rw-r--r--tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.java34
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/BasicExtensionTestConnector.java27
4 files changed, 108 insertions, 0 deletions
diff --git a/tests/testbench/com/vaadin/tests/extensions/BasicExtension.java b/tests/testbench/com/vaadin/tests/extensions/BasicExtension.java
new file mode 100644
index 0000000000..551d24735a
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/extensions/BasicExtension.java
@@ -0,0 +1,15 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.extensions;
+
+import com.vaadin.terminal.AbstractClientConnector;
+import com.vaadin.terminal.AbstractExtension;
+
+public class BasicExtension extends AbstractExtension {
+ @Override
+ public void extend(AbstractClientConnector target) {
+ super.extend(target);
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.html b/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.html
new file mode 100644
index 0000000000..6e8a0bf97f
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.html
@@ -0,0 +1,32 @@
+<?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="http://192.168.2.41:8888/" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.extensions.BasicExtensionTest?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>//div[1]</td>
+ <td>BasicExtensionTestConnector extending LabelConnector</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>//div[2]</td>
+ <td>BasicExtensionTestConnector extending RootConnector</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.java b/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.java
new file mode 100644
index 0000000000..02bdadca34
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.java
@@ -0,0 +1,34 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.extensions;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Label;
+
+@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
+public class BasicExtensionTest extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ Label label = new Label();
+ addComponent(label);
+
+ new BasicExtension().extend(this);
+ new BasicExtension().extend(label);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Simple test for extending components";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(6690);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/BasicExtensionTestConnector.java b/tests/testbench/com/vaadin/tests/widgetset/client/BasicExtensionTestConnector.java
new file mode 100644
index 0000000000..aa5bec83b4
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/BasicExtensionTestConnector.java
@@ -0,0 +1,27 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.widgetset.client;
+
+import com.google.gwt.dom.client.DivElement;
+import com.google.gwt.dom.client.Document;
+import com.vaadin.terminal.gwt.client.ServerConnector;
+import com.vaadin.terminal.gwt.client.Util;
+import com.vaadin.terminal.gwt.client.extensions.AbstractExtensionConnector;
+import com.vaadin.terminal.gwt.client.ui.Connect;
+import com.vaadin.tests.extensions.BasicExtension;
+
+@Connect(BasicExtension.class)
+public class BasicExtensionTestConnector extends AbstractExtensionConnector {
+ @Override
+ protected void extend(ServerConnector target) {
+ String message = Util.getSimpleName(this) + " extending "
+ + Util.getSimpleName(target);
+
+ DivElement element = Document.get().createDivElement();
+ element.setInnerText(message);
+
+ Document.get().getBody().insertFirst(element);
+ }
+}