]> source.dussan.org Git - vaadin-framework.git/commitdiff
Removed com.vaadin.automatedtests for #3398
authorArtur Signell <artur.signell@itmill.com>
Thu, 11 Feb 2010 12:57:06 +0000 (12:57 +0000)
committerArtur Signell <artur.signell@itmill.com>
Thu, 11 Feb 2010 12:57:06 +0000 (12:57 +0000)
svn changeset:11276/svn branch:6.3

31 files changed:
tests/src/com/vaadin/automatedtests/ComponentsInTable.java [deleted file]
tests/src/com/vaadin/automatedtests/SimplestApplication.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/AccordionExample.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/ButtonExample.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/ClientCachingExample.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/ComboBoxExample.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/EmbeddedBrowserExample.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/FeatureBrowser.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/FormExample.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/GeneratedColumnExample.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/JavaScriptAPIExample.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/LabelExample.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/LayoutExample.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/NotificationExample.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/RichTextExample.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/SelectExample.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/TableExample.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/TreeExample.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/ValueInputExample.java [deleted file]
tests/src/com/vaadin/automatedtests/featurebrowser/WindowingExample.java [deleted file]
tests/src/com/vaadin/automatedtests/robustness/Robustness.java [deleted file]
tests/src/com/vaadin/automatedtests/robustness/RobustnessComplex.java [deleted file]
tests/src/com/vaadin/automatedtests/util/DebugId.java [deleted file]
tests/src/com/vaadin/automatedtests/util/Log.java [deleted file]
tests/src/com/vaadin/automatedtests/util/MultiListener.java [deleted file]
tests/src/com/vaadin/automatedtests/util/RandomComponents.java [deleted file]
tests/src/com/vaadin/automatedtests/util/StatusServlet.java [deleted file]
tests/src/com/vaadin/tests/robustness/Robustness.java
tests/src/com/vaadin/tests/robustness/RobustnessComplex.java [new file with mode: 0644]
tests/src/com/vaadin/tests/robustness/RobustnessSimple.java
tests/src/com/vaadin/tests/util/RandomComponents.java

diff --git a/tests/src/com/vaadin/automatedtests/ComponentsInTable.java b/tests/src/com/vaadin/automatedtests/ComponentsInTable.java
deleted file mode 100644 (file)
index ccbe29d..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* \r
-@ITMillApache2LicenseForJavaFiles@\r
- */\r
-\r
-package com.vaadin.automatedtests;\r
-\r
-import java.util.Date;\r
-import java.util.Random;\r
-import java.util.Vector;\r
-\r
-import com.vaadin.ui.Button;\r
-import com.vaadin.ui.CustomComponent;\r
-import com.vaadin.ui.OrderedLayout;\r
-import com.vaadin.ui.Table;\r
-import com.vaadin.ui.Button.ClickEvent;\r
-\r
-@SuppressWarnings("serial")\r
-public class ComponentsInTable extends CustomComponent {\r
-\r
-    public ComponentsInTable(int cols, int rows) {\r
-        final OrderedLayout main = new OrderedLayout();\r
-        setCompositionRoot(main);\r
-\r
-        main.addComponent(getTestTable(cols, rows));\r
-    }\r
-\r
-    public static Table getTestTable(int cols, int rows) {\r
-        Random rnd = new Random(1);\r
-\r
-        final Table t = new Table();\r
-        t.setColumnCollapsingAllowed(true);\r
-        for (int i = 0; i < cols; i++) {\r
-            t.addContainerProperty(testString[i], String.class, "");\r
-        }\r
-        t.addContainerProperty("button", Button.class, null);\r
-        for (int i = 0; i < rows; i++) {\r
-            final Vector content = new Vector();\r
-            for (int j = 0; j < cols; j++) {\r
-                content.add(rndString(rnd));\r
-            }\r
-            content.add(new Button("b" + i, new Button.ClickListener() {\r
-\r
-                public void buttonClick(ClickEvent event) {\r
-                    System.out.println(event.getButton().getCaption()\r
-                            + " click: " + (new Date()).toGMTString());\r
-                    System.out.println(event.getButton().getApplication());\r
-\r
-                }\r
-            }));\r
-            t.addItem(content.toArray(), "" + i);\r
-        }\r
-        t.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);\r
-        return t;\r
-    }\r
-\r
-    static String[] testString = new String[] { "Jacob", "Michael", "Joshua",\r
-            "Matthew", "Ethan", "Andrew", "Daniel", "Anthony", "Christopher",\r
-            "Joseph", "William", "Alexander", "Ryan", "David", "Nicholas",\r
-            "Tyler", "James", "John", "Jonathan", "Nathan", "Samuel",\r
-            "Christian", "Noah", "Dylan", "Benjamin", "Logan", "Brandon",\r
-            "Gabriel", "Zachary", "Jose", "Elijah", "Angel", "Kevin", "Jack",\r
-            "Caleb", "Justin", "Austin", "Evan", "Robert", "Thomas", "Luke",\r
-            "Mason", "Aidan", "Jackson", "Isaiah", "Jordan", "Gavin", "Connor",\r
-            "Aiden", "Isaac", "Jason", "Cameron", "Hunter", "Jayden", "Juan",\r
-            "Charles", "Aaron", "Lucas", "Luis", "Owen", "Landon", "Diego",\r
-            "Brian", "Adam", "Adrian", "Kyle", "Eric", "Ian", "Nathaniel",\r
-            "Carlos", "Alex", "Bryan", "Jesus", "Julian", "Sean", "Carter",\r
-            "Hayden", "Jeremiah", "Cole", "Brayden", "Wyatt", "Chase",\r
-            "Steven", "Timothy", "Dominic", "Sebastian", "Xavier", "Jaden",\r
-            "Jesse", "Devin", "Seth", "Antonio", "Richard", "Miguel", "Colin",\r
-            "Cody", "Alejandro", "Caden", "Blake", "Carson" };\r
-\r
-    public static String rndString(Random rnd) {\r
-        return testString[(int) (rnd.nextDouble() * testString.length)];\r
-    }\r
-\r
-}\r
diff --git a/tests/src/com/vaadin/automatedtests/SimplestApplication.java b/tests/src/com/vaadin/automatedtests/SimplestApplication.java
deleted file mode 100644 (file)
index 7de7e09..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/* 
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.automatedtests;
-
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
-
-@SuppressWarnings("serial")
-public class SimplestApplication extends com.vaadin.Application {
-
-    @Override
-    public void init() {
-        final Window main = new Window("Simplest Application window");
-        setMainWindow(main);
-        main.addComponent(new Label("Simplest Application label"));
-    }
-}
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/AccordionExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/AccordionExample.java
deleted file mode 100644 (file)
index 0589439..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.vaadin.automatedtests.featurebrowser;
-
-import com.vaadin.ui.Accordion;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.VerticalLayout;
-
-/**
- * Accordion is a derivative of TabSheet, a vertical tabbed layout that places
- * the tab contents between the vertical tabs.
- */
-@SuppressWarnings("serial")
-public class AccordionExample extends CustomComponent {
-
-    public AccordionExample() {
-        // Create a new accordion
-        final Accordion accordion = new Accordion();
-        setCompositionRoot(accordion);
-
-        // Add a few tabs to the accordion.
-        for (int i = 0; i < 5; i++) {
-            // Create a root component for a accordion tab
-            VerticalLayout layout = new VerticalLayout();
-            accordion.addComponent(layout);
-
-            // The accordion tab label is taken from the caption of the root
-            // component. Notice that layouts can have a caption too.
-            layout.setCaption("Tab " + (i + 1));
-
-            // Add some components in each accordion tab
-            Label label = new Label("These are the contents of Tab " + (i + 1)
-                    + ".");
-            layout.addComponent(label);
-
-            TextField textfield = new TextField("Some text field");
-            layout.addComponent(textfield);
-        }
-    }
-}
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/ButtonExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/ButtonExample.java
deleted file mode 100644 (file)
index aabfe41..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-/* \r
-@ITMillApache2LicenseForJavaFiles@\r
- */\r
-\r
-package com.vaadin.automatedtests.featurebrowser;\r
-\r
-import com.vaadin.terminal.ExternalResource;\r
-import com.vaadin.terminal.ThemeResource;\r
-import com.vaadin.ui.Button;\r
-import com.vaadin.ui.CheckBox;\r
-import com.vaadin.ui.CustomComponent;\r
-import com.vaadin.ui.HorizontalLayout;\r
-import com.vaadin.ui.Label;\r
-import com.vaadin.ui.Link;\r
-import com.vaadin.ui.Panel;\r
-import com.vaadin.ui.VerticalLayout;\r
-import com.vaadin.ui.Button.ClickEvent;\r
-\r
-/**\r
- * Shows a few variations of Buttons and Links.\r
- * \r
- * @author IT Mill Ltd.\r
- */\r
-@SuppressWarnings("serial")\r
-public class ButtonExample extends CustomComponent implements\r
-        Button.ClickListener {\r
-\r
-    public ButtonExample() {\r
-\r
-        final VerticalLayout main = new VerticalLayout();\r
-        main.setMargin(true);\r
-        setCompositionRoot(main);\r
-\r
-        final HorizontalLayout horiz = new HorizontalLayout();\r
-        horiz.setWidth("100%");\r
-        main.addComponent(horiz);\r
-        final Panel basic = new Panel("Basic buttons");\r
-        basic.setStyleName(Panel.STYLE_LIGHT);\r
-        horiz.addComponent(basic);\r
-\r
-        final Panel bells = new Panel("w/ bells & whistles");\r
-        bells.setStyleName(Panel.STYLE_LIGHT);\r
-        horiz.addComponent(bells);\r
-\r
-        Button b = new Button("Basic button");\r
-        b.setDebugId("Basic1");\r
-        b.addListener(this);\r
-        basic.addComponent(b);\r
-\r
-        b = new Button("Button w/ icon + tooltip");\r
-        b.setDebugId("Button2");\r
-        b.addListener(this);\r
-        b.setIcon(new ThemeResource("icons/ok.png"));\r
-        b.setDescription("This button does nothing, fast");\r
-        bells.addComponent(b);\r
-\r
-        b = new CheckBox("CheckBox - a switch-button");\r
-        b.setDebugId("Button3");\r
-        b.setImmediate(true); // checkboxes are not immediate by default\r
-        b.addListener(this);\r
-        basic.addComponent(b);\r
-\r
-        b = new CheckBox("CheckBox w/ icon + tooltip");\r
-        b.setDebugId("Button4");\r
-        b.setImmediate(true); // checkboxes are not immediate by default\r
-        b.addListener(this);\r
-        b.setIcon(new ThemeResource("icons/ok.png"));\r
-        b.setDescription("This is a CheckBox");\r
-        bells.addComponent(b);\r
-\r
-        b = new Button("Link-style button");\r
-        b.setDebugId("Button5");\r
-        b.addListener(this);\r
-        b.setStyleName(Button.STYLE_LINK);\r
-        basic.addComponent(b);\r
-\r
-        b = new Button("Link button w/ icon + tooltip");\r
-        b.setDebugId("Button6");\r
-        b.addListener(this);\r
-        b.setStyleName(Button.STYLE_LINK);\r
-        b.setIcon(new ThemeResource("icons/ok.png"));\r
-        b.setDescription("Link-style, icon+tootip, no caption");\r
-        bells.addComponent(b);\r
-\r
-        b = new Button();\r
-        b.setDebugId("Button7");\r
-        b.addListener(this);\r
-        b.setStyleName(Button.STYLE_LINK);\r
-        b.setIcon(new ThemeResource("icons/ok.png"));\r
-        b.setDescription("Link-style, icon+tootip, no caption");\r
-        basic.addComponent(b);\r
-\r
-        final Panel links = new Panel("Links");\r
-        links.setStyleName(Panel.STYLE_LIGHT);\r
-        main.addComponent(links);\r
-        final Label desc = new Label(\r
-                "The main difference between a Link and"\r
-                        + " a link-styled Button is that the Link works client-"\r
-                        + " side, whereas the Button works server side.<br/> This means"\r
-                        + " that the Button triggers some event on the server,"\r
-                        + " while the Link is a normal web-link. <br/><br/>Note that for"\r
-                        + " opening new windows, the Link might be a safer "\r
-                        + " choice, since popup-blockers might interfer with "\r
-                        + " server-initiated window opening.");\r
-        desc.setContentMode(Label.CONTENT_XHTML);\r
-        links.addComponent(desc);\r
-        Link l = new Link("Vaadin home", new ExternalResource(\r
-                "http://www.vaadin.com"));\r
-        l.setDebugId("Link1");\r
-        l.setDescription("Link without target name, opens in this window");\r
-        links.addComponent(l);\r
-\r
-        l = new Link("Vaadin home (new window)", new ExternalResource(\r
-                "http://www.vaadin.com"));\r
-        l.setDebugId("Link2");\r
-        l.setTargetName("_blank");\r
-        l.setDescription("Link with target name, opens in new window");\r
-        links.addComponent(l);\r
-\r
-        l = new Link("Vaadin home (new window, less decor)",\r
-                new ExternalResource("http://www.vaadin.com"));\r
-        l.setDebugId("Link3");\r
-        l.setTargetName("_blank");\r
-        l.setTargetBorder(Link.TARGET_BORDER_MINIMAL);\r
-        l.setTargetName("_blank");\r
-        l\r
-                .setDescription("Link with target name and BORDER_MINIMAL, opens in new window with less decor");\r
-        links.addComponent(l);\r
-\r
-        l = new Link("Vaadin home (new 200x200 window, no decor, icon)",\r
-                new ExternalResource("http://www.vaadin.com"), "_blank", 200,\r
-                200, Link.TARGET_BORDER_NONE);\r
-        l.setDebugId("Link4");\r
-        l.setTargetName("_blank");\r
-        l\r
-                .setDescription("Link with target name and BORDER_NONE, opens in new window with no decor");\r
-        l.setIcon(new ThemeResource("icons/ok.png"));\r
-        links.addComponent(l);\r
-\r
-    }\r
-\r
-    public void buttonClick(ClickEvent event) {\r
-        final Button b = event.getButton();\r
-        getWindow().showNotification(\r
-                "Clicked"\r
-                        + (b instanceof CheckBox ? ", value: "\r
-                                + event.getButton().getValue() : ""));\r
-\r
-    }\r
-\r
-}\r
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/ClientCachingExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/ClientCachingExample.java
deleted file mode 100644 (file)
index 2012329..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/* \r
-@ITMillApache2LicenseForJavaFiles@\r
- */\r
-\r
-package com.vaadin.automatedtests.featurebrowser;\r
-\r
-import com.vaadin.terminal.PaintException;\r
-import com.vaadin.terminal.PaintTarget;\r
-import com.vaadin.ui.CustomComponent;\r
-import com.vaadin.ui.Label;\r
-import com.vaadin.ui.Layout;\r
-import com.vaadin.ui.TabSheet;\r
-import com.vaadin.ui.VerticalLayout;\r
-\r
-/**\r
- * This example is a (simple) demonstration of client-side caching. The content\r
- * in one tab is intentionally made very slow to produce server-side. When the\r
- * user changes to this tab for the first time, there will be a 3 second wait\r
- * before the content shows up, but the second time it shows up immediately\r
- * since the content has not changed and is cached client-side.\r
- * \r
- * @author IT Mill Ltd.\r
- */\r
-@SuppressWarnings("serial")\r
-public class ClientCachingExample extends CustomComponent {\r
-\r
-    private static final String msg = "This example is a (simple) demonstration of client-side caching."\r
-            + " The content in one tab is intentionally made very slow to"\r
-            + " 'produce' server-side. When you changes to this tab for the"\r
-            + " first time, there will be a 3 second wait before the content"\r
-            + " shows up, but the second time it shows up immediately since the"\r
-            + " content has not changed and is cached client-side.";\r
-\r
-    public ClientCachingExample() {\r
-\r
-        final VerticalLayout main = new VerticalLayout();\r
-        main.setMargin(true);\r
-        setCompositionRoot(main);\r
-\r
-        main.addComponent(new Label(msg));\r
-\r
-        final TabSheet ts = new TabSheet();\r
-        main.addComponent(ts);\r
-\r
-        Layout layout = new VerticalLayout();\r
-        layout.setMargin(true);\r
-        Label l = new Label("This is a normal label, quick to render.");\r
-        l.setCaption("A normal label");\r
-        layout.addComponent(l);\r
-\r
-        ts.addTab(layout, "Normal", null);\r
-\r
-        layout = new VerticalLayout();\r
-        layout.setMargin(true);\r
-        l = new Label("Slow label - until cached client side.") {\r
-\r
-            @Override\r
-            public void paintContent(PaintTarget target) throws PaintException {\r
-                try {\r
-                    Thread.sleep(3000);\r
-                } catch (final Exception e) {\r
-                    // IGNORED\r
-                }\r
-                super.paintContent(target);\r
-            }\r
-\r
-        };\r
-        l.setCaption("A slow label");\r
-        layout.addComponent(l);\r
-        ts.addTab(layout, "Slow", null);\r
-\r
-    }\r
-}\r
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/ComboBoxExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/ComboBoxExample.java
deleted file mode 100644 (file)
index 753c746..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/* 
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.automatedtests.featurebrowser;
-
-import java.util.Random;
-
-import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.OrderedLayout;
-import com.vaadin.ui.AbstractSelect.Filtering;
-
-/**
- * 
- */
-@SuppressWarnings("serial")
-public class ComboBoxExample extends CustomComponent {
-
-    private static final String[] firstnames = new String[] { "John", "Mary",
-            "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Robert", "Paula",
-            "Lenny", "Kenny", "Nathan", "Nicole", "Laura", "Jos", "Josie",
-            "Linus" };
-
-    private static final String[] lastnames = new String[] { "Torvalds",
-            "Smith", "Adams", "Black", "Wilson", "Richards", "Thompson",
-            "McGoff", "Halas", "Jones", "Beck", "Sheridan", "Picard", "Hill",
-            "Fielding", "Einstein" };
-
-    public ComboBoxExample() {
-        final OrderedLayout main = new OrderedLayout();
-        main.setMargin(true);
-        setCompositionRoot(main);
-
-        // starts-with filter
-        final ComboBox s1 = new ComboBox("Select with starts-with filter");
-        s1.setDebugId("ComboBoxStartFilter");
-        s1.setFilteringMode(Filtering.FILTERINGMODE_STARTSWITH);
-        s1.setColumns(20);
-        Random r = new Random(5);
-        for (int i = 0; i < 105; i++) {
-            s1
-                    .addItem(firstnames[(int) (r.nextDouble() * (firstnames.length - 1))]
-                            + " "
-                            + lastnames[(int) (r.nextDouble() * (lastnames.length - 1))]);
-        }
-        s1.setImmediate(true);
-        main.addComponent(s1);
-
-        // contains filter
-        final ComboBox s2 = new ComboBox("Select with contains filter");
-        s2.setDebugId("ComboBoxContainsFilter");
-        s2.setFilteringMode(Filtering.FILTERINGMODE_CONTAINS);
-        s2.setColumns(20);
-        for (int i = 0; i < 500; i++) {
-            s2
-                    .addItem(firstnames[(int) (r.nextDouble() * (firstnames.length - 1))]
-                            + " "
-                            + lastnames[(int) (r.nextDouble() * (lastnames.length - 1))]);
-        }
-        s2.setImmediate(true);
-        main.addComponent(s2);
-
-        // initially empty
-        final ComboBox s3 = new ComboBox("Initially empty; enter your own");
-        s3.setDebugId("EmptyComboBox");
-        s3.setColumns(20);
-        s3.setImmediate(true);
-        s3.setNewItemsAllowed(true);
-        main.addComponent(s3);
-
-    }
-
-}
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/EmbeddedBrowserExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/EmbeddedBrowserExample.java
deleted file mode 100644 (file)
index 2ecf60e..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/* 
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.automatedtests.featurebrowser;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.ui.Embedded;
-import com.vaadin.ui.Select;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window.Notification;
-
-/**
- * Demonstrates the use of Embedded and "suggesting" Select by creating a simple
- * web-browser. Note: does not check for recursion.
- * 
- * @author IT Mill Ltd.
- * @see com.vaadin.ui.Window
- */
-@SuppressWarnings("serial")
-public class EmbeddedBrowserExample extends VerticalLayout implements
-        Select.ValueChangeListener {
-
-    // Default URL to open.
-    private static final String DEFAULT_URL = "http://www.vaadin.com/";
-
-    // The embedded page
-    Embedded emb = new Embedded();
-
-    public EmbeddedBrowserExample() {
-        this(new String[] { DEFAULT_URL, "http://www.vaadin.com/learn",
-                "http://www.vaadin.com/api", "http://www.vaadin.com/book" });
-    }
-
-    public EmbeddedBrowserExample(String[] urls) {
-        setSizeFull();
-
-        // create the address combobox
-        final Select select = new Select();
-        // allow input
-        select.setNewItemsAllowed(true);
-        // no empty selection
-        select.setNullSelectionAllowed(false);
-        // no 'go' -button clicking necessary
-        select.setImmediate(true);
-        // add some pre-configured URLs
-        for (int i = 0; i < urls.length; i++) {
-            select.addItem(urls[i]);
-        }
-        // add to layout
-        addComponent(select);
-        // add listener and select initial URL
-        select.addListener(this);
-        select.setValue(urls[0]);
-
-        select.setWidth("100%");
-
-        // configure the embedded and add to layout
-        emb.setType(Embedded.TYPE_BROWSER);
-        emb.setSizeFull();
-        addComponent(emb);
-        // make the embedded as large as possible
-        setExpandRatio(emb, 1);
-
-    }
-
-    public void valueChange(ValueChangeEvent event) {
-        final String url = (String) event.getProperty().getValue();
-        if (url != null) {
-            try {
-                // the selected url has changed, let's go there
-                @SuppressWarnings("unused")
-                URL u = new URL(url);
-                emb.setSource(new ExternalResource(url));
-
-            } catch (MalformedURLException e) {
-                getWindow().showNotification("Invalid address",
-                        e.getMessage() + " (example: http://www.vaadin.com)",
-                        Notification.TYPE_WARNING_MESSAGE);
-            }
-
-        }
-
-    }
-}
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/FeatureBrowser.java b/tests/src/com/vaadin/automatedtests/featurebrowser/FeatureBrowser.java
deleted file mode 100644 (file)
index b6f2e0e..0000000
+++ /dev/null
@@ -1,387 +0,0 @@
-/* 
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.automatedtests.featurebrowser;
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import com.vaadin.data.Item;
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.data.util.HierarchicalContainer;
-import com.vaadin.data.util.IndexedContainer;
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.ThemeResource;
-import com.vaadin.ui.AbstractSelect;
-import com.vaadin.ui.Alignment;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Component;
-import com.vaadin.ui.Embedded;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Layout;
-import com.vaadin.ui.Select;
-import com.vaadin.ui.SplitPanel;
-import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.Table;
-import com.vaadin.ui.Tree;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Button.ClickEvent;
-
-/**
- * 
- * @author IT Mill Ltd.
- * @see com.vaadin.ui.Window
- */
-@SuppressWarnings("serial")
-public class FeatureBrowser extends com.vaadin.Application implements
-        Select.ValueChangeListener {
-
-    // Property IDs
-
-    private static final Object PROPERTY_ID_CATEGORY = "Category";
-    private static final Object PROPERTY_ID_NAME = "Name";
-    private static final Object PROPERTY_ID_DESC = "Description";
-    private static final Object PROPERTY_ID_CLASS = "Class";
-    private static final Object PROPERTY_ID_VIEWED = "Viewed";
-
-    // Global components
-    private Tree tree;
-    private Table table;
-    private TabSheet ts;
-
-    // Example "cache"
-    private final HashMap<Class<?>, Component> exampleInstances = new HashMap<Class<?>, Component>();
-    private String section;
-
-    // List of examples
-    private static final Object[][] demos = new Object[][] {
-    // Category, Name, Desc, Class, Viewed
-            // Getting started: Labels
-            { "Getting started", "Labels", "Some variations of Labels",
-                    LabelExample.class },
-            // Getting started: Buttons
-            { "Getting started", "Buttons and links",
-                    "Various Buttons and Links", ButtonExample.class },
-            // Getting started: Fields
-            { "Getting started", "Basic value input",
-                    "TextFields, DateFields, and such", ValueInputExample.class },
-            //
-            { "Getting started", "RichText", "Rich text editing",
-                    RichTextExample.class },
-            // Getting started: Selects
-            { "Getting started", "Choices, choices",
-                    "Some variations of simple selects", SelectExample.class },
-            // Layouts
-            { "Layouts", "Basic layouts", "Laying out components",
-                    LayoutExample.class },
-            // Layouts
-            { "Layouts", "Accordion", "Play the Accordion!",
-                    AccordionExample.class },
-            // Wrangling data: ComboBox
-            { "Wrangling data", "ComboBox", "ComboBox - the swiss army select",
-                    ComboBoxExample.class },
-            // Wrangling data: Table
-            {
-                    "Wrangling data",
-                    "Table (\"grid\")",
-                    "Table with bells, whistles, editmode and actions (contextmenu)",
-                    TableExample.class },
-            // Wrangling data: Form
-            { "Wrangling data", "Form", "Every application needs forms",
-                    FormExample.class },
-            // Wrangling data: Tree
-            { "Wrangling data", "Tree", "A hierarchy of things",
-                    TreeExample.class },
-            // Misc: Notifications
-            { "Misc", "Notifications", "Notifications can improve usability",
-                    NotificationExample.class },
-            // Misc: Caching
-            { "Misc", "Client caching", "Demonstrating of client-side caching",
-                    ClientCachingExample.class },
-            // Misc: Embedded
-            { "Misc", "Embedding",
-                    "Embedding resources - another site in this case",
-                    EmbeddedBrowserExample.class },
-            // Windowing
-            { "Misc", "Windowing", "About windowing", WindowingExample.class },
-            // JavaScript API
-            { "Misc", "JavaScript API", "JavaScript to Vaadin communication",
-                    JavaScriptAPIExample.class },
-    // END
-    };
-
-    @Override
-    public void init() {
-
-        // Need to set a theme for ThemeResources to work
-        setTheme("example");
-
-        // Create new window for the application and give the window a visible.
-        final Window main = new Window("Vaadin 6");
-        main.setDebugId("mainWindow");
-        // set as main window
-        setMainWindow(main);
-
-        final SplitPanel split = new SplitPanel(
-                SplitPanel.ORIENTATION_HORIZONTAL);
-        split.setSplitPosition(200, SplitPanel.UNITS_PIXELS);
-        main.setContent(split);
-
-        final HashMap<String, Object> sectionIds = new HashMap<String, Object>();
-        final HierarchicalContainer container = createContainer();
-        final Object rootId = container.addItem();
-        Item item = container.getItem(rootId);
-        Property p = item.getItemProperty(PROPERTY_ID_NAME);
-        p.setValue("All examples");
-        for (int i = 0; i < demos.length; i++) {
-            final Object[] demo = demos[i];
-            final String section = (String) demo[0];
-            Object sectionId;
-            if (sectionIds.containsKey(section)) {
-                sectionId = sectionIds.get(section);
-            } else {
-                sectionId = container.addItem();
-                sectionIds.put(section, sectionId);
-                container.setParent(sectionId, rootId);
-                item = container.getItem(sectionId);
-                p = item.getItemProperty(PROPERTY_ID_NAME);
-                p.setValue(section);
-            }
-            final Object id = container.addItem();
-            container.setParent(id, sectionId);
-            initItem(container.getItem(id), demo);
-
-        }
-
-        tree = new Tree();
-        tree.setDebugId("FeatureBrowser: Main Tree");
-        tree.setSelectable(true);
-        tree.setMultiSelect(false);
-        tree.setNullSelectionAllowed(false);
-        tree.setContainerDataSource(container);
-        tree.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
-        tree.setItemCaptionPropertyId(PROPERTY_ID_NAME);
-        tree.addListener(this);
-        tree.setImmediate(true);
-        tree.expandItemsRecursively(rootId);
-        for (Iterator<?> i = container.getItemIds().iterator(); i.hasNext();) {
-            Object id = i.next();
-            if (container.getChildren(id) == null) {
-                tree.setChildrenAllowed(id, false);
-            }
-        }
-
-        split.addComponent(tree);
-
-        final SplitPanel split2 = new SplitPanel();
-        split2.setSplitPosition(200, SplitPanel.UNITS_PIXELS);
-        split.addComponent(split2);
-
-        table = new Table();
-        table.setDebugId("FeatureBrowser: Main Table");
-        table.setSizeFull();
-        table.setColumnReorderingAllowed(true);
-        table.setColumnCollapsingAllowed(true);
-        table.setSelectable(true);
-        table.setMultiSelect(false);
-        table.setNullSelectionAllowed(false);
-        try {
-            table.setContainerDataSource((IndexedContainer) container.clone());
-        } catch (final Exception e) {
-            e.printStackTrace(System.err);
-        }
-        // Hide some columns
-        table.setVisibleColumns(new Object[] { PROPERTY_ID_CATEGORY,
-                PROPERTY_ID_NAME, PROPERTY_ID_DESC, PROPERTY_ID_VIEWED });
-        table.addListener(this);
-        table.setImmediate(true);
-        split2.addComponent(table);
-
-        final VerticalLayout exp = new VerticalLayout();
-        exp.setSizeFull();
-        exp.setMargin(true);
-        split2.addComponent(exp);
-
-        final HorizontalLayout wbLayout = new HorizontalLayout();
-        Button b = new Button("Open in sub-window", new Button.ClickListener() {
-
-            public void buttonClick(ClickEvent event) {
-                Component component = (Component) ts.getComponentIterator()
-                        .next();
-                String caption = ts.getTab(component).getCaption();
-                try {
-                    component = component.getClass().newInstance();
-                } catch (Exception e) {
-                    // Could not create
-                    return;
-                }
-                Window w = new Window(caption);
-                w.setWidth("640px");
-                if (Layout.class.isAssignableFrom(component.getClass())) {
-                    w.setContent((Layout) component);
-                } else {
-                    // w.getLayout().getSize().setSizeFull();
-                    w.addComponent(component);
-                }
-                getMainWindow().addWindow(w);
-            }
-        });
-        b.setStyleName(Button.STYLE_LINK);
-        wbLayout.addComponent(b);
-        b = new Button("Open in native window", new Button.ClickListener() {
-
-            public void buttonClick(ClickEvent event) {
-                Component component = (Component) ts.getComponentIterator()
-                        .next();
-                final String caption = ts.getTab(component).getCaption();
-                Window w = getWindow(caption);
-                if (w == null) {
-                    try {
-                        component = component.getClass().newInstance();
-                    } catch (final Exception e) {
-                        // Could not create
-                        return;
-                    }
-                    w = new Window(caption);
-                    w.setName(caption);
-                    if (Layout.class.isAssignableFrom(component.getClass())) {
-                        w.setContent((Layout) component);
-                    } else {
-                        // w.getLayout().getSize().setSizeFull();
-                        w.addComponent(component);
-                    }
-                    addWindow(w);
-                }
-                getMainWindow().open(new ExternalResource(w.getURL()), caption);
-            }
-        });
-        b.setStyleName(Button.STYLE_LINK);
-        wbLayout.addComponent(b);
-
-        exp.addComponent(wbLayout);
-        exp.setComponentAlignment(wbLayout, Alignment.TOP_RIGHT);
-
-        ts = new TabSheet();
-        ts.setSizeFull();
-        ts.addTab(new Label(""), "Choose example", null);
-        exp.addComponent(ts);
-        exp.setExpandRatio(ts, 1);
-
-        final Label status = new Label(
-                "<a href=\"http://www.vaadin.com/learn\">30 Seconds to Vaadin</a>"
-                        + " | <a href=\"http://www.vaadin.com/book\">Book of Vaadin</a>");
-        status.setContentMode(Label.CONTENT_XHTML);
-        exp.addComponent(status);
-        exp.setComponentAlignment(status, Alignment.MIDDLE_RIGHT);
-
-        // select initial section ("All")
-        tree.setValue(rootId);
-
-        getMainWindow()
-                .showNotification(
-                        "Welcome",
-                        "Choose an example to begin.<br/><br/>And remember to experiment!",
-                        Window.Notification.TYPE_TRAY_NOTIFICATION);
-    }
-
-    private void initItem(Item item, Object[] data) {
-        int p = 0;
-        Property prop = item.getItemProperty(PROPERTY_ID_CATEGORY);
-        prop.setValue(data[p++]);
-        prop = item.getItemProperty(PROPERTY_ID_NAME);
-        prop.setValue(data[p++]);
-        prop = item.getItemProperty(PROPERTY_ID_DESC);
-        prop.setValue(data[p++]);
-        prop = item.getItemProperty(PROPERTY_ID_CLASS);
-        prop.setValue(data[p++]);
-    }
-
-    private HierarchicalContainer createContainer() {
-        final HierarchicalContainer c = new HierarchicalContainer();
-        c.addContainerProperty(PROPERTY_ID_CATEGORY, String.class, null);
-        c.addContainerProperty(PROPERTY_ID_NAME, String.class, "");
-        c.addContainerProperty(PROPERTY_ID_DESC, String.class, "");
-        c.addContainerProperty(PROPERTY_ID_CLASS, Class.class, null);
-        c.addContainerProperty(PROPERTY_ID_VIEWED, Embedded.class, null);
-        return c;
-    }
-
-    public void valueChange(ValueChangeEvent event) {
-        if (event.getProperty() == tree) {
-            final Object id = tree.getValue();
-            if (id == null) {
-                return;
-            }
-            final Item item = tree.getItem(id);
-            //
-            String newSection;
-            if (tree.isRoot(id)) {
-                newSection = ""; // show all sections
-            } else if (tree.hasChildren(id)) {
-                newSection = (String) item.getItemProperty(PROPERTY_ID_NAME)
-                        .getValue();
-            } else {
-                newSection = (String) item
-                        .getItemProperty(PROPERTY_ID_CATEGORY).getValue();
-            }
-
-            table.setValue(null);
-            final IndexedContainer c = (IndexedContainer) table
-                    .getContainerDataSource();
-
-            if (newSection != null && !newSection.equals(section)) {
-                c.removeAllContainerFilters();
-                c.addContainerFilter(PROPERTY_ID_CATEGORY, newSection, false,
-                        true);
-            }
-            section = newSection;
-            if (!tree.hasChildren(id)) {
-                // Example, not section
-                // update table selection
-                table.setValue(id);
-            }
-
-        } else if (event.getProperty() == table) {
-            if (table.getValue() != null) {
-                table.removeListener(this);
-                tree.setValue(table.getValue());
-                table.addListener(this);
-                final Item item = table.getItem(table.getValue());
-                final Class<?> c = (Class<?>) item.getItemProperty(
-                        PROPERTY_ID_CLASS).getValue();
-                final Component component = getComponent(c);
-                if (component != null) {
-                    final String caption = (String) item.getItemProperty(
-                            PROPERTY_ID_NAME).getValue();
-                    ts.removeAllComponents();
-                    ts.addTab(component, caption, null);
-                }
-                // update "viewed" state
-                final Property p = item.getItemProperty(PROPERTY_ID_VIEWED);
-                if (p.getValue() == null) {
-                    p.setValue(new Embedded("", new ThemeResource(
-                            "icons/ok.png")));
-                }
-                table.requestRepaint();
-            }
-        }
-
-    }
-
-    private Component getComponent(Class<?> componentClass) {
-        if (!exampleInstances.containsKey(componentClass)) {
-            try {
-                final Component c = (Component) componentClass.newInstance();
-                exampleInstances.put(componentClass, c);
-            } catch (final Exception e) {
-                return null;
-            }
-        }
-        return exampleInstances.get(componentClass);
-    }
-
-}
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/FormExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/FormExample.java
deleted file mode 100644 (file)
index 927f2ba..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-package com.vaadin.automatedtests.featurebrowser;
-
-import java.io.Serializable;
-
-import com.vaadin.data.Item;
-import com.vaadin.data.Validator;
-import com.vaadin.data.util.BeanItem;
-import com.vaadin.ui.BaseFieldFactory;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Component;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.Field;
-import com.vaadin.ui.Form;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Button.ClickEvent;
-
-/**
- * This example demonstrates the most important features of the Form component:
- * binding Form to a JavaBean so that form fields are automatically generated
- * from the bean properties, creation of custom field editors using a
- * FieldFactory, customizing the form without FieldFactory, buffering
- * (commit/discard) and validation. Please note that the example is quite a bit
- * more complex than real use, as it tries to demonstrate more features than
- * needed in general case.
- */
-@SuppressWarnings("serial")
-public class FormExample extends CustomComponent {
-
-    static final String cities[] = { "Amsterdam", "Berlin", "Helsinki",
-            "Hong Kong", "London", "Luxemburg", "New York", "Oslo", "Paris",
-            "Rome", "Stockholm", "Tokyo", "Turku" };
-
-    /** Compose the demo. */
-    public FormExample() {
-
-        // Example data model
-        final Address dataModel = new Address();
-        Button peekDataModelState = new Button("Show the data model state",
-                new Button.ClickListener() {
-
-                    public void buttonClick(ClickEvent event) {
-                        getWindow().showNotification(
-                                dataModel.getAddressAsText());
-                    }
-                });
-
-        // Example form
-        final AddressForm form = new AddressForm("Contact Information");
-        form.setDataSource(dataModel);
-        form
-                .setDescription("Please enter valid name and address. Fields marked with * are required. "
-                        + "If you try to commit with invalid values, a form error message is displayed. "
-                        + "(Address is required but failing to give it a value does not display an error.)");
-
-        // Layout the example
-        VerticalLayout root = new VerticalLayout();
-        root.setMargin(true);
-        root.setSpacing(true);
-        root.addComponent(form);
-        root.addComponent(peekDataModelState);
-        setCompositionRoot(root);
-    }
-
-    public static class AddressForm extends Form {
-
-        public AddressForm(String caption) {
-
-            setCaption(caption);
-
-            // Use custom field factory to modify the defaults on how the
-            // components are created
-            setFieldFactory(new MyFieldFactory());
-
-            // Add Commit and Discard controls to the form.
-            Button commit = new Button("Save", this, "commit");
-            Button discard = new Button("Reset", this, "discard");
-            HorizontalLayout footer = new HorizontalLayout();
-            footer.addComponent(commit);
-            footer.addComponent(discard);
-            setFooter(footer);
-        }
-
-        public void setDataSource(Address dataModel) {
-
-            // Set the form to edit given datamodel by converting pojo used as
-            // the datamodel to Item
-            setItemDataSource(new BeanItem(dataModel));
-
-            // Ensure that the fields are shown in correct order as the
-            // datamodel does not force any specific order.
-            setVisibleItemProperties(new String[] { "name", "streetAddress",
-                    "postalCode", "city" });
-
-            // For examples sake, customize some of the form fields directly
-            // here. The alternative way is to use custom field factory as shown
-            // above.
-            getField("name").setRequired(true);
-            getField("name").setRequiredError("Name is missing");
-            getField("streetAddress").setRequired(true); // No error message
-            getField("postalCode").setRequired(true); // No error message
-            replaceWithSelect("city", cities, cities).setNewItemsAllowed(true);
-
-            // Set the form to act immediately on user input. This is
-            // automatically transports data between the client and the server
-            // to do server-side validation.
-            setImmediate(true);
-
-            // Enable buffering so that commit() must be called for the form
-            // before input is written to the data. (Form input is not written
-            // immediately through to the underlying object.)
-            setWriteThrough(false);
-        }
-    }
-
-    /**
-     * This is example on how to customize field creation. Any kind of field
-     * components could be created on the fly.
-     */
-    static class MyFieldFactory extends BaseFieldFactory implements
-            Serializable {
-
-        @Override
-        public Field createField(Item item, Object propertyId,
-                Component uiContext) {
-
-            Field field = super.createField(item, propertyId, uiContext);
-
-            if ("postalCode".equals(propertyId)) {
-                ((TextField) field).setColumns(5);
-                field.addValidator(new PostalCodeValidator());
-            }
-
-            return field;
-        }
-
-    }
-
-    /**
-     * This is an example of how to create a custom validator for automatic
-     * input validation.
-     */
-    static class PostalCodeValidator implements Validator {
-
-        public boolean isValid(Object value) {
-            if (value == null || !(value instanceof String)) {
-                return false;
-            }
-
-            return ((String) value).matches("[0-9]{5}");
-        }
-
-        public void validate(Object value) throws InvalidValueException {
-            if (!isValid(value)) {
-                throw new InvalidValueException(
-                        "Postal code must be a five digit number.");
-            }
-        }
-    }
-
-    /**
-     * Contact information data model created as POJO. Note that in many cases
-     * it would be a good idea to implement Item -interface for the datamodel to
-     * make it directly bindable to form (without BeanItem wrapper)
-     */
-    public static class Address implements Serializable {
-
-        String name = "";
-        String streetAddress = "";
-        String postalCode = "";
-        String city;
-
-        public String getAddressAsText() {
-            return name + "\n" + streetAddress + "\n" + postalCode + " "
-                    + (city == null ? "" : city);
-        }
-
-        public void setName(String name) {
-            this.name = name;
-        }
-
-        public String getName() {
-            return name;
-        }
-
-        public void setStreetAddress(String address) {
-            streetAddress = address;
-        }
-
-        public String getStreetAddress() {
-            return streetAddress;
-        }
-
-        public void setPostalCode(String postalCode) {
-            this.postalCode = postalCode;
-        }
-
-        public String getPostalCode() {
-            return postalCode;
-        }
-
-        public void setCity(String city) {
-            this.city = city;
-        }
-
-        public String getCity() {
-            return city;
-        }
-    }
-
-}
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/GeneratedColumnExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/GeneratedColumnExample.java
deleted file mode 100644 (file)
index 0988715..0000000
+++ /dev/null
@@ -1,561 +0,0 @@
-/* 
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.automatedtests.featurebrowser;
-
-import java.util.Collection;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.Vector;
-
-import com.vaadin.data.Container;
-import com.vaadin.data.Item;
-import com.vaadin.data.Property;
-import com.vaadin.data.Container.Indexed;
-import com.vaadin.data.util.BeanItem;
-import com.vaadin.ui.AbstractField;
-import com.vaadin.ui.BaseFieldFactory;
-import com.vaadin.ui.CheckBox;
-import com.vaadin.ui.Component;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.Field;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Table;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
-
-/**
- * This example demonstrates the use of generated columns in a table. Generated
- * columns can be used for formatting values or calculating them from other
- * columns (or properties of the items).
- * 
- * For the data model, we use POJOs bound to a custom Container with BeanItem
- * items.
- * 
- * @author magi
- */
-@SuppressWarnings("serial")
-public class GeneratedColumnExample extends CustomComponent {
-
-    /**
-     * The business model: fill-up at a gas station.
-     */
-    public class FillUp {
-        Date date;
-        double quantity;
-        double total;
-
-        public FillUp() {
-        }
-
-        public FillUp(int day, int month, int year, double quantity,
-                double total) {
-            date = new GregorianCalendar(year, month - 1, day).getTime();
-            this.quantity = quantity;
-            this.total = total;
-        }
-
-        /** Calculates price per unit of quantity (€/l). */
-        public double price() {
-            if (quantity != 0.0) {
-                return total / quantity;
-            } else {
-                return 0.0;
-            }
-        }
-
-        /** Calculates average daily consumption between two fill-ups. */
-        public double dailyConsumption(FillUp other) {
-            double difference_ms = date.getTime() - other.date.getTime();
-            double days = difference_ms / 1000 / 3600 / 24;
-            if (days < 0.5) {
-                days = 1.0; // Avoid division by zero if two fill-ups on the
-                // same day.
-            }
-            return quantity / days;
-        }
-
-        /** Calculates average daily consumption between two fill-ups. */
-        public double dailyCost(FillUp other) {
-            return price() * dailyConsumption(other);
-        }
-
-        // Getters and setters
-
-        public Date getDate() {
-            return date;
-        }
-
-        public void setDate(Date date) {
-            this.date = date;
-        }
-
-        public double getQuantity() {
-            return quantity;
-        }
-
-        public void setQuantity(double quantity) {
-            this.quantity = quantity;
-        }
-
-        public double getTotal() {
-            return total;
-        }
-
-        public void setTotal(double total) {
-            this.total = total;
-        }
-    };
-
-    /**
-     * This is a custom container that allows adding BeanItems inside it. The
-     * BeanItem objects must be bound to an object. The item ID is an Integer
-     * from 0 to 99.
-     * 
-     * Most of the interface methods are implemented with just dummy
-     * implementations, as they are not needed in this example.
-     */
-    public class MySimpleIndexedContainer implements Container, Indexed {
-
-        Vector<BeanItem> items;
-        Object itemtemplate;
-
-        public MySimpleIndexedContainer(Object itemtemplate) {
-            this.itemtemplate = itemtemplate;
-            items = new Vector<BeanItem>(); // Yeah this is just a test
-        }
-
-        public boolean addContainerProperty(Object propertyId, Class<?> type,
-                Object defaultValue) throws UnsupportedOperationException {
-            throw new UnsupportedOperationException();
-        }
-
-        public Item addItem(Object itemId) throws UnsupportedOperationException {
-            throw new UnsupportedOperationException();
-        }
-
-        public Object addItem() throws UnsupportedOperationException {
-            throw new UnsupportedOperationException();
-        }
-
-        /**
-         * This addItem method is specific for this container and allows adding
-         * BeanItem objects. The BeanItems must be bound to MyBean objects.
-         */
-        public void addItem(BeanItem item) throws UnsupportedOperationException {
-            items.add(item);
-        }
-
-        public boolean containsId(Object itemId) {
-            if (itemId instanceof Integer) {
-                int pos = ((Integer) itemId).intValue();
-                if (pos >= 0 && pos < items.size()) {
-                    return items.get(pos) != null;
-                }
-            }
-            return false;
-        }
-
-        /**
-         * The Table will call this method to get the property objects for the
-         * columns. It uses the property objects to determine the data types of
-         * the columns.
-         */
-        public Property getContainerProperty(Object itemId, Object propertyId) {
-            if (itemId instanceof Integer) {
-                int pos = ((Integer) itemId).intValue();
-                if (pos >= 0 && pos < items.size()) {
-                    Item item = items.get(pos);
-
-                    // The BeanItem provides the property objects for the items.
-                    return item.getItemProperty(propertyId);
-                }
-            }
-            return null;
-        }
-
-        /** Table calls this to get the column names. */
-        public Collection getContainerPropertyIds() {
-            Item item = new BeanItem(itemtemplate);
-
-            // The BeanItem knows how to get the property names from the bean.
-            return item.getItemPropertyIds();
-        }
-
-        public Item getItem(Object itemId) {
-            if (itemId instanceof Integer) {
-                int pos = ((Integer) itemId).intValue();
-                if (pos >= 0 && pos < items.size()) {
-                    return items.get(pos);
-                }
-            }
-            return null;
-        }
-
-        public Collection getItemIds() {
-            Vector ids = new Vector(items.size());
-            for (int i = 0; i < items.size(); i++) {
-                ids.add(Integer.valueOf(i));
-            }
-            return ids;
-        }
-
-        public Class getType(Object propertyId) {
-            return BeanItem.class;
-        }
-
-        public boolean removeAllItems() throws UnsupportedOperationException {
-            throw new UnsupportedOperationException();
-        }
-
-        public boolean removeContainerProperty(Object propertyId)
-                throws UnsupportedOperationException {
-            throw new UnsupportedOperationException();
-        }
-
-        public boolean removeItem(Object itemId)
-                throws UnsupportedOperationException {
-            throw new UnsupportedOperationException();
-        }
-
-        public int size() {
-            return items.size();
-        }
-
-        public Object addItemAt(int index) throws UnsupportedOperationException {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        public Item addItemAt(int index, Object newItemId)
-                throws UnsupportedOperationException {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        public Object getIdByIndex(int index) {
-            return Integer.valueOf(index);
-        }
-
-        public int indexOfId(Object itemId) {
-            return ((Integer) itemId).intValue();
-        }
-
-        public Object addItemAfter(Object previousItemId)
-                throws UnsupportedOperationException {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        public Item addItemAfter(Object previousItemId, Object newItemId)
-                throws UnsupportedOperationException {
-            // TODO Auto-generated method stub
-            return null;
-        }
-
-        public Object firstItemId() {
-            return new Integer(0);
-        }
-
-        public boolean isFirstId(Object itemId) {
-            return ((Integer) itemId).intValue() == 0;
-        }
-
-        public boolean isLastId(Object itemId) {
-            return ((Integer) itemId).intValue() == (items.size() - 1);
-        }
-
-        public Object lastItemId() {
-            return new Integer(items.size() - 1);
-        }
-
-        public Object nextItemId(Object itemId) {
-            int pos = indexOfId(itemId);
-            if (pos >= items.size() - 1) {
-                return null;
-            }
-            return getIdByIndex(pos + 1);
-        }
-
-        public Object prevItemId(Object itemId) {
-            int pos = indexOfId(itemId);
-            if (pos <= 0) {
-                return null;
-            }
-            return getIdByIndex(pos - 1);
-        }
-    }
-
-    /** Formats the dates in a column containing Date objects. */
-    class DateColumnGenerator implements Table.ColumnGenerator {
-        /**
-         * Generates the cell containing the Date value. The column is
-         * irrelevant in this use case.
-         */
-        public Component generateCell(Table source, Object itemId,
-                Object columnId) {
-            Property prop = source.getItem(itemId).getItemProperty(columnId);
-            if (prop.getType().equals(Date.class)) {
-                Label label = new Label(String.format("%tF",
-                        new Object[] { (Date) prop.getValue() }));
-                label.addStyleName("column-type-date");
-                return label;
-            }
-
-            return null;
-        }
-    }
-
-    /** Formats the value in a column containing Double objects. */
-    class ValueColumnGenerator implements Table.ColumnGenerator {
-        String format; /* Format string for the Double values. */
-
-        /** Creates double value column formatter with the given format string. */
-        public ValueColumnGenerator(String format) {
-            this.format = format;
-        }
-
-        /**
-         * Generates the cell containing the Double value. The column is
-         * irrelevant in this use case.
-         */
-        public Component generateCell(Table source, Object itemId,
-                Object columnId) {
-            Property prop = source.getItem(itemId).getItemProperty(columnId);
-            if (prop.getType().equals(Double.class)) {
-                Label label = new Label(String.format(format,
-                        new Object[] { (Double) prop.getValue() }));
-
-                // Set styles for the column: one indicating that it's a value
-                // and a more
-                // specific one with the column name in it. This assumes that
-                // the column
-                // name is proper for CSS.
-                label.addStyleName("column-type-value");
-                label.addStyleName("column-" + (String) columnId);
-                return label;
-            }
-            return null;
-        }
-    }
-
-    /** Table column generator for calculating price column. */
-    class PriceColumnGenerator implements Table.ColumnGenerator {
-        public Component generateCell(Table source, Object itemId,
-                Object columnId) {
-            // Retrieve the item.
-            BeanItem item = (BeanItem) source.getItem(itemId);
-
-            // Retrieves the underlying POJO from the item.
-            FillUp fillup = (FillUp) item.getBean();
-
-            // Do the business logic
-            double price = fillup.price();
-
-            // Create the generated component for displaying the calcucated
-            // value.
-            Label label = new Label(String.format("%1.2f â‚¬",
-                    new Object[] { new Double(price) }));
-
-            // We set the style here. You can't use a CellStyleGenerator for
-            // generated columns.
-            label.addStyleName("column-price");
-            return label;
-        }
-    }
-
-    /** Table column generator for calculating consumption column. */
-    class ConsumptionColumnGenerator implements Table.ColumnGenerator {
-
-        /**
-         * Generates a cell containing value calculated from the item.
-         */
-        public Component generateCell(Table source, Object itemId,
-                Object columnId) {
-            Indexed indexedSource = (Indexed) source.getContainerDataSource();
-
-            // Can not calculate consumption for the first item.
-            if (indexedSource.isFirstId(itemId)) {
-                Label label = new Label("N/A");
-                label.addStyleName("column-consumption");
-                return label;
-            }
-
-            // Index of the previous item.
-            Object prevItemId = indexedSource.prevItemId(itemId);
-
-            // Retrieve the POJOs.
-            FillUp fillup = (FillUp) ((BeanItem) indexedSource.getItem(itemId))
-                    .getBean();
-            FillUp prev = (FillUp) ((BeanItem) source.getItem(prevItemId))
-                    .getBean();
-
-            // Do the business logic
-            return generateCell(fillup, prev);
-        }
-
-        public Component generateCell(FillUp fillup, FillUp prev) {
-            double consumption = fillup.dailyConsumption(prev);
-
-            // Generate the component for displaying the calculated value.
-            Label label = new Label(String.format("%3.2f l",
-                    new Object[] { new Double(consumption) }));
-
-            // We set the style here. You can't use a CellStyleGenerator for
-            // generated columns.
-            label.addStyleName("column-consumption");
-            return label;
-        }
-    }
-
-    /** Table column generator for calculating daily cost column. */
-    class DailyCostColumnGenerator extends ConsumptionColumnGenerator {
-
-        @Override
-        public Component generateCell(FillUp fillup, FillUp prev) {
-            double dailycost = fillup.dailyCost(prev);
-
-            // Generate the component for displaying the calculated value.
-            Label label = new Label(String.format("%3.2f â‚¬",
-                    new Object[] { new Double(dailycost) }));
-
-            // We set the style here. You can't use a CellStyleGenerator for
-            // generated columns.
-            label.addStyleName("column-dailycost");
-            return label;
-        }
-    }
-
-    /**
-     * Custom field factory that sets the fields as immediate.
-     */
-    public class ImmediateFieldFactory extends BaseFieldFactory {
-        @Override
-        public Field createField(Class type, Component uiContext) {
-            // Let the BaseFieldFactory create the fields
-            Field field = super.createField(type, uiContext);
-
-            // ...and just set them as immediate
-            ((AbstractField) field).setImmediate(true);
-
-            return field;
-        }
-    }
-
-    public GeneratedColumnExample() {
-        final Table table = new Table();
-
-        // Define table columns. These include also the column for the generated
-        // column, because we want to set the column label to something
-        // different than the property ID.
-        table
-                .addContainerProperty("date", Date.class, null, "Date", null,
-                        null);
-        table.addContainerProperty("quantity", Double.class, null,
-                "Quantity (l)", null, null);
-        table.addContainerProperty("price", Double.class, null,
-                "Price (€/l)", null, null);
-        table.addContainerProperty("total", Double.class, null, "Total (€)",
-                null, null);
-        table.addContainerProperty("consumption", Double.class, null,
-                "Consumption (l/day)", null, null);
-        table.addContainerProperty("dailycost", Double.class, null,
-                "Daily Cost (€/day)", null, null);
-
-        // Define the generated columns and their generators.
-        table.addGeneratedColumn("date", new DateColumnGenerator());
-        table
-                .addGeneratedColumn("quantity", new ValueColumnGenerator(
-                        "%.2f l"));
-        table.addGeneratedColumn("price", new PriceColumnGenerator());
-        table.addGeneratedColumn("total", new ValueColumnGenerator("%.2f â‚¬"));
-        table.addGeneratedColumn("consumption",
-                new ConsumptionColumnGenerator());
-        table.addGeneratedColumn("dailycost", new DailyCostColumnGenerator());
-
-        // Create a data source and bind it to the table.
-        MySimpleIndexedContainer data = new MySimpleIndexedContainer(
-                new FillUp());
-        table.setContainerDataSource(data);
-
-        // Generated columns are automatically placed after property columns, so
-        // we have to set the order of the columns explicitly.
-        table.setVisibleColumns(new Object[] { "date", "quantity", "price",
-                "total", "consumption", "dailycost" });
-
-        // Add some data.
-        data.addItem(new BeanItem(new FillUp(19, 2, 2005, 44.96, 51.21)));
-        data.addItem(new BeanItem(new FillUp(30, 3, 2005, 44.91, 53.67)));
-        data.addItem(new BeanItem(new FillUp(20, 4, 2005, 42.96, 49.06)));
-        data.addItem(new BeanItem(new FillUp(23, 5, 2005, 47.37, 55.28)));
-        data.addItem(new BeanItem(new FillUp(6, 6, 2005, 35.34, 41.52)));
-        data.addItem(new BeanItem(new FillUp(30, 6, 2005, 16.07, 20.00)));
-        data.addItem(new BeanItem(new FillUp(2, 7, 2005, 36.40, 36.19)));
-        data.addItem(new BeanItem(new FillUp(6, 7, 2005, 39.17, 50.90)));
-        data.addItem(new BeanItem(new FillUp(27, 7, 2005, 43.43, 53.03)));
-        data.addItem(new BeanItem(new FillUp(17, 8, 2005, 20, 29.18)));
-        data.addItem(new BeanItem(new FillUp(30, 8, 2005, 46.06, 59.09)));
-        data.addItem(new BeanItem(new FillUp(22, 9, 2005, 46.11, 60.36)));
-        data.addItem(new BeanItem(new FillUp(14, 10, 2005, 41.51, 50.19)));
-        data.addItem(new BeanItem(new FillUp(12, 11, 2005, 35.24, 40.00)));
-        data.addItem(new BeanItem(new FillUp(28, 11, 2005, 45.26, 53.27)));
-
-        // Have a check box that allows the user to make the quantity
-        // and total columns editable.
-        final CheckBox editable = new CheckBox(
-                "Edit the input values - calculated columns are regenerated");
-        editable.setImmediate(true);
-        editable.addListener(new ClickListener() {
-            public void buttonClick(ClickEvent event) {
-                table.setEditable(editable.booleanValue());
-
-                // The columns may not be generated when we want to have them
-                // editable.
-                if (editable.booleanValue()) {
-                    table.removeGeneratedColumn("quantity");
-                    table.removeGeneratedColumn("total");
-                } else {
-                    // In non-editable mode we want to show the formatted
-                    // values.
-                    table.addGeneratedColumn("quantity",
-                            new ValueColumnGenerator("%.2f l"));
-                    table.addGeneratedColumn("total", new ValueColumnGenerator(
-                            "%.2f â‚¬"));
-                }
-                // The visible columns are affected by removal and addition of
-                // generated columns so we have to redefine them.
-                table.setVisibleColumns(new Object[] { "date", "quantity",
-                        "price", "total", "consumption", "dailycost" });
-            }
-        });
-
-        // Use a custom field factory to set the edit fields as immediate.
-        // This is used when the table is in editable mode.
-        table.setFieldFactory(new ImmediateFieldFactory());
-
-        // Setting the table itself as immediate has no relevance in this
-        // example,
-        // because it is relevant only if the table is selectable and we want to
-        // get the selection changes immediately.
-        table.setImmediate(true);
-
-        table.setHeight("300px");
-
-        VerticalLayout layout = new VerticalLayout();
-        layout.setMargin(true);
-        layout
-                .addComponent(new Label(
-                        "Table with column generators that format and calculate cell values."));
-        layout.addComponent(table);
-        layout.addComponent(editable);
-        layout.addComponent(new Label(
-                "Columns displayed in blue are calculated from Quantity and Total. "
-                        + "Others are simply formatted."));
-        layout.setExpandRatio(table, 1);
-        layout.setSizeUndefined();
-        setCompositionRoot(layout);
-        // setSizeFull();
-    }
-}
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/JavaScriptAPIExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/JavaScriptAPIExample.java
deleted file mode 100644 (file)
index 21e49ce..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/* \r
-@ITMillApache2LicenseForJavaFiles@\r
- */\r
-\r
-package com.vaadin.automatedtests.featurebrowser;\r
-\r
-import java.util.Date;\r
-\r
-import com.vaadin.terminal.PaintException;\r
-import com.vaadin.terminal.PaintTarget;\r
-import com.vaadin.ui.Alignment;\r
-import com.vaadin.ui.Button;\r
-import com.vaadin.ui.CustomComponent;\r
-import com.vaadin.ui.Label;\r
-import com.vaadin.ui.TextField;\r
-import com.vaadin.ui.VerticalLayout;\r
-import com.vaadin.ui.Button.ClickEvent;\r
-\r
-/**\r
- * An example using a RichTextArea to edit a Label in XHTML-mode.\r
- * \r
- */\r
-public class JavaScriptAPIExample extends CustomComponent {\r
-\r
-    public static final String txt = "<p>For advanced client side programmers Vaadin offers a simple method which can be used to force sync client with server. This may be needed for example if another part of a mashup changes things on server.</p> (more examples will be added here as the APIs are made public)<br/><br/><A href=\"javascript:vaadin.forceSync();\">javascript:vaadin.forceSync();</A>";\r
-\r
-    private final VerticalLayout main;\r
-    private final Label l;\r
-    private final TextField editor = new TextField();\r
-\r
-    public JavaScriptAPIExample() {\r
-        // main layout\r
-        main = new VerticalLayout();\r
-        main.setMargin(true);\r
-        setCompositionRoot(main);\r
-        editor.setRows(7);\r
-        editor.setColumns(50);\r
-        // Add the label\r
-        l = new Label(txt);\r
-        l.setContentMode(Label.CONTENT_XHTML);\r
-        main.addComponent(l);\r
-        // Edit button with inline click-listener\r
-        Button b = new Button("Edit", new Button.ClickListener() {\r
-            public void buttonClick(ClickEvent event) {\r
-                // swap Label <-> RichTextArea\r
-                if (main.getComponentIterator().next() == l) {\r
-                    editor.setValue(l.getValue());\r
-                    main.replaceComponent(l, editor);\r
-                    event.getButton().setCaption("Save");\r
-                } else {\r
-                    l.setValue(editor.getValue());\r
-                    main.replaceComponent(editor, l);\r
-                    event.getButton().setCaption("Edit");\r
-                }\r
-            }\r
-        });\r
-        main.addComponent(b);\r
-        main.setComponentAlignment(b, Alignment.MIDDLE_RIGHT);\r
-\r
-        // \r
-        Label l = new Label(\r
-                "This label will update it's server-side value AFTER it's rendered to the client-side. "\r
-                        + "The client will be synchronized on reload, when you click a button, "\r
-                        + "or when vaadin.forceSync() is called.") {\r
-\r
-            @Override\r
-            public void paintContent(PaintTarget target) throws PaintException {\r
-\r
-                super.paintContent(target);\r
-                Delay d = new Delay(this);\r
-                d.start();\r
-            }\r
-\r
-        };\r
-        main.addComponent(l);\r
-\r
-    }\r
-\r
-    private class Delay extends Thread {\r
-        Label label;\r
-\r
-        public Delay(Label l) {\r
-            label = l;\r
-        }\r
-\r
-        @Override\r
-        public void run() {\r
-            try {\r
-                Thread.sleep(500);\r
-                label.setValue(new Date().toString());\r
-            } catch (Exception e) {\r
-                e.printStackTrace();\r
-            }\r
-        }\r
-\r
-    }\r
-}\r
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/LabelExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/LabelExample.java
deleted file mode 100644 (file)
index 37b9468..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/* \r
-@ITMillApache2LicenseForJavaFiles@\r
- */\r
-\r
-package com.vaadin.automatedtests.featurebrowser;\r
-\r
-import com.vaadin.ui.CustomComponent;\r
-import com.vaadin.ui.GridLayout;\r
-import com.vaadin.ui.Label;\r
-import com.vaadin.ui.Panel;\r
-\r
-/**\r
- * Shows a few variations of Labels, including the effects of XHTML- and\r
- * pre-formatted mode.\r
- * \r
- * @author IT Mill Ltd.\r
- */\r
-public class LabelExample extends CustomComponent {\r
-\r
-    private static final String xhtml = "This text has <b>HTML</b> formatting.<br/>"\r
-            + "A plain <i>Label</i> will show the markup, while a <u>XHTML-mode</u>"\r
-            + " <i>Label</i> will show the formatted text.";\r
-\r
-    private static final String pre = "This text has linebreaks.\n\n"\r
-            + "They will show up in a preformatted Label,\n"\r
-            + "but not in a \"plain\" Label.\n\n"\r
-            + "       This is an indented row. \n       Same indentation here.";\r
-\r
-    public LabelExample() {\r
-        final GridLayout g = new GridLayout(2, 4);\r
-        g.setMargin(true);\r
-        setCompositionRoot(g);\r
-        g.setWidth("100%");\r
-\r
-        // plain w/o caption\r
-        Panel p = getExpamplePanel("Plain");\r
-        Label l = new Label("A plain label without caption.");\r
-        l.setDebugId("label1");\r
-        p.addComponent(l);\r
-        g.addComponent(p);\r
-        // plain w/ caption\r
-        p = getExpamplePanel("Plain w/ caption + tooltip");\r
-        l = new Label("A plain label with caption.");\r
-        l.setCaption("Label caption");\r
-        l.setDebugId("label2");\r
-        l.setDescription("This is a description (tooltip) for the label.");\r
-        p.addComponent(l);\r
-        g.addComponent(p);\r
-        // plain w/ xhtml\r
-        p = getExpamplePanel("Plain w/ XHTML content");\r
-        l = new Label(xhtml);\r
-        l.setDebugId("label3");\r
-        p.addComponent(l);\r
-        g.addComponent(p);\r
-        // xhtml w/ xhtml\r
-        p = getExpamplePanel("XHTML-mode w/ XHTML content");\r
-        l = new Label(xhtml);\r
-        l.setDebugId("label4");\r
-        l.setContentMode(Label.CONTENT_XHTML);\r
-        p.addComponent(l);\r
-        g.addComponent(p);\r
-        // plain w/ preformatted\r
-        p = getExpamplePanel("Plain w/ preformatted content");\r
-        l = new Label(pre);\r
-        l.setDebugId("label5");\r
-        p.addComponent(l);\r
-        g.addComponent(p);\r
-        // preformatted w/ preformatted\r
-        p = getExpamplePanel("Preformatted-mode w/ preformatted content");\r
-        l = new Label(pre);\r
-        l.setDebugId("label6");\r
-        l.setContentMode(Label.CONTENT_PREFORMATTED);\r
-        p.addComponent(l);\r
-        g.addComponent(p);\r
-\r
-    }\r
-\r
-    private Panel getExpamplePanel(String caption) {\r
-        Panel p = new Panel(caption);\r
-        p.setDebugId(p.getCaption());\r
-        p.addStyleName(Panel.STYLE_LIGHT);\r
-        return p;\r
-    }\r
-}\r
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/LayoutExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/LayoutExample.java
deleted file mode 100644 (file)
index d5a0773..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/* \r
-@ITMillApache2LicenseForJavaFiles@\r
- */\r
-\r
-package com.vaadin.automatedtests.featurebrowser;\r
-\r
-import com.vaadin.ui.CustomComponent;\r
-import com.vaadin.ui.GridLayout;\r
-import com.vaadin.ui.HorizontalLayout;\r
-import com.vaadin.ui.Label;\r
-import com.vaadin.ui.Panel;\r
-import com.vaadin.ui.TabSheet;\r
-import com.vaadin.ui.VerticalLayout;\r
-\r
-/**\r
- * A few examples of layout possibilities.\r
- * \r
- * @author IT Mill Ltd.\r
- */\r
-public class LayoutExample extends CustomComponent {\r
-\r
-    public LayoutExample() {\r
-\r
-        final VerticalLayout main = new VerticalLayout();\r
-        main.setMargin(true);\r
-        setCompositionRoot(main);\r
-\r
-        final GridLayout g = new GridLayout(2, 5);\r
-        g.setWidth("100%");\r
-        main.addComponent(g);\r
-\r
-        // panel\r
-        Panel p = new Panel("This is a normal panel");\r
-        p.setDebugId("NormalPanel");\r
-        Label l = new Label("A normal panel.");\r
-        p.addComponent(l);\r
-        g.addComponent(p);\r
-        // lightpanel\r
-        p = new Panel("This is a light panel");\r
-        p.setDebugId("LightPanel");\r
-        p.setStyleName(Panel.STYLE_LIGHT);\r
-        l = new Label("A light-style panel.");\r
-        p.addComponent(l);\r
-        g.addComponent(p);\r
-\r
-        TabSheet ts = new TabSheet();\r
-        g.addComponent(ts, 0, 1, 1, 1);\r
-\r
-        VerticalLayout ol = new VerticalLayout();\r
-        ol.setDebugId("VerticalOrderedLayout");\r
-        ol.setMargin(true);\r
-        ol.addComponent(new Label("Component 1"));\r
-        ol.addComponent(new Label("Component 2"));\r
-        ol.addComponent(new Label("Component 3"));\r
-        ts.addTab(ol, "Vertical OrderedLayout", null);\r
-\r
-        HorizontalLayout hl = new HorizontalLayout();\r
-        hl.setDebugId("HorizontalOrderedLayout");\r
-        hl.setMargin(true);\r
-        hl.addComponent(new Label("Component 1"));\r
-        hl.addComponent(new Label("Component 2"));\r
-        hl.addComponent(new Label("Component 3"));\r
-        ts.addTab(hl, "Horizontal OrderedLayout", null);\r
-\r
-        final GridLayout gl = new GridLayout(3, 3);\r
-        gl.setDebugId("GridLayout");\r
-        gl.setMargin(true);\r
-        gl.addComponent(new Label("Component 1.1"));\r
-        gl.addComponent(new Label("Component 1.2"));\r
-        gl.addComponent(new Label("Component 1.3"));\r
-        gl.addComponent(new Label("Component 2.2"), 1, 1);\r
-        gl.addComponent(new Label("Component 3.1"), 0, 2);\r
-        gl.addComponent(new Label("Component 3.3"), 2, 2);\r
-        ts.addTab(gl, "GridLayout", null);\r
-\r
-        /*- TODO spitpanel removed for now - do we need it here?\r
-        ts = new TabSheet();\r
-        ts.setHeight(150);\r
-        g.addComponent(ts, 0, 2, 1, 2);\r
-\r
-        SplitPanel sp = new SplitPanel();\r
-        sp.addComponent(new Label("Component 1"));\r
-        sp.addComponent(new Label("Component 2"));\r
-        ts.addTab(sp, "Vertical SplitPanel", null);\r
-\r
-        sp = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL);\r
-        sp.addComponent(new Label("Component 1"));\r
-        sp.addComponent(new Label("Component 2"));\r
-        ts.addTab(sp, "Horizontal SplitPanel", null);\r
-        -*/\r
-\r
-    }\r
-}\r
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/NotificationExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/NotificationExample.java
deleted file mode 100644 (file)
index f3d46a7..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/* 
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.automatedtests.featurebrowser;
-
-import com.vaadin.data.Item;
-import com.vaadin.ui.AbstractSelect;
-import com.vaadin.ui.Alignment;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.NativeSelect;
-import com.vaadin.ui.RichTextArea;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
-
-/**
- * Demonstrates the use of Notifications.
- * 
- * @author IT Mill Ltd.
- * @see com.vaadin.ui.Window
- */
-public class NotificationExample extends CustomComponent {
-
-    // Dropdown select for notification type, using the native dropdown
-    NativeSelect type;
-    // Textfield for the notification caption
-    TextField caption;
-    // Textfield for the notification content
-    TextField message;
-
-    /**
-     * Default constructor; We're subclassing CustomComponent, so we need to
-     * choose a root component and set it as composition root.
-     */
-    public NotificationExample() {
-        // Main layout
-        final VerticalLayout main = new VerticalLayout();
-        main.setSizeUndefined();
-        main.setSpacing(true);
-        main.setMargin(true); // use theme-specific margin
-        setCompositionRoot(main);
-
-        // Create the 'type' dropdown select.
-        type = new NativeSelect("Notification type");
-        main.addComponent(type);
-        // no empty selection allowed
-        type.setNullSelectionAllowed(false);
-        // we want a different caption than the value
-        type.addContainerProperty("caption", String.class, null);
-        type.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
-        type.setItemCaptionPropertyId("caption");
-        // add some content (items) using the Container API
-        Item i = type.addItem(new Integer(
-                Window.Notification.TYPE_HUMANIZED_MESSAGE));
-        i.getItemProperty("caption").setValue("Humanized message");
-        i = type.addItem(new Integer(Window.Notification.TYPE_WARNING_MESSAGE));
-        i.getItemProperty("caption").setValue("Warning message");
-        i = type.addItem(new Integer(Window.Notification.TYPE_ERROR_MESSAGE));
-        i.getItemProperty("caption").setValue("Error message");
-        i = type
-                .addItem(new Integer(Window.Notification.TYPE_TRAY_NOTIFICATION));
-        i.getItemProperty("caption").setValue("Tray notification");
-        // set the initially selected item
-        type.setValue(new Integer(Window.Notification.TYPE_HUMANIZED_MESSAGE));
-
-        // Notification caption
-        caption = new TextField("Caption");
-        main.addComponent(caption);
-        caption.setColumns(20);
-        caption.setValue("Brown Fox!");
-
-        // Notification message
-        message = new RichTextArea();
-        main.addComponent(message);
-        message.setCaption("Message");
-        message.setValue("A quick one jumped over the lazy dog.");
-
-        // Button to show the notification
-        final Button b = new Button("Show notification", new ClickListener() {
-            // this is an inline ClickListener
-            public void buttonClick(ClickEvent event) {
-                // show the notification
-                getWindow().showNotification((String) caption.getValue(),
-                        (String) message.getValue(),
-                        ((Integer) type.getValue()).intValue());
-            }
-        });
-        main.addComponent(b);
-        main.setComponentAlignment(b, Alignment.MIDDLE_RIGHT);
-    }
-}
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/RichTextExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/RichTextExample.java
deleted file mode 100644 (file)
index 84c16e3..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/* \r
-@ITMillApache2LicenseForJavaFiles@\r
- */\r
-\r
-package com.vaadin.automatedtests.featurebrowser;\r
-\r
-import com.vaadin.ui.Alignment;\r
-import com.vaadin.ui.Button;\r
-import com.vaadin.ui.CustomComponent;\r
-import com.vaadin.ui.Label;\r
-import com.vaadin.ui.RichTextArea;\r
-import com.vaadin.ui.VerticalLayout;\r
-import com.vaadin.ui.Button.ClickEvent;\r
-\r
-/**\r
- * An example using a RichTextArea to edit a Label in XHTML-mode.\r
- * \r
- */\r
-public class RichTextExample extends CustomComponent {\r
-\r
-    public static final String txt = "<h1>RichText editor example</h1>"\r
-            + "To edit this text, press the <b>Edit</b> button below."\r
-            + "<br/>"\r
-            + "See the <A href=\"http://www.vaadin.com/book\">Book of Vaadin</a> "\r
-            + "for more information.";\r
-\r
-    private final VerticalLayout main;\r
-    private final Label l;\r
-    private final RichTextArea editor = new RichTextArea();\r
-    private final Button b;\r
-\r
-    public RichTextExample() {\r
-        // main layout\r
-        main = new VerticalLayout();\r
-        main.setMargin(true);\r
-        setCompositionRoot(main);\r
-\r
-        editor.setWidth("100%");\r
-\r
-        // Add the label\r
-        l = new Label(txt);\r
-        l.setContentMode(Label.CONTENT_XHTML);\r
-        main.addComponent(l);\r
-        // Edit button with inline click-listener\r
-        b = new Button("Edit", new Button.ClickListener() {\r
-            public void buttonClick(ClickEvent event) {\r
-                // swap Label <-> RichTextArea\r
-                if (main.getComponentIterator().next() == l) {\r
-                    editor.setValue(l.getValue());\r
-                    main.replaceComponent(l, editor);\r
-                    b.setCaption("Save");\r
-                } else {\r
-                    l.setValue(editor.getValue());\r
-                    main.replaceComponent(editor, l);\r
-                    b.setCaption("Edit");\r
-                }\r
-            }\r
-        });\r
-        main.addComponent(b);\r
-        main.setComponentAlignment(b, Alignment.MIDDLE_RIGHT);\r
-    }\r
-\r
-}\r
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/SelectExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/SelectExample.java
deleted file mode 100644 (file)
index ab6711e..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/* \r
-@ITMillApache2LicenseForJavaFiles@\r
- */\r
-\r
-package com.vaadin.automatedtests.featurebrowser;\r
-\r
-import com.vaadin.data.Property.ValueChangeEvent;\r
-import com.vaadin.ui.AbstractSelect;\r
-import com.vaadin.ui.ComboBox;\r
-import com.vaadin.ui.CustomComponent;\r
-import com.vaadin.ui.Field;\r
-import com.vaadin.ui.HorizontalLayout;\r
-import com.vaadin.ui.ListSelect;\r
-import com.vaadin.ui.NativeSelect;\r
-import com.vaadin.ui.OptionGroup;\r
-import com.vaadin.ui.Panel;\r
-import com.vaadin.ui.TwinColSelect;\r
-import com.vaadin.ui.VerticalLayout;\r
-\r
-/**\r
- * Shows some basic fields for value input; TextField, DateField, Slider...\r
- * \r
- * @author IT Mill Ltd.\r
- */\r
-public class SelectExample extends CustomComponent {\r
-\r
-    // listener that shows a value change notification\r
-    private final Field.ValueChangeListener listener = new Field.ValueChangeListener() {\r
-        public void valueChange(ValueChangeEvent event) {\r
-            getWindow().showNotification("" + event.getProperty().getValue());\r
-        }\r
-    };\r
-\r
-    public SelectExample() {\r
-        final VerticalLayout main = new VerticalLayout();\r
-        main.setMargin(true);\r
-        setCompositionRoot(main);\r
-\r
-        final HorizontalLayout horiz = new HorizontalLayout();\r
-        horiz.setWidth("100%");\r
-        main.addComponent(horiz);\r
-        final Panel single = new Panel("Single selects");\r
-        single.setStyleName(Panel.STYLE_LIGHT);\r
-        horiz.addComponent(single);\r
-        final Panel multi = new Panel("Multi selects");\r
-        multi.setStyleName(Panel.STYLE_LIGHT);\r
-        horiz.addComponent(multi);\r
-\r
-        // radio button group\r
-        AbstractSelect sel = new OptionGroup("OptionGroup");\r
-        sel.setDebugId("RadioButtons");\r
-        initSelect(sel);\r
-        single.addComponent(sel);\r
-        // checkbox group\r
-        sel = new OptionGroup("OptionGroup");\r
-        sel.setDebugId("OptionGroup");\r
-        sel.setMultiSelect(true); // TODO: throws if set after listener - why?\r
-        initSelect(sel);\r
-        multi.addComponent(sel);\r
-        // single-select list\r
-        sel = new ListSelect("ListSelect");\r
-        sel.setDebugId("SingleListSelect");\r
-        ((ListSelect) sel).setColumns(15);\r
-        initSelect(sel);\r
-        single.addComponent(sel);\r
-        // multi-select list\r
-        sel = new ListSelect("ListSelect");\r
-        sel.setDebugId("MultiListSelect");\r
-        ((ListSelect) sel).setColumns(15);\r
-        sel.setMultiSelect(true);\r
-        initSelect(sel);\r
-        multi.addComponent(sel);\r
-        // native-style dropdows\r
-        sel = new NativeSelect("NativeSelect");\r
-        sel.setDebugId("NativeSelect");\r
-        ((NativeSelect) sel).setColumns(15);\r
-        initSelect(sel);\r
-        single.addComponent(sel);\r
-        // combobox\r
-        sel = new ComboBox("ComboBox");\r
-        sel.setDebugId("ComboBox");\r
-        ((ComboBox) sel).setColumns(15);\r
-        initSelect(sel);\r
-        single.addComponent(sel);\r
-        // "twin column" select\r
-        sel = new TwinColSelect("TwinColSelect");\r
-        sel.setDebugId("TwinColSelect");\r
-        ((TwinColSelect) sel).setColumns(15);\r
-        initSelect(sel);\r
-        multi.addComponent(sel);\r
-    }\r
-\r
-    /*\r
-     * Initialize select with some values, make immediate and add listener.\r
-     */\r
-    private void initSelect(AbstractSelect sel) {\r
-        for (int i = 1; i <= 5; i++) {\r
-            sel.addItem("Item " + i);\r
-        }\r
-        // select one item\r
-        sel.select("Item 1");\r
-\r
-        // make immediate, add listener\r
-        sel.setImmediate(true);\r
-        sel.addListener(listener);\r
-    }\r
-\r
-}\r
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/TableExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/TableExample.java
deleted file mode 100644 (file)
index b1b4fcc..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-/* \r
-@ITMillApache2LicenseForJavaFiles@\r
- */\r
-\r
-package com.vaadin.automatedtests.featurebrowser;\r
-\r
-import java.util.Iterator;\r
-import java.util.Random;\r
-import java.util.Set;\r
-\r
-import com.vaadin.data.Item;\r
-import com.vaadin.data.Property;\r
-import com.vaadin.event.Action;\r
-import com.vaadin.ui.Button;\r
-import com.vaadin.ui.CheckBox;\r
-import com.vaadin.ui.CustomComponent;\r
-import com.vaadin.ui.HorizontalLayout;\r
-import com.vaadin.ui.TabSheet;\r
-import com.vaadin.ui.Table;\r
-import com.vaadin.ui.VerticalLayout;\r
-import com.vaadin.ui.Button.ClickEvent;\r
-\r
-/**\r
- * Table example.\r
- * \r
- * @author IT Mill Ltd.\r
- */\r
-public class TableExample extends CustomComponent implements Action.Handler,\r
-        Button.ClickListener {\r
-\r
-    // Actions\r
-    private static final Action ACTION_SAVE = new Action("Save");\r
-    private static final Action ACTION_DELETE = new Action("Delete");\r
-    private static final Action ACTION_HIRE = new Action("Hire");\r
-    // Action sets\r
-    private static final Action[] ACTIONS_NOHIRE = new Action[] { ACTION_SAVE,\r
-            ACTION_DELETE };\r
-    private static final Action[] ACTIONS_HIRE = new Action[] { ACTION_HIRE,\r
-            ACTION_SAVE, ACTION_DELETE };\r
-    // Properties\r
-    private static final Object PROPERTY_SPECIES = "Species";\r
-    private static final Object PROPERTY_TYPE = "Type";\r
-    private static final Object PROPERTY_KIND = "Kind";\r
-    private static final Object PROPERTY_HIRED = "Hired";\r
-\r
-    // "global" components\r
-    Table source;\r
-    Table saved;\r
-    Button saveSelected;\r
-    Button hireSelected;\r
-    Button deleteSelected;\r
-    Button deselect;\r
-\r
-    public TableExample() {\r
-        VerticalLayout margin = new VerticalLayout();\r
-        margin.setMargin(true);\r
-\r
-        TabSheet root = new TabSheet();\r
-        setCompositionRoot(margin);\r
-        margin.addComponent(root);\r
-\r
-        // main layout\r
-        final VerticalLayout main = new VerticalLayout();\r
-        root.addComponent(main);\r
-        main.setCaption("Basic Table");\r
-        main.setMargin(true);\r
-\r
-        // "source" table with bells & whistlesenabled\r
-        source = new Table("All creatures");\r
-        source.setPageLength(7);\r
-        source.setWidth("550px");\r
-        source.setColumnCollapsingAllowed(true);\r
-        source.setColumnReorderingAllowed(true);\r
-        source.setSelectable(true);\r
-        source.setMultiSelect(true);\r
-        source.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);\r
-        fillTable(source);\r
-        source.addActionHandler(this);\r
-        main.addComponent(source);\r
-        source.setDebugId("AllCreatures");\r
-\r
-        // x-selected button row\r
-        final HorizontalLayout horiz = new HorizontalLayout();\r
-\r
-        horiz.setMargin(false, false, true, false);\r
-        main.addComponent(horiz);\r
-        saveSelected = new Button("Save selected");\r
-        saveSelected.setStyleName(Button.STYLE_LINK);\r
-        saveSelected.addListener(this);\r
-        horiz.addComponent(saveSelected);\r
-        hireSelected = new Button("Hire selected");\r
-        hireSelected.setStyleName(Button.STYLE_LINK);\r
-        hireSelected.addListener(this);\r
-        horiz.addComponent(hireSelected);\r
-        deleteSelected = new Button("Delete selected");\r
-        deleteSelected.setStyleName(Button.STYLE_LINK);\r
-        deleteSelected.addListener(this);\r
-        horiz.addComponent(deleteSelected);\r
-        deselect = new Button("Deselect all");\r
-        deselect.setStyleName(Button.STYLE_LINK);\r
-        deselect.addListener(this);\r
-        horiz.addComponent(deselect);\r
-        final CheckBox editmode = new CheckBox("Editmode ");\r
-        editmode.setDebugId("editMode");\r
-        editmode.addListener(new CheckBox.ClickListener() {\r
-            public void buttonClick(ClickEvent event) {\r
-                source.setEditable(((Boolean) event.getButton().getValue())\r
-                        .booleanValue());\r
-            }\r
-        });\r
-        editmode.setImmediate(true);\r
-        horiz.addComponent(editmode);\r
-\r
-        // "saved" table, minimalistic\r
-        saved = new Table("Saved creatures");\r
-        saved.setPageLength(5);\r
-        saved.setWidth("550px");\r
-        saved.setSelectable(false);\r
-        saved.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);\r
-        saved.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);\r
-        initProperties(saved);\r
-        saved.addActionHandler(this);\r
-        main.addComponent(saved);\r
-        saved.setDebugId("SavedCreatures");\r
-\r
-        final CheckBox b = new CheckBox("Modify saved creatures");\r
-        b.setDebugId("modifySavedCreatures");\r
-        b.addListener(new CheckBox.ClickListener() {\r
-            public void buttonClick(ClickEvent event) {\r
-                saved.setEditable(((Boolean) event.getButton().getValue())\r
-                        .booleanValue());\r
-            }\r
-        });\r
-        b.setImmediate(true);\r
-        main.addComponent(b);\r
-\r
-        GeneratedColumnExample gencols = new GeneratedColumnExample();\r
-        gencols.setCaption("Generated Columns");\r
-        root.addComponent(gencols);\r
-    }\r
-\r
-    // set up the properties (columns)\r
-    private void initProperties(Table table) {\r
-        table.addContainerProperty(PROPERTY_SPECIES, String.class, "");\r
-        table.addContainerProperty(PROPERTY_TYPE, String.class, "");\r
-        table.addContainerProperty(PROPERTY_KIND, String.class, "");\r
-        table\r
-                .addContainerProperty(PROPERTY_HIRED, Boolean.class,\r
-                        Boolean.FALSE);\r
-    }\r
-\r
-    // fill the table with some random data\r
-    private void fillTable(Table table) {\r
-        initProperties(table);\r
-\r
-        final String[] sp = new String[] { "Fox", "Dog", "Cat", "Moose",\r
-                "Penguin", "Cow" };\r
-        final String[] ty = new String[] { "Quick", "Lazy", "Sleepy",\r
-                "Fidgety", "Crazy", "Kewl" };\r
-        final String[] ki = new String[] { "Jumping", "Walking", "Sleeping",\r
-                "Skipping", "Dancing" };\r
-\r
-        Random r = new Random(5);\r
-\r
-        for (int i = 0; i < 100; i++) {\r
-            final String s = sp[(int) (r.nextDouble() * sp.length)];\r
-            final String t = ty[(int) (r.nextDouble() * ty.length)];\r
-            final String k = ki[(int) (r.nextDouble() * ki.length)];\r
-            table.addItem(new Object[] { s, t, k, Boolean.FALSE }, new Integer(\r
-                    i));\r
-        }\r
-\r
-    }\r
-\r
-    // Called for each item (row), returns valid actions for that item\r
-    public Action[] getActions(Object target, Object sender) {\r
-        if (sender == source) {\r
-            final Item item = source.getItem(target);\r
-            // save, delete, and hire if not already hired\r
-            if (item != null\r
-                    && item.getItemProperty(PROPERTY_HIRED).getValue() == Boolean.FALSE) {\r
-                return ACTIONS_HIRE;\r
-            } else {\r
-                return ACTIONS_NOHIRE;\r
-            }\r
-        } else {\r
-            // "saved" table only has one action\r
-            return new Action[] { ACTION_DELETE };\r
-        }\r
-    }\r
-\r
-    // called when an action is invoked on an item (row)\r
-    public void handleAction(Action action, Object sender, Object target) {\r
-        if (sender == source) {\r
-            Item item = source.getItem(target);\r
-            if (action == ACTION_HIRE) {\r
-                // set HIRED property to true\r
-                item.getItemProperty(PROPERTY_HIRED).setValue(Boolean.TRUE);\r
-                if (saved.containsId(target)) {\r
-                    item = saved.getItem(target);\r
-                    item.getItemProperty(PROPERTY_HIRED).setValue(Boolean.TRUE);\r
-                }\r
-                getWindow().showNotification("Hired", "" + item);\r
-\r
-            } else if (action == ACTION_SAVE) {\r
-                if (saved.containsId(target)) {\r
-                    // let's not save twice\r
-                    getWindow().showNotification("Already saved", "" + item);\r
-                    return;\r
-                }\r
-                // "manual" copy of the item properties we want\r
-                final Item added = saved.addItem(target);\r
-                Property p = added.getItemProperty(PROPERTY_SPECIES);\r
-                p.setValue(item.getItemProperty(PROPERTY_SPECIES).getValue());\r
-                p = added.getItemProperty(PROPERTY_TYPE);\r
-                p.setValue(item.getItemProperty(PROPERTY_TYPE).getValue());\r
-                p = added.getItemProperty(PROPERTY_KIND);\r
-                p.setValue(item.getItemProperty(PROPERTY_KIND).getValue());\r
-                p = added.getItemProperty(PROPERTY_HIRED);\r
-                p.setValue(item.getItemProperty(PROPERTY_HIRED).getValue());\r
-                getWindow().showNotification("Saved", "" + item);\r
-            } else {\r
-                // ACTION_DELETE\r
-                getWindow().showNotification("Deleted ", "" + item);\r
-                source.removeItem(target);\r
-            }\r
-\r
-        } else {\r
-            // sender==saved\r
-            if (action == ACTION_DELETE) {\r
-                final Item item = saved.getItem(target);\r
-                getWindow().showNotification("Deleted", "" + item);\r
-                saved.removeItem(target);\r
-            }\r
-        }\r
-    }\r
-\r
-    public void buttonClick(ClickEvent event) {\r
-        final Button b = event.getButton();\r
-        if (b == deselect) {\r
-            source.setValue(null);\r
-        } else if (b == saveSelected) {\r
-            // loop each selected and copy to "saved" table\r
-            final Set selected = (Set) source.getValue();\r
-            int s = 0;\r
-            for (final Iterator it = selected.iterator(); it.hasNext();) {\r
-                final Object id = it.next();\r
-                if (!saved.containsId(id)) {\r
-                    final Item item = source.getItem(id);\r
-                    final Item added = saved.addItem(id);\r
-                    // "manual" copy of the properties we want\r
-                    Property p = added.getItemProperty(PROPERTY_SPECIES);\r
-                    p.setValue(item.getItemProperty(PROPERTY_SPECIES)\r
-                            .getValue());\r
-                    p = added.getItemProperty(PROPERTY_TYPE);\r
-                    p.setValue(item.getItemProperty(PROPERTY_TYPE).getValue());\r
-                    p = added.getItemProperty(PROPERTY_KIND);\r
-                    p.setValue(item.getItemProperty(PROPERTY_KIND).getValue());\r
-                    p = added.getItemProperty(PROPERTY_HIRED);\r
-                    p.setValue(item.getItemProperty(PROPERTY_HIRED).getValue());\r
-                    s++;\r
-                }\r
-            }\r
-            getWindow().showNotification("Saved " + s);\r
-\r
-        } else if (b == hireSelected) {\r
-            // loop each selected and set property HIRED to true\r
-            int s = 0;\r
-            final Set selected = (Set) source.getValue();\r
-            for (final Iterator it = selected.iterator(); it.hasNext();) {\r
-                final Object id = it.next();\r
-                Item item = source.getItem(id);\r
-                final Property p = item.getItemProperty(PROPERTY_HIRED);\r
-                if (p.getValue() == Boolean.FALSE) {\r
-                    p.setValue(Boolean.TRUE);\r
-                    s++;\r
-                }\r
-                if (saved.containsId(id)) {\r
-                    // also update "saved" table\r
-                    item = saved.getItem(id);\r
-                    item.getItemProperty(PROPERTY_HIRED).setValue(Boolean.TRUE);\r
-                }\r
-            }\r
-            getWindow().showNotification("Hired " + s);\r
-\r
-        } else {\r
-            // loop trough selected and delete\r
-            int s = 0;\r
-            final Set selected = (Set) source.getValue();\r
-            for (final Iterator it = selected.iterator(); it.hasNext();) {\r
-                final Object id = it.next();\r
-                if (source.containsId(id)) {\r
-                    s++;\r
-                    source.removeItem(id);\r
-                }\r
-            }\r
-            getWindow().showNotification("Deleted " + s);\r
-        }\r
-\r
-    }\r
-\r
-}\r
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/TreeExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/TreeExample.java
deleted file mode 100644 (file)
index cf5a6a7..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-/* 
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.automatedtests.featurebrowser;
-
-import com.vaadin.data.Item;
-import com.vaadin.data.Property;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.event.Action;
-import com.vaadin.ui.AbstractSelect;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.Tree;
-
-/**
- * Demonstrates basic Tree -functionality. Actions are used for add/remove item
- * functionality, and a ValueChangeListener reacts to both the Tree and the
- * TextField.
- */
-public class TreeExample extends CustomComponent implements Action.Handler,
-        Tree.ValueChangeListener {
-
-    private static final Action ADD = new Action("Add item");
-    private static final Action DELETE = new Action("Delete item");
-    private static final Action[] actions = new Action[] { ADD, DELETE };
-
-    // Id for the caption property
-    private static final Object CAPTION_PROPERTY = "caption";
-
-    private static final String desc = "Try both right- and left-click!";
-
-    Tree tree;
-    TextField editor;
-
-    public TreeExample() {
-        final HorizontalLayout main = new HorizontalLayout();
-        main.setWidth("100%");
-        main.setDebugId("mainLayout");
-        main.setMargin(true);
-        setCompositionRoot(main);
-
-        // Panel w/ Tree
-        Panel p = new Panel("Select item");
-        p.setStyleName(Panel.STYLE_LIGHT);
-        p.setWidth("250px");
-        // Description
-        p.addComponent(new Label(desc));
-        // Tree with a few items
-        tree = new Tree();
-        tree.setDebugId("tree");
-        tree.setImmediate(true);
-        // we'll use a property for caption instead of the item id ("value"),
-        // so that multiple items can have the same caption
-        tree.addContainerProperty(CAPTION_PROPERTY, String.class, "");
-        tree.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
-        tree.setItemCaptionPropertyId(CAPTION_PROPERTY);
-        for (int i = 1; i <= 3; i++) {
-            final Object id = addCaptionedItem("Section " + i, null);
-            tree.expandItem(id);
-            addCaptionedItem("Team A", id);
-            addCaptionedItem("Team B", id);
-        }
-        // listen for selections
-        tree.addListener(this);
-        // "context menu"
-        tree.addActionHandler(this);
-        p.addComponent(tree);
-        main.addComponent(p);
-
-        // Panel w/ TextField ("editor")
-        p = new Panel("Edit item caption");
-        p.setStyleName(Panel.STYLE_LIGHT);
-        editor = new TextField();
-        // make immediate, instead of adding an "apply" button
-        editor.setImmediate(true);
-        editor.setEnabled(false);
-        editor.setColumns(15);
-        p.addComponent(editor);
-        main.addComponent(p);
-        main.setExpandRatio(p, 1);
-    }
-
-    public Action[] getActions(Object target, Object sender) {
-        // We can provide different actions for each target (item), but we'll
-        // use the same actions all the time.
-        return actions;
-    }
-
-    public void handleAction(Action action, Object sender, Object target) {
-        if (action == DELETE) {
-            tree.removeItem(target);
-        } else {
-            // Add
-            final Object id = addCaptionedItem("New Item", target);
-            tree.expandItem(target);
-            tree.setValue(id);
-            editor.focus();
-        }
-    }
-
-    public void valueChange(ValueChangeEvent event) {
-        final Object id = tree.getValue(); // selected item id
-        if (event.getProperty() == tree) {
-            // a Tree item was (un) selected
-            if (id == null) {
-                // no selecteion, disable TextField
-                editor.removeListener(this);
-                editor.setValue("");
-                editor.setEnabled(false);
-            } else {
-                // item selected
-                // first remove previous listener
-                editor.removeListener(this);
-                // enable TextField and update value
-                editor.setEnabled(true);
-                final Item item = tree.getItem(id);
-                editor.setValue(item.getItemProperty(CAPTION_PROPERTY)
-                        .getValue());
-                // listen for TextField changes
-                editor.addListener(this);
-                editor.focus();
-            }
-        } else {
-            // TextField
-            if (id != null) {
-                final Item item = tree.getItem(id);
-                final Property p = item.getItemProperty(CAPTION_PROPERTY);
-                p.setValue(editor.getValue());
-                tree.requestRepaint();
-            }
-
-        }
-    }
-
-    /**
-     * Helper to add an item with specified caption and (optional) parent.
-     * 
-     * @param caption
-     *            The item caption
-     * @param parent
-     *            The (optional) parent item id
-     * @return the created item's id
-     */
-    private Object addCaptionedItem(String caption, Object parent) {
-        // add item, let tree decide id
-        final Object id = tree.addItem();
-        // get the created item
-        final Item item = tree.getItem(id);
-        // set our "caption" property
-        final Property p = item.getItemProperty(CAPTION_PROPERTY);
-        p.setValue(caption);
-        if (parent != null) {
-            tree.setChildrenAllowed(parent, true);
-            tree.setParent(id, parent);
-            tree.setChildrenAllowed(id, false);
-        }
-        return id;
-    }
-
-}
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/ValueInputExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/ValueInputExample.java
deleted file mode 100644 (file)
index 14415d3..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-/* \r
-@ITMillApache2LicenseForJavaFiles@\r
- */\r
-\r
-package com.vaadin.automatedtests.featurebrowser;\r
-\r
-import java.util.Date;\r
-\r
-import com.vaadin.data.Property.ValueChangeEvent;\r
-import com.vaadin.ui.CustomComponent;\r
-import com.vaadin.ui.DateField;\r
-import com.vaadin.ui.Field;\r
-import com.vaadin.ui.HorizontalLayout;\r
-import com.vaadin.ui.InlineDateField;\r
-import com.vaadin.ui.Panel;\r
-import com.vaadin.ui.Slider;\r
-import com.vaadin.ui.TextField;\r
-import com.vaadin.ui.VerticalLayout;\r
-import com.vaadin.ui.Window.Notification;\r
-\r
-/**\r
- * Shows some basic fields for value input; TextField, DateField, Slider...\r
- * \r
- * @author IT Mill Ltd.\r
- */\r
-public class ValueInputExample extends CustomComponent {\r
-\r
-    @SuppressWarnings("deprecation")\r
-    public ValueInputExample() {\r
-        final VerticalLayout main = new VerticalLayout();\r
-        main.setMargin(true);\r
-        setCompositionRoot(main);\r
-\r
-        // listener that shows a value change notification\r
-        final Field.ValueChangeListener listener = new Field.ValueChangeListener() {\r
-            public void valueChange(ValueChangeEvent event) {\r
-                getWindow().showNotification("Received",\r
-                        "<pre>" + event.getProperty().getValue() + "</pre>",\r
-                        Notification.TYPE_WARNING_MESSAGE);\r
-            }\r
-        };\r
-\r
-        // TextField\r
-        HorizontalLayout horiz = new HorizontalLayout();\r
-        horiz.setWidth("100%");\r
-        main.addComponent(horiz);\r
-        Panel left = new Panel("TextField");\r
-        left.setStyleName(Panel.STYLE_LIGHT);\r
-        horiz.addComponent(left);\r
-        Panel right = new Panel("multiline");\r
-        right.setStyleName(Panel.STYLE_LIGHT);\r
-        horiz.addComponent(right);\r
-        // basic TextField\r
-        TextField tf = new TextField("Basic");\r
-        tf.setDebugId("BasicTextField");\r
-        tf.setColumns(15);\r
-        tf.setImmediate(true);\r
-        tf.addListener(listener);\r
-        left.addComponent(tf);\r
-        // multiline TextField a.k.a TextArea\r
-        tf = new TextField("Area");\r
-        tf.setDebugId("AreaTextField");\r
-        tf.setColumns(15);\r
-        tf.setRows(5);\r
-        tf.setImmediate(true);\r
-        tf.addListener(listener);\r
-        right.addComponent(tf);\r
-\r
-        // DateFields\r
-        Date d = new Date(98, 1, 22, 13, 14, 15);\r
-        horiz = new HorizontalLayout();\r
-        horiz.setWidth("100%");\r
-        main.addComponent(horiz);\r
-        left = new Panel("DateField");\r
-        left.setStyleName(Panel.STYLE_LIGHT);\r
-        horiz.addComponent(left);\r
-        right = new Panel("inline");\r
-        right.setStyleName(Panel.STYLE_LIGHT);\r
-        horiz.addComponent(right);\r
-        // default\r
-        DateField df = new DateField("Day resolution");\r
-        df.setDebugId("DayResolutionDateField");\r
-        df.setValue(d);\r
-        df.addListener(listener);\r
-        df.setImmediate(true);\r
-        df.setResolution(DateField.RESOLUTION_DAY);\r
-        left.addComponent(df);\r
-        // minute\r
-        df = new DateField("Minute resolution");\r
-        df.setValue(d);\r
-        df.setDebugId("MinuteResolutionDateField");\r
-        df.addListener(listener);\r
-        df.setImmediate(true);\r
-        df.setResolution(DateField.RESOLUTION_MIN);\r
-        left.addComponent(df);\r
-        // year\r
-        df = new DateField("Year resolution");\r
-        df.setValue(d);\r
-        df.setDebugId("YearResolutionDateField");\r
-        df.addListener(listener);\r
-        df.setImmediate(true);\r
-        df.setResolution(DateField.RESOLUTION_YEAR);\r
-        left.addComponent(df);\r
-        // msec\r
-        df = new DateField("Millisecond resolution");\r
-        df.setValue(d);\r
-        df.setDebugId("MillisecondResolutionDateField");\r
-        df.addListener(listener);\r
-        df.setImmediate(true);\r
-        df.setResolution(DateField.RESOLUTION_MSEC);\r
-        left.addComponent(df);\r
-        // Inline\r
-        df = new InlineDateField();\r
-        df.setValue(d);\r
-        df.setDebugId("InlineDateField");\r
-        df.addListener(listener);\r
-        df.setImmediate(true);\r
-        right.addComponent(df);\r
-\r
-        // Slider\r
-        left = new Panel("Slider");\r
-        left.setStyleName(Panel.STYLE_LIGHT);\r
-        main.addComponent(left);\r
-        // int slider\r
-        Slider slider = new Slider(0, 100);\r
-        slider.setDebugId("Slider1");\r
-        slider.setWidth("300px");\r
-        slider.setImmediate(true);\r
-        slider.addListener(new Slider.ValueChangeListener() {\r
-            public void valueChange(ValueChangeEvent event) {\r
-                // update caption when value changes\r
-                final Slider s = (Slider) event.getProperty();\r
-                s.setCaption("Value: " + s.getValue());\r
-            }\r
-        });\r
-        try {\r
-            slider.setValue(20);\r
-        } catch (final Exception e) {\r
-            e.printStackTrace(System.err);\r
-        }\r
-        left.addComponent(slider);\r
-        // double slider\r
-        slider = new Slider(0.0, 1.0, 1);\r
-        slider.setOrientation(Slider.ORIENTATION_VERTICAL);\r
-        slider.setDebugId("Slider2");\r
-        slider.setImmediate(true);\r
-        slider.addListener(new Slider.ValueChangeListener() {\r
-            public void valueChange(ValueChangeEvent event) {\r
-                // update caption when value changes\r
-                final Slider s = (Slider) event.getProperty();\r
-                s.setCaption("Value: " + s.getValue());\r
-            }\r
-        });\r
-        try {\r
-            slider.setValue(0.5);\r
-        } catch (final Exception e) {\r
-            e.printStackTrace(System.err);\r
-        }\r
-        left.addComponent(slider);\r
-\r
-    }\r
-\r
-}\r
diff --git a/tests/src/com/vaadin/automatedtests/featurebrowser/WindowingExample.java b/tests/src/com/vaadin/automatedtests/featurebrowser/WindowingExample.java
deleted file mode 100644 (file)
index 488d337..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/* \r
-@ITMillApache2LicenseForJavaFiles@\r
- */\r
-\r
-package com.vaadin.automatedtests.featurebrowser;\r
-\r
-import java.net.URL;\r
-\r
-import com.vaadin.terminal.ExternalResource;\r
-import com.vaadin.ui.Button;\r
-import com.vaadin.ui.CustomComponent;\r
-import com.vaadin.ui.Label;\r
-import com.vaadin.ui.VerticalLayout;\r
-import com.vaadin.ui.Window;\r
-import com.vaadin.ui.Button.ClickEvent;\r
-\r
-/**\r
- * @author marc\r
- * \r
- */\r
-public class WindowingExample extends CustomComponent {\r
-\r
-    public static final String txt = "<p>There are two main types of windows: application-level windows, and "\r
-            + "\"sub windows\".</p><p>A sub window is rendered as a \"inline\" popup window"\r
-            + " within the (native) browser window to which it was added. You can create"\r
-            + " a sub window by creating a new Window and adding it to a application-level window, for instance"\r
-            + " your main window. </p><p> In contrast, you create a application-level window by"\r
-            + " creating a new Window and adding it to the Application. Application-level"\r
-            + " windows are not shown by default - you need to open a browser window for"\r
-            + " the url representing the window. You can think of the application-level"\r
-            + " windows as separate views into your application - and a way to create a"\r
-            + " \"native\" browser window.</p><p>Depending on your needs, it's also"\r
-            + " possible to create a new window instance (with it's own internal state)"\r
-            + " for each new (native) browser window, or you can share the same instance"\r
-            + " (and state) between several browser windows (the latter is most useful"\r
-            + " for read-only views).</p>";\r
-\r
-    private URL windowUrl = null;\r
-\r
-    public WindowingExample() {\r
-        final VerticalLayout main = new VerticalLayout();\r
-        main.setMargin(true);\r
-        setCompositionRoot(main);\r
-\r
-        final Label l = new Label(txt);\r
-        l.setContentMode(Label.CONTENT_XHTML);\r
-        main.addComponent(l);\r
-\r
-        Button b = new Button("Create a new subwindow",\r
-                new Button.ClickListener() {\r
-                    public void buttonClick(ClickEvent event) {\r
-                        final Window w = new Window("Subwindow");\r
-                        w.setWidth("50%");\r
-                        final Label l = new Label(txt);\r
-                        l.setContentMode(Label.CONTENT_XHTML);\r
-                        w.addComponent(l);\r
-                        getApplication().getMainWindow().addWindow(w);\r
-                    }\r
-                });\r
-        b.setStyleName(Button.STYLE_LINK);\r
-        main.addComponent(b);\r
-        b = new Button("Create a new modal window", new Button.ClickListener() {\r
-            public void buttonClick(ClickEvent event) {\r
-                final Window w = new Window("Modal window");\r
-                w.setWidth("50%");\r
-                w.setModal(true);\r
-                final Label l = new Label(txt);\r
-                l.setContentMode(Label.CONTENT_XHTML);\r
-                w.addComponent(l);\r
-                getApplication().getMainWindow().addWindow(w);\r
-            }\r
-        });\r
-        b.setStyleName(Button.STYLE_LINK);\r
-        main.addComponent(b);\r
-        b = new Button("Open a application-level window, with shared state",\r
-                new Button.ClickListener() {\r
-                    public void buttonClick(ClickEvent event) {\r
-                        if (windowUrl == null) {\r
-                            final Window w = new Window("Subwindow");\r
-                            final Label l = new Label(txt);\r
-                            l.setContentMode(Label.CONTENT_XHTML);\r
-                            w.addComponent(l);\r
-                            getApplication().addWindow(w);\r
-                            windowUrl = w.getURL();\r
-                        }\r
-                        getApplication().getMainWindow().open(\r
-                                new ExternalResource(windowUrl), "_new");\r
-                    }\r
-                });\r
-        b.setStyleName(Button.STYLE_LINK);\r
-        main.addComponent(b);\r
-        b = new Button(\r
-                "Create a new application-level window, with it's own state",\r
-                new Button.ClickListener() {\r
-                    public void buttonClick(ClickEvent event) {\r
-                        final Window w = new Window("Subwindow");\r
-                        getApplication().addWindow(w);\r
-                        final Label l = new Label(\r
-                                "Each opened window has its own"\r
-                                        + " name, and is accessed trough its own uri.");\r
-                        l.setCaption("Window " + w.getName());\r
-                        w.addComponent(l);\r
-                        getApplication().getMainWindow().open(\r
-                                new ExternalResource(w.getURL()), "_new");\r
-                    }\r
-                });\r
-        b.setStyleName(Button.STYLE_LINK);\r
-        main.addComponent(b);\r
-\r
-    }\r
-\r
-}\r
diff --git a/tests/src/com/vaadin/automatedtests/robustness/Robustness.java b/tests/src/com/vaadin/automatedtests/robustness/Robustness.java
deleted file mode 100644 (file)
index 1e8a376..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/* 
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.automatedtests.robustness;
-
-import com.vaadin.automatedtests.util.Log;
-import com.vaadin.automatedtests.util.RandomComponents;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.ComponentContainer;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Button.ClickEvent;
-
-public abstract class Robustness extends com.vaadin.Application implements
-        Button.ClickListener {
-
-    static int totalCount = 0;
-
-    int count = 0;
-
-    final Window main = new Window("Robustness tests by featurebrowser");
-
-    Button close = new Button("Close application");
-
-    Button remove = new Button("Remove all components");
-
-    Button create = new Button("Create");
-
-    Label label = new Label();
-
-    ComponentContainer stressLayout;
-
-    RandomComponents randomComponents = new RandomComponents();
-
-    @Override
-    public void init() {
-        createNewView();
-    }
-
-    public void createNewView() {
-        setMainWindow(main);
-        main.setDebugId("MainWindow");
-        main.removeAllComponents();
-
-        main.addComponent(label);
-        main.addComponent(close);
-        main.addComponent(remove);
-        main.addComponent(create);
-        close.addListener(this);
-        remove.addListener(this);
-        create.addListener(this);
-
-        remove.setDescription("After this garbage collector should"
-                + " be able to collect every component"
-                + " inside stressLayout.");
-
-        close.setDebugId("close");
-        remove.setDebugId("remove");
-        create.setDebugId("create");
-
-    }
-
-    public void buttonClick(ClickEvent event) {
-        if (event.getButton() == create) {
-            create();
-        } else if (event.getButton() == remove) {
-            main.removeAllComponents();
-            close.removeListener(this);
-            remove.removeListener(this);
-            create.removeListener(this);
-            close = null;
-            remove = null;
-            create = null;
-            label = null;
-            stressLayout = null;
-            System.out.println("main.getLayout()=" + main.getLayout());
-            System.out.println(Log.getMemoryStatistics());
-        } else if (event.getButton() == close) {
-            System.out.println("Before close, memory statistics:");
-            System.out.println(Log.getMemoryStatistics());
-            close();
-            // Still valueUnbound (session expiration) needs to occur for GC to
-            // do its work
-            System.out.println("After close, memory statistics:");
-            System.out.println(Log.getMemoryStatistics());
-        }
-    }
-
-    public abstract void create();
-}
diff --git a/tests/src/com/vaadin/automatedtests/robustness/RobustnessComplex.java b/tests/src/com/vaadin/automatedtests/robustness/RobustnessComplex.java
deleted file mode 100644 (file)
index 9e72af8..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/* 
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.automatedtests.robustness;
-
-import com.vaadin.automatedtests.util.Log;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Label;
-
-public class RobustnessComplex extends Robustness implements
-        Button.ClickListener {
-
-    /**
-     * Create complex layouts with components and listeners.
-     */
-    @Override
-    public void create() {
-        count++;
-
-        // remove old stressLayout, all dependant components should be now
-        // allowed for garbage collection.
-        if (stressLayout != null) {
-            main.removeComponent(stressLayout);
-        }
-
-        // create new stress layout
-        stressLayout = randomComponents
-                .getRandomComponentContainer("Component container " + count);
-
-        Label label = new Label("Label " + Log.getMemoryStatistics(),
-                Label.CONTENT_PREFORMATTED);
-        stressLayout.addComponent(label);
-
-        // fill with random components
-        randomComponents.fillLayout(stressLayout, 50);
-
-        // add new component container to main layout
-        main.addComponent(stressLayout);
-
-        // if ((count % 100) == 0) {
-        System.out.println("Created " + count + " times.");
-        // }
-    }
-}
diff --git a/tests/src/com/vaadin/automatedtests/util/DebugId.java b/tests/src/com/vaadin/automatedtests/util/DebugId.java
deleted file mode 100644 (file)
index 8f23909..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/* 
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.automatedtests.util;
-
-import java.io.Serializable;
-import java.util.HashMap;
-
-import com.vaadin.ui.Component;
-
-public class DebugId implements Serializable {
-
-    private static HashMap debugIds = new HashMap();
-
-    /**
-     * Generate static debug id based on package and component type. If
-     * duplicate package, component type then number of instances count is
-     * appended to debugId.
-     * 
-     * @param c
-     */
-    public static void set(Component c, String description) {
-        String debugId = "";
-
-        // add package name
-        StackTraceElement[] st = new Throwable().fillInStackTrace()
-                .getStackTrace();
-        try {
-            debugId += st[3].getClassName();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        // add component type
-        debugId += c.getClass();
-
-        // add given description
-        debugId += description;
-
-        if (debugIds.containsKey(debugId)) {
-            int count = ((Integer) debugIds.get(debugId)).intValue();
-            count++;
-            debugIds.put(debugId, new Integer(count));
-            debugId = debugId + "-" + count;
-        }
-
-        c.setDebugId(debugId);
-    }
-}
diff --git a/tests/src/com/vaadin/automatedtests/util/Log.java b/tests/src/com/vaadin/automatedtests/util/Log.java
deleted file mode 100644 (file)
index f9948af..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-/* 
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.automatedtests.util;
-
-import java.io.Serializable;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-
-/**
- * 
- * Execution output and error messages should be handled through this class. It
- * is likely that we need these messages back to TT Server at some point just to
- * figure out what went wrong.
- * 
- */
-public class Log implements Serializable {
-
-    // 3 (errors only)
-    // 2 (+ warnings)
-    // 1 (+logs)
-    // 0 (all, print messages also to System.out)
-    public static final int debug = 0;
-
-    // Should class.method() and it's call times be told on debug?
-    public static final boolean showClassInformation = true;
-
-    public static DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-
-    public static int DEBUG = 0;
-
-    public static int LOG = 1;
-
-    public static int WARN = 2;
-
-    public static int ERROR = 3;
-
-    private static Log log;
-
-    public static HashMap classMethodCallCounter = new HashMap();
-
-    static {
-        log = new Log();
-    }
-
-    public static void reset() {
-        classMethodCallCounter = new HashMap();
-    }
-
-    public static String getNow() {
-        return df.format(new Date());
-    }
-
-    private Log() {
-    }
-
-    public static String getSource() {
-        StackTraceElement[] st = new Throwable().fillInStackTrace()
-                .getStackTrace();
-        try {
-            String key = "";
-            String methodName = st[3].getMethodName();
-            int line = st[3].getLineNumber();
-
-            String clazz = st[3].getClassName() + ".java";
-            key = "(" + clazz + ":" + line + ")" + " " + methodName;
-            Integer value = (Integer) classMethodCallCounter.get(key);
-            if (value == null) {
-                value = new Integer(1);
-            } else {
-                value = new Integer(value.intValue() + 1);
-            }
-            classMethodCallCounter.put(key, value);
-            return value.intValue() + ": " + key;
-        } catch (Exception e) {
-            return "unknown class.method";
-        }
-
-    }
-
-    public static String getClassMethodCounters() {
-        String result = "";
-        for (final Iterator it = classMethodCallCounter.keySet().iterator(); it
-                .hasNext();) {
-            String key = (String) it.next();
-            result += classMethodCallCounter.get(key) + ": " + key + "\n";
-        }
-        return result;
-    }
-
-    public void add(int type, String message) {
-        String source = getSource();
-        if (type >= debug) {
-            if (showClassInformation) {
-                System.out.println(source + ": " + message);
-            } else {
-                System.out.println(message);
-            }
-        }
-    }
-
-    public static void debug(String message) {
-        log.add(DEBUG, message);
-    }
-
-    public static void log(String message) {
-        log.add(LOG, message);
-    }
-
-    public static void warn(String message) {
-        log.add(WARN, message);
-    }
-
-    public static void error(String message) {
-        log.add(ERROR, message);
-    }
-
-    /**
-     * Simple way to check for memory consumption without profiler.
-     */
-    public static String getMemoryStatistics() {
-        // You should call gc before printing statistics (if you are not using a
-        // profiler)
-        System.gc();
-        long inUse = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime()
-                .freeMemory());
-        return "Memory:\n" + inUse + " (Used)\n"
-                + Runtime.getRuntime().totalMemory() + " (Total)\n"
-                + Runtime.getRuntime().freeMemory() + " (Free)\n";
-
-    }
-}
diff --git a/tests/src/com/vaadin/automatedtests/util/MultiListener.java b/tests/src/com/vaadin/automatedtests/util/MultiListener.java
deleted file mode 100644 (file)
index 5f7df2a..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.automatedtests.util;
-
-import com.vaadin.data.Container.ItemSetChangeEvent;
-import com.vaadin.data.Container.ItemSetChangeListener;
-import com.vaadin.data.Container.PropertySetChangeEvent;
-import com.vaadin.data.Container.PropertySetChangeListener;
-import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.data.Property.ValueChangeListener;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-
-public class MultiListener implements Button.ClickListener,
-        PropertySetChangeListener, ItemSetChangeListener, ValueChangeListener {
-
-    public void buttonClick(ClickEvent event) {
-        Log.debug("ClickEvent from " + event.getButton().getCaption());
-    }
-
-    public void containerPropertySetChange(PropertySetChangeEvent event) {
-        Log.debug("containerPropertySetChange from " + event.getContainer());
-    }
-
-    public void containerItemSetChange(ItemSetChangeEvent event) {
-        Log.debug("containerItemSetChange from " + event.getContainer());
-    }
-
-    public void valueChange(ValueChangeEvent event) {
-        Log.debug("valueChange from " + event.getProperty());
-    }
-
-}
diff --git a/tests/src/com/vaadin/automatedtests/util/RandomComponents.java b/tests/src/com/vaadin/automatedtests/util/RandomComponents.java
deleted file mode 100644 (file)
index 46446d8..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-/* 
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.automatedtests.util;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Random;
-
-import com.vaadin.automatedtests.ComponentsInTable;
-import com.vaadin.data.Container.ItemSetChangeListener;
-import com.vaadin.data.Container.PropertySetChangeListener;
-import com.vaadin.data.Property.ValueChangeListener;
-import com.vaadin.demo.featurebrowser.ButtonExample;
-import com.vaadin.demo.featurebrowser.ClientCachingExample;
-import com.vaadin.demo.featurebrowser.ComboBoxExample;
-import com.vaadin.demo.featurebrowser.EmbeddedBrowserExample;
-import com.vaadin.demo.featurebrowser.LabelExample;
-import com.vaadin.demo.featurebrowser.LayoutExample;
-import com.vaadin.demo.featurebrowser.NotificationExample;
-import com.vaadin.demo.featurebrowser.RichTextExample;
-import com.vaadin.demo.featurebrowser.SelectExample;
-import com.vaadin.demo.featurebrowser.TableExample;
-import com.vaadin.demo.featurebrowser.TreeExample;
-import com.vaadin.demo.featurebrowser.ValueInputExample;
-import com.vaadin.demo.featurebrowser.WindowingExample;
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.ThemeResource;
-import com.vaadin.ui.AbstractComponent;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.ComponentContainer;
-import com.vaadin.ui.DateField;
-import com.vaadin.ui.Embedded;
-import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Link;
-import com.vaadin.ui.OrderedLayout;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.Select;
-import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.TextField;
-
-public class RandomComponents implements Serializable {
-
-    private Random rand = null;
-
-    private static Date date = new Date(2002, 2, 3, 4, 5, 6);
-
-    public RandomComponents() {
-        // Always use the same seed, used to ensure deterministic behaviour
-        rand = new Random(1);
-    }
-
-    /**
-     * Get random component container
-     * 
-     * @param caption
-     * @return
-     */
-    public ComponentContainer getRandomComponentContainer(String caption) {
-        ComponentContainer result = null;
-        final int randint = rand.nextInt(5);
-        switch (randint) {
-
-        case 0:
-            result = new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL);
-            ((OrderedLayout) result).setCaption("OrderedLayout_horizontal_"
-                    + caption);
-            break;
-        case 1:
-            result = new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL);
-            ((OrderedLayout) result).setCaption("OrderedLayout_vertical_"
-                    + caption);
-            break;
-        case 2:
-            GridLayout gl;
-            if (rand.nextInt(1) > 0) {
-                gl = new GridLayout();
-            } else {
-                gl = new GridLayout(rand.nextInt(3) + 1, rand.nextInt(3) + 1);
-            }
-            gl.setCaption("GridLayout_" + caption);
-            gl.setDescription(gl.getCaption());
-            for (int x = 0; x < gl.getColumns(); x++) {
-                for (int y = 0; y < gl.getRows(); y++) {
-                    // gl.addComponent(getExamplePicture("x=" + x + ", y=" + y),
-                    // x, y);
-                    gl.addComponent(new Label("x=" + x + ", y=" + y));
-                }
-            }
-            result = gl;
-            break;
-        case 3:
-            result = new Panel();
-            ((Panel) result).setCaption("Panel_" + caption);
-            break;
-        case 4:
-            final TabSheet ts = new TabSheet();
-            ts.setCaption("TabSheet_" + caption);
-            // randomly select one of the tabs
-            final int selectedTab = rand.nextInt(3);
-            final ArrayList tabs = new ArrayList();
-            for (int i = 0; i < 3; i++) {
-                String tabCaption = "tab" + i;
-                if (selectedTab == i) {
-                    tabCaption = "tabX";
-                }
-                tabs.add(new OrderedLayout());
-                ts.addTab((ComponentContainer) tabs.get(tabs.size() - 1),
-                        tabCaption, null);
-            }
-            ts.setSelectedTab((ComponentContainer) tabs.get(selectedTab));
-            result = ts;
-            break;
-        }
-
-        return result;
-    }
-
-    public AbstractComponent getRandomComponent(int caption) {
-        AbstractComponent result = null;
-        int randint = rand.nextInt(23);
-        MultiListener l = new MultiListener();
-        switch (randint) {
-        case 0:
-            // Label
-            result = new Label();
-            result.setCaption("Label component " + caption);
-            result.setDebugId(result.getCaption());
-            break;
-        case 1:
-            // Button
-            result = new Button();
-            result.setCaption("Button component " + caption);
-            result.setDebugId(result.getCaption());
-            // some listeners
-            ((Button) result).addListener((Button.ClickListener) l);
-            break;
-        case 2:
-            // TextField
-            result = new TextField();
-            result.setCaption("TextField component " + caption);
-            result.setDebugId(result.getCaption());
-            break;
-        case 3:
-            // Select
-            result = new Select("Select component " + caption);
-            result.setCaption("Select component " + caption);
-            result.setDebugId(result.getCaption());
-            result.setImmediate(true);
-            ((Select) result).setNewItemsAllowed(true);
-            // items
-            ((Select) result).addItem("first");
-            ((Select) result).addItem("first");
-            ((Select) result).addItem("first");
-            ((Select) result).addItem("second");
-            ((Select) result).addItem("third");
-            ((Select) result).addItem("fourth");
-            // some listeners
-            ((Select) result).addListener((ValueChangeListener) l);
-            ((Select) result).addListener((PropertySetChangeListener) l);
-            ((Select) result).addListener((ItemSetChangeListener) l);
-            break;
-        case 4:
-            // Link
-            result = new Link("", new ExternalResource("http://www.vaadin.com"));
-            result.setCaption("Link component " + caption);
-            break;
-        case 5:
-            // Link
-            result = new Panel();
-            result.setCaption("Panel component " + caption);
-            ((Panel) result)
-                    .addComponent(new Label(
-                            "Panel is a container for other components, by default it draws a frame around it's "
-                                    + "extremities and may have a caption to clarify the nature of the contained components' purpose."
-                                    + " Panel contains an layout where the actual contained components are added, "
-                                    + "this layout may be switched on the fly."));
-            ((Panel) result).setWidth(250);
-            break;
-        case 6:
-            // Datefield
-            result = new DateField();
-            ((DateField) result).setStyleName("calendar");
-            ((DateField) result).setValue(date);
-            result.setCaption("Calendar component " + caption);
-            result.setDebugId(result.getCaption());
-            break;
-        case 7:
-            // Datefield
-            result = new DateField();
-            ((DateField) result).setValue(date);
-            result.setCaption("Calendar component " + caption);
-            result.setDebugId(result.getCaption());
-            break;
-        case 8:
-            result = new OrderedLayout();
-            ((OrderedLayout) result).addComponent(new ButtonExample());
-            break;
-        case 9:
-            result = new OrderedLayout();
-            ((OrderedLayout) result).addComponent(new ClientCachingExample());
-            break;
-        case 10:
-            result = new OrderedLayout();
-            ((OrderedLayout) result).addComponent(new ComboBoxExample());
-            break;
-        case 11:
-            result = new OrderedLayout();
-            ((OrderedLayout) result).addComponent(new EmbeddedBrowserExample());
-            break;
-        case 12:
-            result = new OrderedLayout();
-            ((OrderedLayout) result).addComponent(new EmbeddedBrowserExample());
-            break;
-        case 13:
-            result = new OrderedLayout();
-            ((OrderedLayout) result).addComponent(new LabelExample());
-            break;
-        case 14:
-            result = new OrderedLayout();
-            ((OrderedLayout) result).addComponent(new LayoutExample());
-            break;
-        case 15:
-            result = new OrderedLayout();
-            ((OrderedLayout) result).addComponent(new NotificationExample());
-            break;
-        case 16:
-            result = new OrderedLayout();
-            ((OrderedLayout) result).addComponent(new RichTextExample());
-            break;
-        case 17:
-            result = new OrderedLayout();
-            ((OrderedLayout) result).addComponent(new SelectExample());
-            break;
-        case 18:
-            result = new OrderedLayout();
-            ((OrderedLayout) result).addComponent(new ValueInputExample());
-            break;
-        case 19:
-            result = new OrderedLayout();
-            ((OrderedLayout) result).addComponent(new WindowingExample());
-            break;
-        case 20:
-            result = new OrderedLayout();
-            ((OrderedLayout) result).addComponent(new TreeExample());
-            break;
-        case 21:
-            result = new OrderedLayout();
-            ((OrderedLayout) result).addComponent(new TableExample());
-            break;
-        case 22:
-            result = new OrderedLayout();
-            ((OrderedLayout) result)
-                    .addComponent(new ComponentsInTable(4, 1000));
-            break;
-        }
-
-        return result;
-    }
-
-    /**
-     * Add demo components to given container
-     * 
-     * @param container
-     */
-    public void fillLayout(ComponentContainer container, int numberOfComponents) {
-        for (int i = 0; i < numberOfComponents; i++) {
-            container.addComponent(getRandomComponent(i));
-        }
-    }
-
-    public AbstractComponent getExamplePicture(String caption) {
-        final ThemeResource res = new ThemeResource("test.png");
-        final Embedded em = new Embedded("Embedded " + caption, res);
-        return em;
-    }
-
-}
diff --git a/tests/src/com/vaadin/automatedtests/util/StatusServlet.java b/tests/src/com/vaadin/automatedtests/util/StatusServlet.java
deleted file mode 100644 (file)
index c0b3c7c..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/* 
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.automatedtests.util;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-@SuppressWarnings("serial")
-public class StatusServlet extends HttpServlet {
-
-    public static DateFormat dfHuman = new SimpleDateFormat(
-            "yyyy-MM-dd HH:mm:ss");
-
-    /**
-     * Version number of this release. For example "5.0.0".
-     */
-    public static final String VERSION;
-
-    /**
-     * Major version number. For example 5 in 5.1.0.
-     */
-    public static final int VERSION_MAJOR;
-
-    /**
-     * Minor version number. For example 1 in 5.1.0.
-     */
-    public static final int VERSION_MINOR;
-
-    /**
-     * Builds number. For example 0-custom_tag in 5.0.0-custom_tag.
-     */
-    public static final String VERSION_BUILD;
-
-    /* Initialize version numbers from string replaced by build-script. */
-    static {
-        if ("@VERSION@".equals("@" + "VERSION" + "@")) {
-            VERSION = "5.9.9-INTERNAL-NONVERSIONED-DEBUG-BUILD";
-        } else {
-            VERSION = "@VERSION@";
-        }
-        final String[] digits = VERSION.split("\\.");
-        VERSION_MAJOR = Integer.parseInt(digits[0]);
-        VERSION_MINOR = Integer.parseInt(digits[1]);
-        VERSION_BUILD = digits[2];
-    }
-
-    @Override
-    public void init(javax.servlet.ServletConfig servletConfig)
-            throws javax.servlet.ServletException {
-        super.init(servletConfig);
-    }
-
-    @Override
-    protected void service(HttpServletRequest request,
-            HttpServletResponse response) throws ServletException, IOException {
-        Writer w = response.getWriter();
-
-        // not cacheable
-        response.setHeader("Cache-Control", "no-cache");
-        response.setHeader("Pragma", "no-cache");
-        response.setDateHeader("Expires", 0);
-        response.setContentType("text/html");
-
-        String p = "";
-        p += "<p>StatusServlet " + dfHuman.format(new Date()) + "</p>";
-        for (int i = 0; i < 30; i++) {
-            System.gc();
-        }
-        long inUse = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime()
-                .freeMemory());
-        p += "<p>Memory:<br />\n<memused>" + inUse
-                + "</memused> (Used)<br />\n" + "<memtotal>"
-                + Runtime.getRuntime().totalMemory()
-                + "<memtotal> (Total)<br />\n" + "<memfree>"
-                + Runtime.getRuntime().freeMemory() + "<memfree> (Free)</p>\n";
-
-        w.write("<html>\n" + p + "</html>\n");
-    }
-}
index a12489a2cc17279cf3eadef29660f796fc5d148f..06d2ab0949f7178c87425ec99efd4fe398ab4955 100644 (file)
@@ -1,6 +1,5 @@
 package com.vaadin.tests.robustness;
 
-import com.vaadin.automatedtests.util.Log;
 import com.vaadin.tests.util.RandomComponents;
 import com.vaadin.ui.Button;
 import com.vaadin.ui.ComponentContainer;
@@ -70,17 +69,29 @@ public abstract class Robustness extends com.vaadin.Application implements
             label = null;
             stressLayout = null;
             System.out.println("main.getLayout()=" + main.getLayout());
-            System.out.println(Log.getMemoryStatistics());
+            System.out.println(getMemoryStatistics());
         } else if (event.getButton() == close) {
             System.out.println("Before close, memory statistics:");
-            System.out.println(Log.getMemoryStatistics());
+            System.out.println(getMemoryStatistics());
             close();
             // Still valueUnbound (session expiration) needs to occur for GC to
             // do its work
             System.out.println("After close, memory statistics:");
-            System.out.println(Log.getMemoryStatistics());
+            System.out.println(getMemoryStatistics());
         }
     }
 
+    public static String getMemoryStatistics() {
+        // You should call gc before printing statistics (if you are not using a
+        // profiler)
+        System.gc();
+        long inUse = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime()
+                .freeMemory());
+        return "Memory:\n" + inUse + " (Used)\n"
+                + Runtime.getRuntime().totalMemory() + " (Total)\n"
+                + Runtime.getRuntime().freeMemory() + " (Free)\n";
+
+    }
+
     public abstract void create();
 }
diff --git a/tests/src/com/vaadin/tests/robustness/RobustnessComplex.java b/tests/src/com/vaadin/tests/robustness/RobustnessComplex.java
new file mode 100644 (file)
index 0000000..342270c
--- /dev/null
@@ -0,0 +1,44 @@
+/* \r
+@ITMillApache2LicenseForJavaFiles@\r
+ */\r
+\r
+package com.vaadin.tests.robustness;\r
+\r
+import com.vaadin.ui.Button;\r
+import com.vaadin.ui.Label;\r
+\r
+public class RobustnessComplex extends Robustness implements\r
+        Button.ClickListener {\r
+\r
+    /**\r
+     * Create complex layouts with components and listeners.\r
+     */\r
+    @Override\r
+    public void create() {\r
+        count++;\r
+\r
+        // remove old stressLayout, all dependant components should be now\r
+        // allowed for garbage collection.\r
+        if (stressLayout != null) {\r
+            main.removeComponent(stressLayout);\r
+        }\r
+\r
+        // create new stress layout\r
+        stressLayout = randomComponents\r
+                .getRandomComponentContainer("Component container " + count);\r
+\r
+        Label label = new Label("Label " + getMemoryStatistics(),\r
+                Label.CONTENT_PREFORMATTED);\r
+        stressLayout.addComponent(label);\r
+\r
+        // fill with random components\r
+        randomComponents.fillLayout(stressLayout, 50);\r
+\r
+        // add new component container to main layout\r
+        main.addComponent(stressLayout);\r
+\r
+        // if ((count % 100) == 0) {\r
+        System.out.println("Created " + count + " times.");\r
+        // }\r
+    }\r
+}\r
index 63324ad9bc41f784d92e7253469ffd8832939522..e99fe4b5e7c03afb2387d3bdfd22a0b9f3f99cd8 100644 (file)
@@ -1,6 +1,5 @@
 package com.vaadin.tests.robustness;
 
-import com.vaadin.automatedtests.util.Log;
 import com.vaadin.ui.Button;
 import com.vaadin.ui.Label;
 import com.vaadin.ui.OrderedLayout;
@@ -23,7 +22,7 @@ public class RobustnessSimple extends Robustness implements
 
         // CASE single orderedlayout with a label containing 1Mb of data
         // fill with random components
-        Label label = new Label("Label " + Log.getMemoryStatistics(),
+        Label label = new Label("Label " + getMemoryStatistics(),
                 Label.CONTENT_PREFORMATTED);
         byte[] data = new byte[1024 * 1024];
         label.setData(data);
index fdfb878e042a63890c994fa0a936f44a19f06708..bb64450ac748757d3abaab58355732129f00eef3 100644 (file)
@@ -3,9 +3,11 @@ package com.vaadin.tests.util;
 import java.util.ArrayList;
 import java.util.Random;
 
-import com.vaadin.automatedtests.util.MultiListener;
+import com.vaadin.data.Container.ItemSetChangeEvent;
 import com.vaadin.data.Container.ItemSetChangeListener;
+import com.vaadin.data.Container.PropertySetChangeEvent;
 import com.vaadin.data.Container.PropertySetChangeListener;
+import com.vaadin.data.Property.ValueChangeEvent;
 import com.vaadin.data.Property.ValueChangeListener;
 import com.vaadin.demo.featurebrowser.ButtonExample;
 import com.vaadin.demo.featurebrowser.ClientCachingExample;
@@ -37,6 +39,7 @@ import com.vaadin.ui.Panel;
 import com.vaadin.ui.Select;
 import com.vaadin.ui.TabSheet;
 import com.vaadin.ui.TextField;
+import com.vaadin.ui.Button.ClickEvent;
 
 public class RandomComponents {
 
@@ -271,4 +274,29 @@ public class RandomComponents {
         return em;
     }
 
+    public class MultiListener implements Button.ClickListener,
+            PropertySetChangeListener, ItemSetChangeListener,
+            ValueChangeListener {
+
+        public void buttonClick(ClickEvent event) {
+            System.out.println("ClickEvent from "
+                    + event.getButton().getCaption());
+        }
+
+        public void containerPropertySetChange(PropertySetChangeEvent event) {
+            System.out.println("containerPropertySetChange from "
+                    + event.getContainer());
+        }
+
+        public void containerItemSetChange(ItemSetChangeEvent event) {
+            System.out.println("containerItemSetChange from "
+                    + event.getContainer());
+        }
+
+        public void valueChange(ValueChangeEvent event) {
+            System.out.println("valueChange from " + event.getProperty());
+        }
+
+    }
+
 }