summaryrefslogtreecommitdiffstats
path: root/src/com/itmill
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2009-04-23 06:54:08 +0000
committerArtur Signell <artur.signell@itmill.com>2009-04-23 06:54:08 +0000
commitb6887ea186554064c8d5cb8ad5cf1f97d50f0ff8 (patch)
treed7f7bc0683f030f82038da1912c11dce3097ecc0 /src/com/itmill
parentf9e25051db127dafda9d37c4f39ae318cc095526 (diff)
downloadvaadin-framework-b6887ea186554064c8d5cb8ad5cf1f97d50f0ff8.tar.gz
vaadin-framework-b6887ea186554064c8d5cb8ad5cf1f97d50f0ff8.zip
Test case for #2861
svn changeset:7501/svn branch:6.0
Diffstat (limited to 'src/com/itmill')
-rw-r--r--src/com/itmill/toolkit/tests/components/tabsheet/AddAndRemoveTabs.java60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/com/itmill/toolkit/tests/components/tabsheet/AddAndRemoveTabs.java b/src/com/itmill/toolkit/tests/components/tabsheet/AddAndRemoveTabs.java
new file mode 100644
index 0000000000..2962905578
--- /dev/null
+++ b/src/com/itmill/toolkit/tests/components/tabsheet/AddAndRemoveTabs.java
@@ -0,0 +1,60 @@
+package com.itmill.toolkit.tests.components.tabsheet;
+
+import com.itmill.toolkit.tests.components.TestBase;
+import com.itmill.toolkit.ui.Button;
+import com.itmill.toolkit.ui.HorizontalLayout;
+import com.itmill.toolkit.ui.TabSheet;
+import com.itmill.toolkit.ui.Button.ClickEvent;
+
+public class AddAndRemoveTabs extends TestBase {
+ private TabSheet tabSheet;
+
+ private int counter = 0;
+
+ @Override
+ public void setup() {
+ tabSheet = new TabSheet();
+ addTab();
+ addComponent(tabSheet);
+
+ Button addTabBtn = new Button("Add new tab",
+ new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ addTab();
+ }
+
+ });
+ addComponent(addTabBtn);
+ }
+
+ private void addTab() {
+ final HorizontalLayout layout = new HorizontalLayout();
+ layout.setCaption("Test " + counter);
+
+ Button closeTab = new Button("Close tab", new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ tabSheet.removeComponent(layout);
+
+ }
+
+ });
+
+ layout.addComponent(closeTab);
+
+ tabSheet.addComponent(layout);
+ counter++;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Removing all tabs and then adding new tabs should work properly and without javascript errors. All new tabs should be displayed and not only the first one";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 2861;
+ }
+
+}