From 9e853dd5c69e1f7841e3695c3f3bc6bbb19cf554 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 1 Oct 2012 21:46:26 +0300 Subject: [PATCH] Updated GAE test to be UI based (#9816) Change-Id: I50a0ac7a8aca239e04806a8d6f9be1d9263e71dd --- WebContent/WEB-INF/web.xml | 10 ++--- .../tests/integration/IntegrationTestUI.java | 42 +++++++++++++++++++ 2 files changed, 47 insertions(+), 5 deletions(-) create mode 100755 uitest/src/com/vaadin/tests/integration/IntegrationTestUI.java diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml index 67eaba0cca..ea15e2d2a1 100644 --- a/WebContent/WEB-INF/web.xml +++ b/WebContent/WEB-INF/web.xml @@ -18,7 +18,7 @@ resourceCacheTime 3600 - + Embed App 1 com.vaadin.server.LegacyVaadinServlet @@ -58,8 +58,8 @@ IntegrationTest com.vaadin.server.VaadinServlet - application - com.vaadin.tests.integration.IntegrationTestApplication + UI + com.vaadin.tests.integration.IntegrationTestUI @@ -71,12 +71,12 @@ Embed App 2 /embed2/* - + UI provider app /uiprovider/* - + VaadinApplicationRunner /run/* diff --git a/uitest/src/com/vaadin/tests/integration/IntegrationTestUI.java b/uitest/src/com/vaadin/tests/integration/IntegrationTestUI.java new file mode 100755 index 0000000000..05683e7b4e --- /dev/null +++ b/uitest/src/com/vaadin/tests/integration/IntegrationTestUI.java @@ -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); + } +} -- 2.39.5