]> source.dussan.org Git - vaadin-framework.git/commitdiff
Updated GAE test to be UI based (#9816) 29/29/1
authorArtur Signell <artur@vaadin.com>
Mon, 1 Oct 2012 18:46:26 +0000 (21:46 +0300)
committerArtur Signell <artur@vaadin.com>
Mon, 1 Oct 2012 19:09:00 +0000 (22:09 +0300)
Change-Id: I50a0ac7a8aca239e04806a8d6f9be1d9263e71dd

WebContent/WEB-INF/web.xml
uitest/src/com/vaadin/tests/integration/IntegrationTestUI.java [new file with mode: 0755]

index 67eaba0cca7167726af85e5af86a3e906f2fd16b..ea15e2d2a16a65fc6fc34f87f0a909f968360cc2 100644 (file)
@@ -18,7 +18,7 @@
        <context-param>
                <param-name>resourceCacheTime</param-name>
                <param-value>3600</param-value>
-       </context-param>        
+       </context-param>
        <servlet>
                <servlet-name>Embed App 1</servlet-name>
                <servlet-class>com.vaadin.server.LegacyVaadinServlet</servlet-class>
@@ -58,8 +58,8 @@
                <servlet-name>IntegrationTest</servlet-name>
                <servlet-class>com.vaadin.server.VaadinServlet</servlet-class>
                <init-param>
-                       <param-name>application</param-name>
-                       <param-value>com.vaadin.tests.integration.IntegrationTestApplication</param-value>
+                       <param-name>UI</param-name>
+                       <param-value>com.vaadin.tests.integration.IntegrationTestUI</param-value>
                </init-param>
        </servlet>
        <servlet-mapping>
                <servlet-name>Embed App 2</servlet-name>
                <url-pattern>/embed2/*</url-pattern>
        </servlet-mapping>
-       
+
        <servlet-mapping>
                <servlet-name>UI provider app</servlet-name>
                <url-pattern>/uiprovider/*</url-pattern>
        </servlet-mapping>
-       
+
        <servlet-mapping>
                <servlet-name>VaadinApplicationRunner</servlet-name>
                <url-pattern>/run/*</url-pattern>
diff --git a/uitest/src/com/vaadin/tests/integration/IntegrationTestUI.java b/uitest/src/com/vaadin/tests/integration/IntegrationTestUI.java
new file mode 100755 (executable)
index 0000000..05683e7
--- /dev/null
@@ -0,0 +1,42 @@
+package com.vaadin.tests.integration;
+
+import com.vaadin.data.Item;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.server.ClassResource;
+import com.vaadin.server.Resource;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.UI;
+
+public class IntegrationTestUI extends UI {
+    @Override
+    protected void init(VaadinRequest request) {
+        final Table table = new Table();
+        table.addContainerProperty("icon", Resource.class, null);
+        table.setItemIconPropertyId("icon");
+        table.addContainerProperty("country", String.class, null);
+        table.setRowHeaderMode(Table.RowHeaderMode.ICON_ONLY);
+        table.setImmediate(true);
+        table.setSelectable(true);
+        table.setVisibleColumns(new Object[] { "country" });
+        addComponent(table);
+
+        Item item = table.addItem("FI");
+        item.getItemProperty("icon").setValue(new ClassResource("fi.gif"));
+        item.getItemProperty("country").setValue("Finland");
+        item = table.addItem("SE");
+        item.getItemProperty("icon").setValue(new FlagSeResource());
+        item.getItemProperty("country").setValue("Sweden");
+
+        final Label selectedLabel = new Label();
+        table.addValueChangeListener(new ValueChangeListener() {
+            @Override
+            public void valueChange(ValueChangeEvent event) {
+                selectedLabel.setValue(table.getValue().toString());
+            }
+        });
+        addComponent(selectedLabel);
+    }
+}