summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2012-08-28 10:06:06 +0300
committerJohn Ahlroos <john@vaadin.com>2012-08-28 10:06:06 +0300
commit04664a99cd88442b87d147e5951caef07742ddc2 (patch)
treec5b94fe8f68a45356bcb43410b4508e22a53e3af /tests
parent435a2e735251464529f8329b0563c26d5b4cc6a9 (diff)
downloadvaadin-framework-04664a99cd88442b87d147e5951caef07742ddc2.tar.gz
vaadin-framework-04664a99cd88442b87d147e5951caef07742ddc2.zip
Fixed conflicting issues from merge
Diffstat (limited to 'tests')
-rw-r--r--tests/testbench/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java80
-rw-r--r--tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutRenderTimeTest.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java30
-rw-r--r--tests/testbench/com/vaadin/tests/components/orderedlayout/VaadinTunesLayout.java22
-rw-r--r--tests/testbench/com/vaadin/tests/themes/LiferayThemeTest.java4
5 files changed, 82 insertions, 58 deletions
diff --git a/tests/testbench/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java b/tests/testbench/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java
index 86015a0109..d235086ca9 100644
--- a/tests/testbench/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java
+++ b/tests/testbench/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java
@@ -12,7 +12,7 @@ import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.terminal.UserError;
import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.AbstractField;
import com.vaadin.ui.AbstractOrderedLayout;
@@ -30,7 +30,7 @@ import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.Reindeer;
@Theme("tests-components")
-public class BoxLayoutTest extends AbstractTestRoot {
+public class BoxLayoutTest extends AbstractTestUI {
protected AbstractOrderedLayout view;
@@ -66,7 +66,7 @@ public class BoxLayoutTest extends AbstractTestRoot {
}
setContent(view);
- getApplication().setRootPreserved(true);
+ getApplication().setUiPreserved(true);
}
private Component createHorizontalTest() {
@@ -108,6 +108,7 @@ public class BoxLayoutTest extends AbstractTestRoot {
final CheckBox vertical = new CheckBox("Vertical", !horizontal);
vertical.setImmediate(true);
vertical.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
view.removeAllComponents();
@@ -124,37 +125,40 @@ public class BoxLayoutTest extends AbstractTestRoot {
Button addComponent = new Button("Add Component",
new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ GridLayout grid = new GridLayout(2, 2);
+ Button grow = new Button("Grow Me",
+ new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- GridLayout grid = new GridLayout(2, 2);
- Button grow = new Button("Grow Me",
- new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (event.getButton().getWidth() == -1) {
- event.getButton().setHeight("50px");
- event.getButton().setWidth("200px");
- } else {
- event.getButton()
- .setSizeUndefined();
- }
- }
- });
- grid.addComponent(new Label("Grid cell 1"));
- grid.addComponent(new Label("Grid cell 2"));
- grid.addComponent(grow);
- grid.addComponent(new Label("Grid cell 4"));
- l.addComponent(grid);
- // l.addComponent(new TextField("Some field"));
+ if (event.getButton().getWidth() == -1) {
+ event.getButton().setHeight("50px");
+ event.getButton().setWidth("200px");
+ } else {
+ event.getButton()
+ .setSizeUndefined();
+ }
}
});
+ grid.addComponent(new Label("Grid cell 1"));
+ grid.addComponent(new Label("Grid cell 2"));
+ grid.addComponent(grow);
+ grid.addComponent(new Label("Grid cell 4"));
+ l.addComponent(grid);
+ // l.addComponent(new TextField("Some field"));
+ }
+ });
header.addComponent(addComponent);
Button removeComponent = new Button("Remove Component",
new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- Component last = l.getComponent(l.getComponentCount() - 1);
- l.removeComponent(last);
- }
- });
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Component last = l.getComponent(l.getComponentCount() - 1);
+ l.removeComponent(last);
+ }
+ });
header.addComponent(removeComponent);
// Second row
@@ -175,6 +179,7 @@ public class BoxLayoutTest extends AbstractTestRoot {
final NativeSelect width = new NativeSelect(null, sizes);
width.setImmediate(true);
width.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if (width.getValue() != null) {
l.setWidth(width.getValue().toString());
@@ -188,6 +193,7 @@ public class BoxLayoutTest extends AbstractTestRoot {
final NativeSelect height = new NativeSelect(null, sizes);
height.setImmediate(true);
height.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if (height.getValue() != null) {
l.setHeight(height.getValue().toString());
@@ -200,6 +206,7 @@ public class BoxLayoutTest extends AbstractTestRoot {
final CheckBox margin = new CheckBox("Margin", false);
margin.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
l.setMargin(margin.getValue().booleanValue());
}
@@ -210,6 +217,7 @@ public class BoxLayoutTest extends AbstractTestRoot {
final CheckBox spacing = new CheckBox("Spacing", false);
spacing.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
l.setSpacing(spacing.getValue().booleanValue());
}
@@ -241,6 +249,7 @@ public class BoxLayoutTest extends AbstractTestRoot {
align.setNullSelectionAllowed(false);
align.select(Alignment.TOP_LEFT);
align.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if (target == null) {
return;
@@ -254,6 +263,7 @@ public class BoxLayoutTest extends AbstractTestRoot {
expand.setImmediate(true);
expand.setEnabled(false);
expand.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if (target != null) {
l.setExpandRatio(target, expand.getValue() ? 1 : 0);
@@ -276,6 +286,7 @@ public class BoxLayoutTest extends AbstractTestRoot {
componentWidth.setImmediate(true);
componentWidth.setEnabled(false);
componentWidth.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if (target == null) {
return;
@@ -294,6 +305,7 @@ public class BoxLayoutTest extends AbstractTestRoot {
componentHeight.setImmediate(true);
componentHeight.setEnabled(false);
componentHeight.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if (componentHeight.getValue() != null) {
target.setHeight(componentHeight.getValue().toString());
@@ -309,6 +321,7 @@ public class BoxLayoutTest extends AbstractTestRoot {
componentCaption.setImmediate(true);
componentCaption.setEnabled(false);
componentCaption.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if (componentCaption.getValue() != null) {
target.setCaption(componentCaption.getValue().toString());
@@ -324,6 +337,7 @@ public class BoxLayoutTest extends AbstractTestRoot {
componentIcon.setImmediate(true);
componentIcon.setEnabled(false);
componentIcon.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if (componentIcon.getValue() != null) {
target.setIcon(new ThemeResource(componentIcon.getValue()
@@ -339,6 +353,7 @@ public class BoxLayoutTest extends AbstractTestRoot {
componentDescription.setImmediate(true);
componentDescription.setEnabled(false);
componentDescription.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
target.setDescription(componentDescription.getValue());
}
@@ -349,6 +364,7 @@ public class BoxLayoutTest extends AbstractTestRoot {
componentError.setImmediate(true);
componentError.setEnabled(false);
componentError.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if (target != null) {
target.setComponentError(componentError.getValue() ? new UserError(
@@ -362,6 +378,7 @@ public class BoxLayoutTest extends AbstractTestRoot {
componentRequired.setImmediate(true);
componentRequired.setEnabled(false);
componentRequired.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if (target != null && target instanceof AbstractField) {
((AbstractField<?>) target).setRequired(componentRequired
@@ -389,6 +406,7 @@ public class BoxLayoutTest extends AbstractTestRoot {
l.addComponent(new Button("Component 2"));
l.addListener(new LayoutClickListener() {
+ @Override
public void layoutClick(LayoutClickEvent event) {
if (event.getChildComponent() == null
|| target == event.getChildComponent()) {
@@ -416,15 +434,15 @@ public class BoxLayoutTest extends AbstractTestRoot {
if (target != null) {
if (target.getWidth() > -1) {
componentWidth.select(new Float(target.getWidth())
- .intValue()
- + target.getWidthUnits().getSymbol());
+ .intValue()
+ + target.getWidthUnits().getSymbol());
} else {
componentWidth.select(null);
}
if (target.getHeight() > -1) {
componentHeight.select(new Float(target.getHeight())
- .intValue()
- + target.getHeightUnits().getSymbol());
+ .intValue()
+ + target.getHeightUnits().getSymbol());
} else {
componentHeight.select(null);
}
diff --git a/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutRenderTimeTest.java b/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutRenderTimeTest.java
index 871a467877..961ec86ab0 100644
--- a/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutRenderTimeTest.java
+++ b/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutRenderTimeTest.java
@@ -6,7 +6,7 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Root;
+import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.themes.Reindeer;
@@ -14,7 +14,7 @@ public class LayoutRenderTimeTest extends LegacyApplication {
@Override
public void init() {
- Root.LegacyWindow main = new Root.LegacyWindow();
+ UI.LegacyWindow main = new UI.LegacyWindow();
setMainWindow(main);
VerticalLayout root = new VerticalLayout();
diff --git a/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java b/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java
index 62c552ee75..c52543d6f2 100644
--- a/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java
+++ b/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java
@@ -37,27 +37,27 @@ public class LayoutResizeTest extends TestBase {
Button resize = new Button("Resize to 700x400",
new Button.ClickListener() {
- @Override
- public void buttonClick(ClickEvent event) {
- event.getButton()
- .getRoot()
- .getPage()
- .getJavaScript()
- .execute(
- "setTimeout(function() {window.resizeTo(700,400)}, 500)");
- }
- });
+ @Override
+ public void buttonClick(ClickEvent event) {
+ event.getButton()
+ .getUI()
+ .getPage()
+ .getJavaScript()
+ .execute(
+ "setTimeout(function() {window.resizeTo(700,400)}, 500)");
+ }
+ });
left.addComponent(resize);
resize = new Button("Resize to 900x600", new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
event.getButton()
- .getRoot()
- .getPage()
- .getJavaScript()
- .execute(
- "setTimeout(function() {window.resizeTo(900,600)}, 500)");
+ .getUI()
+ .getPage()
+ .getJavaScript()
+ .execute(
+ "setTimeout(function() {window.resizeTo(900,600)}, 500)");
}
});
left.addComponent(resize);
diff --git a/tests/testbench/com/vaadin/tests/components/orderedlayout/VaadinTunesLayout.java b/tests/testbench/com/vaadin/tests/components/orderedlayout/VaadinTunesLayout.java
index 973bd63d76..5ebb702baf 100644
--- a/tests/testbench/com/vaadin/tests/components/orderedlayout/VaadinTunesLayout.java
+++ b/tests/testbench/com/vaadin/tests/components/orderedlayout/VaadinTunesLayout.java
@@ -1,10 +1,12 @@
package com.vaadin.tests.components.orderedlayout;
import com.vaadin.annotations.Theme;
+import com.vaadin.shared.ui.MarginInfo;
+import com.vaadin.shared.ui.slider.SliderOrientation;
import com.vaadin.terminal.Sizeable;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.ComboBox;
@@ -19,7 +21,7 @@ import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
@Theme("tests-components")
-public class VaadinTunesLayout extends AbstractTestRoot {
+public class VaadinTunesLayout extends AbstractTestUI {
@Override
public void setup(WrappedRequest request) {
@@ -53,7 +55,9 @@ public class VaadinTunesLayout extends AbstractTestRoot {
// modes and search
HorizontalLayout top = new HorizontalLayout();
top.setWidth("100%");
- top.setMargin(false, true, false, true); // Enable horizontal margins
+ top.setMargin(new MarginInfo(false, true, false, true)); // Enable
+ // horizontal
+ // margins
top.setSpacing(true);
// Let's attach that one straight away too
@@ -100,7 +104,7 @@ public class VaadinTunesLayout extends AbstractTestRoot {
// Volume controls
Button mute = new NativeButton("mute");
Slider vol = new Slider();
- vol.setOrientation(Slider.ORIENTATION_HORIZONTAL);
+ vol.setOrientation(SliderOrientation.HORIZONTAL);
vol.setWidth("100px");
Button max = new NativeButton("max");
volume.addComponent(mute);
@@ -123,7 +127,7 @@ public class VaadinTunesLayout extends AbstractTestRoot {
track.setWidth(null);
album.setWidth(null);
Slider progress = new Slider();
- progress.setOrientation(Slider.ORIENTATION_HORIZONTAL);
+ progress.setOrientation(SliderOrientation.HORIZONTAL);
progress.setWidth("100%");
trackDetails.addComponent(track);
trackDetails.addComponent(album);
@@ -252,7 +256,7 @@ public class VaadinTunesLayout extends AbstractTestRoot {
"Bullet For My Valentine", "Chasing Victory", "Chimaira",
"Danko Jones", "Deadlock", "Deftones", "From Autumn To Ashes",
"Haste The Day", "Four Year Strong", "In Flames", "Kemopetrol",
- "John Legend" };
+ "John Legend" };
String[] albums = new String[] { "Once Again", "The Caitiff Choir",
"The Devil And God", "Light Grenades", "Dicthonomy",
"Back In Black", "Dreamer", "Come Clarity", "Year Zero",
@@ -261,7 +265,7 @@ public class VaadinTunesLayout extends AbstractTestRoot {
String[] genres = new String[] { "Rock", "Metal", "Hardcore", "Indie",
"Pop", "Alternative", "Blues", "Jazz", "Hip Hop",
"Electronica", "Punk", "Hard Rock", "Dance", "R'n'B", "Gospel",
- "Country" };
+ "Country" };
for (int i = 0; i < 1000; i++) {
NativeSelect s = new NativeSelect();
s.addItem("1 star");
@@ -294,7 +298,9 @@ public class VaadinTunesLayout extends AbstractTestRoot {
top.setHeight("75px"); // Same as the background image height
playback.setStyleName("playback");
- playback.setMargin(false, true, false, false); // Add right-side margin
+ playback.setMargin(new MarginInfo(false, true, false, false)); // Add
+ // right-side
+ // margin
play.setStyleName("play");
next.setStyleName("next");
prev.setStyleName("prev");
diff --git a/tests/testbench/com/vaadin/tests/themes/LiferayThemeTest.java b/tests/testbench/com/vaadin/tests/themes/LiferayThemeTest.java
index fa15d88799..f956a93cd5 100644
--- a/tests/testbench/com/vaadin/tests/themes/LiferayThemeTest.java
+++ b/tests/testbench/com/vaadin/tests/themes/LiferayThemeTest.java
@@ -2,13 +2,13 @@ package com.vaadin.tests.themes;
import com.vaadin.annotations.Theme;
import com.vaadin.terminal.WrappedRequest;
-import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.themes.LiferayTheme;
@Theme("liferay")
-public class LiferayThemeTest extends AbstractTestRoot {
+public class LiferayThemeTest extends AbstractTestUI {
@Override
protected void setup(WrappedRequest request) {