diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-03-11 09:33:44 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2010-03-11 09:33:44 +0000 |
commit | 0950fb132351c6860953a173272415d70421b413 (patch) | |
tree | 0b042900060309dc158f162f2d0c371cbf7da70e /tests | |
parent | 9de6137647ed81f0528a90395970e55c5d30405c (diff) | |
download | vaadin-framework-0950fb132351c6860953a173272415d70421b413.tar.gz vaadin-framework-0950fb132351c6860953a173272415d70421b413.zip |
test case for #4299
svn changeset:11773/svn branch:6.3
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/src/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java b/tests/src/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java new file mode 100644 index 0000000000..e9055bf2b8 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java @@ -0,0 +1,59 @@ +package com.vaadin.tests.components.table; + +import com.vaadin.data.Property; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.CssLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.Table; +import com.vaadin.ui.Button.ClickEvent; + +public class TableCacheBuildEfficiency extends TestBase { + + @Override + protected String getDescription() { + return "On each add, row property values should be queried only once (one log row for first addition)."; + } + + @Override + protected Integer getTicketNumber() { + return 4299; + } + + @Override + protected void setup() { + + final CssLayout log = new CssLayout(); + log.setWidth("100%"); + + final Table table = new Table() { + @Override + public Property getContainerProperty(Object itemId, + Object propertyId) { + log("Fetched container property \"" + propertyId + + "\" for item \"" + itemId + "\""); + return super.getContainerProperty(itemId, propertyId); + } + + private void log(String string) { + log.addComponent(new Label(string)); + + } + }; + + table.addContainerProperty("foo", String.class, "bar"); + + Button b = new Button("Click to add row", new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + table.addItem(); + + } + }); + + getLayout().addComponent(table); + getLayout().addComponent(b); + getLayout().addComponent(log); + + } +} |