summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/applicationcontext/ChangeSessionId.java15
-rw-r--r--uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.html46
-rw-r--r--uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java59
3 files changed, 111 insertions, 9 deletions
diff --git a/uitest/src/com/vaadin/tests/applicationcontext/ChangeSessionId.java b/uitest/src/com/vaadin/tests/applicationcontext/ChangeSessionId.java
index 4495b343d0..fa0f13e172 100644
--- a/uitest/src/com/vaadin/tests/applicationcontext/ChangeSessionId.java
+++ b/uitest/src/com/vaadin/tests/applicationcontext/ChangeSessionId.java
@@ -1,7 +1,6 @@
package com.vaadin.tests.applicationcontext;
import com.vaadin.server.VaadinService;
-import com.vaadin.server.VaadinServletSession;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.tests.util.Log;
import com.vaadin.ui.Button;
@@ -30,15 +29,13 @@ public class ChangeSessionId extends AbstractTestCase {
}));
setMainWindow(mainWindow);
- loginButton.addListener(new ClickListener() {
+ loginButton.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
- VaadinServletSession context = ((VaadinServletSession) getContext());
-
- String oldSessionId = context.getHttpSession().getId();
- context.getService().reinitializeSession(
- VaadinService.getCurrentRequest());
- String newSessionId = context.getHttpSession().getId();
+ String oldSessionId = getSessionId();
+ VaadinService.reinitializeSession(VaadinService
+ .getCurrentRequest());
+ String newSessionId = getSessionId();
if (oldSessionId.equals(newSessionId)) {
log.log("FAILED! Both old and new session id is "
+ newSessionId);
@@ -57,7 +54,7 @@ public class ChangeSessionId extends AbstractTestCase {
}
protected String getSessionId() {
- return ((VaadinServletSession) getContext()).getHttpSession().getId();
+ return getContext().getSession().getId();
}
@Override
diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.html b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.html
new file mode 100644
index 0000000000..2536ed50f6
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.html
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="http://localhost:9999/" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/TabsheetShouldUpdateHeight?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runTabsheetShouldUpdateHeight::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>12,8</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runTabsheetShouldUpdateHeight::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>21,4</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runTabsheetShouldUpdateHeight::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runTabsheetShouldUpdateHeight::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>18,3</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>tab3</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java
new file mode 100644
index 0000000000..af0cd8b49b
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java
@@ -0,0 +1,59 @@
+package com.vaadin.tests.components.tabsheet;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class TabsheetShouldUpdateHeight extends TestBase {
+
+ @Override
+ public void setup() {
+ final TabSheet tabsOuter = new TabSheet();
+ final TabSheet tabsInner = new TabSheet();
+
+ final Component tab2;
+
+ tabsInner.addTab(tab2 = getLayoutWithComponents(6, "tab2"), "Tab 2");
+ tabsInner.addTab(getLayoutWithComponents(8, "tab3"), "Tab 3");
+
+ tabsOuter.addTab(tabsInner, "Inner tabs");
+ tabsOuter.addTab(getLayoutWithComponents(10, "tab1"), "Tab 1");
+
+ final Button btnSwitch = new Button("switch to Tab2",
+ new Button.ClickListener() {
+
+ public void buttonClick(final ClickEvent inEvent) {
+ tabsOuter.setSelectedTab(tabsInner);
+ tabsInner.setSelectedTab(tab2);
+ }
+ });
+
+ addComponent(tabsOuter);
+ addComponent(btnSwitch);
+ }
+
+ private VerticalLayout getLayoutWithComponents(final int inAmount, String id) {
+ final VerticalLayout v = new VerticalLayout();
+ v.setDebugId(id);
+ v.setSpacing(true);
+ v.setMargin(true);
+ for (int i = 0; i < inAmount; i++) {
+ v.addComponent(new TextField("Text field:"));
+ }
+ return v;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "click with mouse first on tab 3 and then on tab 1. now click on the button 'switch to tab2'. then click on tab 3 again and the scrollbars appear";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 9275;
+ }
+} \ No newline at end of file