diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2012-10-16 13:03:08 +0300 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2012-10-16 13:25:39 +0300 |
commit | b888fd4ff5ddb973195394d8ddcb4e0ed2ea19f0 (patch) | |
tree | 06835ed10cce31cab4b29f6f4edea171d9f74e2c /server/tests/src | |
parent | 39515829548b0ff2097e4562c0d75e8d02074e15 (diff) | |
download | vaadin-framework-b888fd4ff5ddb973195394d8ddcb4e0ed2ea19f0.tar.gz vaadin-framework-b888fd4ff5ddb973195394d8ddcb4e0ed2ea19f0.zip |
Remove Navigator.SimpleViewDisplay (#9936)
Change-Id: I4c7e9ae14d7a50981d8da4909e6832d337fdf059
Diffstat (limited to 'server/tests/src')
-rw-r--r-- | server/tests/src/com/vaadin/tests/server/navigator/NavigatorTest.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/server/tests/src/com/vaadin/tests/server/navigator/NavigatorTest.java b/server/tests/src/com/vaadin/tests/server/navigator/NavigatorTest.java index cf8a2870a9..7e21b751dc 100644 --- a/server/tests/src/com/vaadin/tests/server/navigator/NavigatorTest.java +++ b/server/tests/src/com/vaadin/tests/server/navigator/NavigatorTest.java @@ -33,7 +33,9 @@ import com.vaadin.navigator.ViewDisplay; import com.vaadin.navigator.ViewProvider; import com.vaadin.tests.server.navigator.ClassBasedViewProviderTest.TestView; import com.vaadin.tests.server.navigator.ClassBasedViewProviderTest.TestView2; +import com.vaadin.ui.Component; import com.vaadin.ui.UI; +import com.vaadin.ui.VerticalLayout; public class NavigatorTest extends TestCase { @@ -348,6 +350,34 @@ public class NavigatorTest extends TestCase { } } + public void testComponentContainerViewDisplay() { + abstract class TestView implements Component, View { + } + + TestView tv1 = EasyMock.createNiceMock(TestView.class); + TestView tv2 = EasyMock.createNiceMock(TestView.class); + EasyMock.replay(tv1, tv2); + + VerticalLayout container = new VerticalLayout(); + ViewDisplay display = new Navigator.ComponentContainerViewDisplay( + container); + Navigator navigator = createNavigator(new NullFragmentManager(), + display); + + navigator.addView("tv1", tv1); + navigator.addView("tv2", tv2); + + navigator.navigateTo("tv1"); + + assertSame(tv1, container.getComponent(0)); + assertEquals(1, container.getComponentCount()); + + navigator.navigateTo("tv2"); + + assertSame(tv2, container.getComponent(0)); + assertEquals(1, container.getComponentCount()); + } + public void testBlockNavigation() { IMocksControl control = EasyMock.createControl(); NavigationStateManager manager = control |