From: Artur Signell Date: Wed, 7 Jul 2010 07:24:45 +0000 (+0000) Subject: Added more test cases (for #5315, #5321) X-Git-Tag: 6.7.0.beta1~1419 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c021e8c085a14f37cf48babb8bc166fc383badfc;p=vaadin-framework.git Added more test cases (for #5315, #5321) svn changeset:14112/svn branch:6.4 --- diff --git a/tests/src/com/vaadin/tests/components/table/HeaderClick.html b/tests/src/com/vaadin/tests/components/table/HeaderClick.html index d1aabc3234..3f0b111419 100644 --- a/tests/src/com/vaadin/tests/components/table/HeaderClick.html +++ b/tests/src/com/vaadin/tests/components/table/HeaderClick.html @@ -13,7 +13,7 @@ open - /run/com.vaadin.tests.components.table.HeaderClick + /run/com.vaadin.tests.components.table.HeaderClick?restartApplication @@ -23,7 +23,7 @@ mouseClick - vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1] + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1] 37,11 @@ -32,13 +32,13 @@ - verifyValue - vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VTextField[0] + assertValue + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0] col1 mouseClick - vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[1] + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[1] 36,9 @@ -47,13 +47,13 @@ - verifyValue - vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VTextField[0] + assertValue + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0] col2 mouseClick - vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[1] + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[1] 8,11 @@ -62,11 +62,172 @@ - verifyValue - vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VTextField[0] + assertValue + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0] + col3 + + + + mouseClick + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VCheckBox[0]/domChild[0] + 6,7 + + + mouseClick + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1] + 31,9 + + + pause + 500 + + + + assertValue + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0] + col1 + + + mouseClick + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[1] + 16,10 + + + pause + 500 + + + + assertValue + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0] + col2 + + + mouseClick + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[1] + 16,10 + + + pause + 500 + + + + assertValue + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0] + col3 + + + mouseClick + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VCheckBox[0]/domChild[0] + 7,8 + + + mouseClick + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1] + 64,10 + + + pause + 500 + + + + assertValue + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0] + col1 + + + mouseClick + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[1] + 48,10 + + + pause + 500 + + + + assertValue + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0] + col2 + + + mouseClick + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[1] + 30,11 + + + pause + 500 + + + + assertValue + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0] + col3 + + + mouseClick + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0] + 7,8 + + + mouseClick + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1] + 48,11 + + + pause + 500 + + + + assertValue + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0] + col1 + + + mouseClick + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[1] + 71,10 + + + pause + 500 + + + + assertValue + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0] + col2 + + + mouseClick + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[1] + 39,5 + + + pause + 500 + + + + assertValue + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0] + col3 + + + mouseClick + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0] + 54,6 + + + + assertValue + vaadin=runcomvaadintestscomponentstableHeaderClick::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0] col3 - diff --git a/tests/src/com/vaadin/tests/components/table/HeaderClick.java b/tests/src/com/vaadin/tests/components/table/HeaderClick.java index 19a9eb1b8f..31ef73b84c 100644 --- a/tests/src/com/vaadin/tests/components/table/HeaderClick.java +++ b/tests/src/com/vaadin/tests/components/table/HeaderClick.java @@ -4,8 +4,11 @@ import com.vaadin.data.Container; import com.vaadin.data.Item; import com.vaadin.data.util.IndexedContainer; import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.CheckBox; import com.vaadin.ui.Table; import com.vaadin.ui.TextField; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Table.HeaderClickEvent; @SuppressWarnings("serial") @@ -14,6 +17,7 @@ public class HeaderClick extends TestBase { @Override protected void setup() { final Table table = new Table(); + table.setColumnReorderingAllowed(true); table.setContainerDataSource(createContainer()); table.setWidth("400px"); table.setHeight("400px"); @@ -29,6 +33,41 @@ public class HeaderClick extends TestBase { } }); + CheckBox immediateCheckbox = new CheckBox("Immediate"); + immediateCheckbox.setImmediate(true); + immediateCheckbox.setValue(table.isImmediate()); + immediateCheckbox.addListener(new ClickListener() { + + public void buttonClick(ClickEvent event) { + table.setImmediate(event.getButton().booleanValue()); + } + }); + + CheckBox sortEnabledCheckbox = new CheckBox("Sortable"); + sortEnabledCheckbox.setImmediate(true); + sortEnabledCheckbox.setValue(!table.isSortDisabled()); + sortEnabledCheckbox.addListener(new ClickListener() { + + public void buttonClick(ClickEvent event) { + table.setSortDisabled(!event.getButton().booleanValue()); + } + }); + + CheckBox columnReorderingCheckbox = new CheckBox( + "Column reordering allowed"); + columnReorderingCheckbox.setImmediate(true); + columnReorderingCheckbox.setValue(table.isColumnReorderingAllowed()); + columnReorderingCheckbox.addListener(new ClickListener() { + + public void buttonClick(ClickEvent event) { + table.setColumnReorderingAllowed(event.getButton() + .booleanValue()); + } + }); + + addComponent(immediateCheckbox); + addComponent(sortEnabledCheckbox); + addComponent(columnReorderingCheckbox); addComponent(table); addComponent(columnField);