summaryrefslogtreecommitdiffstats
path: root/server/tests
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2012-11-13 18:08:29 +0200
committerArtur Signell <artur@vaadin.com>2012-11-13 18:18:40 +0200
commit391884746fda1781c55b13bc200dd75373f69141 (patch)
tree0d5a8dcd9d13c5c39813d81252506e12d72741af /server/tests
parent4628bcc3062ef19ed9d561f79fe3bfb3696d6e04 (diff)
downloadvaadin-framework-391884746fda1781c55b13bc200dd75373f69141.tar.gz
vaadin-framework-391884746fda1781c55b13bc200dd75373f69141.zip
UI based on AbstractBasicComponentContainer (#2924)
Change-Id: I1614a3464b8e7a0e9ecdd8c3a76335cdb85bdf87
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/abstractcomponentcontainer/TestAbstractComponentContainerListeners.java8
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/ui/LegacyUIAddRemoveComponents.java (renamed from server/tests/src/com/vaadin/tests/server/component/ui/UIAddRemoveComponents.java)12
-rw-r--r--server/tests/src/com/vaadin/tests/server/components/ComponentAttachDetachListenerTest.java34
-rw-r--r--server/tests/src/com/vaadin/ui/LabelDataSource.java2
4 files changed, 28 insertions, 28 deletions
diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractcomponentcontainer/TestAbstractComponentContainerListeners.java b/server/tests/src/com/vaadin/tests/server/component/abstractcomponentcontainer/TestAbstractComponentContainerListeners.java
index f9f170eb2a..9763354b57 100644
--- a/server/tests/src/com/vaadin/tests/server/component/abstractcomponentcontainer/TestAbstractComponentContainerListeners.java
+++ b/server/tests/src/com/vaadin/tests/server/component/abstractcomponentcontainer/TestAbstractComponentContainerListeners.java
@@ -1,10 +1,10 @@
package com.vaadin.tests.server.component.abstractcomponentcontainer;
import com.vaadin.tests.server.component.AbstractListenerMethodsTest;
-import com.vaadin.ui.ComponentContainer.ComponentAttachEvent;
-import com.vaadin.ui.ComponentContainer.ComponentAttachListener;
-import com.vaadin.ui.ComponentContainer.ComponentDetachEvent;
-import com.vaadin.ui.ComponentContainer.ComponentDetachListener;
+import com.vaadin.ui.HasComponents.ComponentAttachEvent;
+import com.vaadin.ui.HasComponents.ComponentAttachListener;
+import com.vaadin.ui.HasComponents.ComponentDetachEvent;
+import com.vaadin.ui.HasComponents.ComponentDetachListener;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.VerticalLayout;
diff --git a/server/tests/src/com/vaadin/tests/server/component/ui/UIAddRemoveComponents.java b/server/tests/src/com/vaadin/tests/server/component/ui/LegacyUIAddRemoveComponents.java
index 1b07321605..1a5e19e0da 100644
--- a/server/tests/src/com/vaadin/tests/server/component/ui/UIAddRemoveComponents.java
+++ b/server/tests/src/com/vaadin/tests/server/component/ui/LegacyUIAddRemoveComponents.java
@@ -9,11 +9,11 @@ import org.junit.Test;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
-import com.vaadin.ui.UI;
+import com.vaadin.ui.LegacyWindow;
-public class UIAddRemoveComponents {
+public class LegacyUIAddRemoveComponents {
- private static class TestUI extends UI {
+ private static class TestUI extends LegacyWindow {
@Override
protected void init(VaadinRequest request) {
}
@@ -21,7 +21,7 @@ public class UIAddRemoveComponents {
@Test
public void addComponent() {
- UI ui = new TestUI();
+ TestUI ui = new TestUI();
Component c = new Label("abc");
ui.addComponent(c);
@@ -34,7 +34,7 @@ public class UIAddRemoveComponents {
@Test
public void removeComponent() {
- UI ui = new TestUI();
+ TestUI ui = new TestUI();
Component c = new Label("abc");
ui.addComponent(c);
@@ -49,7 +49,7 @@ public class UIAddRemoveComponents {
@Test
public void replaceComponent() {
- UI ui = new TestUI();
+ TestUI ui = new TestUI();
Component c = new Label("abc");
Component d = new Label("def");
diff --git a/server/tests/src/com/vaadin/tests/server/components/ComponentAttachDetachListenerTest.java b/server/tests/src/com/vaadin/tests/server/components/ComponentAttachDetachListenerTest.java
index 3ba1c4c7f1..df515795eb 100644
--- a/server/tests/src/com/vaadin/tests/server/components/ComponentAttachDetachListenerTest.java
+++ b/server/tests/src/com/vaadin/tests/server/components/ComponentAttachDetachListenerTest.java
@@ -8,14 +8,14 @@ import com.vaadin.ui.AbsoluteLayout;
import com.vaadin.ui.AbsoluteLayout.ComponentPosition;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Component;
-import com.vaadin.ui.ComponentContainer;
-import com.vaadin.ui.ComponentContainer.ComponentAttachEvent;
-import com.vaadin.ui.ComponentContainer.ComponentAttachListener;
-import com.vaadin.ui.ComponentContainer.ComponentDetachEvent;
-import com.vaadin.ui.ComponentContainer.ComponentDetachListener;
import com.vaadin.ui.CssLayout;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.GridLayout.Area;
+import com.vaadin.ui.HasComponents;
+import com.vaadin.ui.HasComponents.ComponentAttachEvent;
+import com.vaadin.ui.HasComponents.ComponentAttachListener;
+import com.vaadin.ui.HasComponents.ComponentDetachEvent;
+import com.vaadin.ui.HasComponents.ComponentDetachListener;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
@@ -29,12 +29,12 @@ public class ComponentAttachDetachListenerTest extends TestCase {
// General variables
private int attachCounter = 0;
private Component attachedComponent = null;
- private ComponentContainer attachTarget = null;
+ private HasComponents attachTarget = null;
private boolean foundInContainer = false;
private int detachCounter = 0;
private Component detachedComponent = null;
- private ComponentContainer detachedTarget = null;
+ private HasComponents detachedTarget = null;
// Ordered layout specific variables
private int indexOfComponent = -1;
@@ -53,7 +53,7 @@ public class ComponentAttachDetachListenerTest extends TestCase {
attachTarget = event.getContainer();
// Search for component in container (should be found)
- Iterator<Component> iter = attachTarget.getComponentIterator();
+ Iterator<Component> iter = attachTarget.iterator();
while (iter.hasNext()) {
if (iter.next() == attachedComponent) {
foundInContainer = true;
@@ -83,7 +83,7 @@ public class ComponentAttachDetachListenerTest extends TestCase {
detachedTarget = event.getContainer();
// Search for component in container (should NOT be found)
- Iterator<Component> iter = detachedTarget.getComponentIterator();
+ Iterator<Component> iter = detachedTarget.iterator();
while (iter.hasNext()) {
if (iter.next() == detachedComponent) {
foundInContainer = true;
@@ -129,20 +129,20 @@ public class ComponentAttachDetachListenerTest extends TestCase {
super.setUp();
olayout = new HorizontalLayout();
- olayout.addListener(new MyAttachListener());
- olayout.addListener(new MyDetachListener());
+ olayout.addComponentAttachListener(new MyAttachListener());
+ olayout.addComponentDetachListener(new MyDetachListener());
gridlayout = new GridLayout();
- gridlayout.addListener(new MyAttachListener());
- gridlayout.addListener(new MyDetachListener());
+ gridlayout.addComponentAttachListener(new MyAttachListener());
+ gridlayout.addComponentDetachListener(new MyDetachListener());
absolutelayout = new AbsoluteLayout();
- absolutelayout.addListener(new MyAttachListener());
- absolutelayout.addListener(new MyDetachListener());
+ absolutelayout.addComponentAttachListener(new MyAttachListener());
+ absolutelayout.addComponentDetachListener(new MyDetachListener());
csslayout = new CssLayout();
- csslayout.addListener(new MyAttachListener());
- csslayout.addListener(new MyDetachListener());
+ csslayout.addComponentAttachListener(new MyAttachListener());
+ csslayout.addComponentDetachListener(new MyDetachListener());
}
public void testOrderedLayoutAttachListener() {
diff --git a/server/tests/src/com/vaadin/ui/LabelDataSource.java b/server/tests/src/com/vaadin/ui/LabelDataSource.java
index 506a635814..7ef8d67c2a 100644
--- a/server/tests/src/com/vaadin/ui/LabelDataSource.java
+++ b/server/tests/src/com/vaadin/ui/LabelDataSource.java
@@ -122,7 +122,7 @@ public class LabelDataSource {
label.setPropertyDataSource(integerDataSource);
UI ui = new MockUI();
ui.setLocale(Locale.GERMANY);
- ui.addComponent(label);
+ ui.setContent(label);
Assert.assertEquals(INTEGER_STRING_VALUE_DE, label.getState().text);
}
}