diff options
author | Artur Signell <artur.signell@itmill.com> | 2011-03-22 13:07:15 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2011-03-22 13:07:15 +0000 |
commit | eaf5726fc107f43116f31cdd4af4527bdbce2730 (patch) | |
tree | 593a162fea37d314ea1a180d839cf0fafd6c79bd /tests | |
parent | f10d99e7639c66cb313398843806031e54230fbb (diff) | |
download | vaadin-framework-eaf5726fc107f43116f31cdd4af4527bdbce2730.tar.gz vaadin-framework-eaf5726fc107f43116f31cdd4af4527bdbce2730.zip |
Test for #3529
svn changeset:17872/svn branch:6.5
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/com/vaadin/tests/components/tree/TreeWithIcons.html | 62 | ||||
-rw-r--r-- | tests/src/com/vaadin/tests/components/tree/TreeWithIcons.java | 69 |
2 files changed, 131 insertions, 0 deletions
diff --git a/tests/src/com/vaadin/tests/components/tree/TreeWithIcons.html b/tests/src/com/vaadin/tests/components/tree/TreeWithIcons.html new file mode 100644 index 0000000000..0b01807054 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/tree/TreeWithIcons.html @@ -0,0 +1,62 @@ +<?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="" /> +<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/com.vaadin.tests.components.tree.TreeWithIcons?restartApplication</td> + <td></td> +</tr> +<tr> + <td>pause</td> + <td>100</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>large-icon</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeWithIcons::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VTree[0]#n[0]/expand</td> + <td>9,6</td> +</tr> +<tr> + <td>pause</td> + <td>100</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>two-large-icons</td> +</tr> +<tr> + <td>mouseClick</td> + <td>vaadin=runcomvaadintestscomponentstreeTreeWithIcons::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VTree[0]#n[1]/expand</td> + <td>8,9</td> +</tr> +<tr> + <td>pause</td> + <td>100</td> + <td></td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>huge-and-two-large-icons</td> +</tr> + +</tbody></table> +</body> +</html> diff --git a/tests/src/com/vaadin/tests/components/tree/TreeWithIcons.java b/tests/src/com/vaadin/tests/components/tree/TreeWithIcons.java new file mode 100644 index 0000000000..fbf4a3c1d1 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/tree/TreeWithIcons.java @@ -0,0 +1,69 @@ +package com.vaadin.tests.components.tree; + +import java.util.Date; + +import com.vaadin.terminal.Sizeable; +import com.vaadin.terminal.ThemeResource; +import com.vaadin.tests.components.TestBase; +import com.vaadin.tests.util.LoremIpsum; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.Panel; +import com.vaadin.ui.Tree; +import com.vaadin.ui.themes.Reindeer; + +public class TreeWithIcons extends TestBase { + + @Override + protected void setup() { + ThemeResource notCachedFolderIconHuge = new ThemeResource( + "../runo/icons/64/folder.png?" + new Date().getTime()); + ThemeResource notCachedFolderIconLarge = new ThemeResource( + "../runo/icons/32/folder.png?" + new Date().getTime()); + ThemeResource notCachedFolderIconLargeOther = new ThemeResource( + "../runo/icons/32/ok.png?" + new Date().getTime()); + Tree t = new Tree(); + t.setImmediate(true); + + t.addItem("Root 1"); + t.addItem("Root 11"); + t.addItem("Root 111"); + t.addItem("Root 1111"); + t.addItem("Sub 1"); + t.setItemIcon("Sub 1", notCachedFolderIconLargeOther); + t.setParent("Sub 1", "Root 1"); + String longItemId = LoremIpsum.get(50); + t.addItem(longItemId); + t.setItemIcon(longItemId, notCachedFolderIconHuge); + t.setParent(longItemId, "Root 11"); + t.addItem("abcdefghijklmn"); + + String first = "abcdefghijklmnop"; + String second = "abcdefghijklmnopqrst"; + t.addItem(first); + t.addItem(second); + t.setParent(second, first); + t.setItemIcon(first, notCachedFolderIconLarge); + + HorizontalLayout hlay = new HorizontalLayout(); + hlay.setStyleName(Reindeer.LAYOUT_BLUE); + hlay.addComponent(t); + hlay.setWidth(-1, Sizeable.UNITS_PIXELS); + + Panel p = new Panel(); + p.setSizeUndefined(); + p.setContent(hlay); + + addComponent(p); + } + + @Override + protected String getDescription() { + return "A tree with icons should resize itself correctly so the nodes are not cut either horizontally or vertically."; + } + + @Override + protected Integer getTicketNumber() { + return 3529; + } + +}
\ No newline at end of file |