From 27b5da863a558b028243439bbf77f4e5c6994104 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Thu, 26 Jul 2012 14:54:24 +0300 Subject: [PATCH] Update test to work with Vaadin 7 --- .../server/TestStreamVariableMapping.java | 32 +++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java b/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java index 7e9aefcbd9..ca1bb45330 100644 --- a/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java +++ b/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java @@ -6,7 +6,9 @@ import org.easymock.EasyMock; import com.vaadin.Application; import com.vaadin.terminal.StreamVariable; +import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.gwt.server.CommunicationManager; +import com.vaadin.ui.Root; import com.vaadin.ui.Upload; public class TestStreamVariableMapping extends TestCase { @@ -19,7 +21,25 @@ public class TestStreamVariableMapping extends TestCase { @Override protected void setUp() throws Exception { - owner = new Upload(); + final Application application = new Application(); + final Root root = new Root() { + @Override + protected void init(WrappedRequest request) { + // TODO Auto-generated method stub + + } + + @Override + public Application getApplication() { + return application; + } + }; + owner = new Upload() { + @Override + public Root getRoot() { + return root; + } + }; streamVariable = EasyMock.createMock(StreamVariable.class); cm = createCommunicationManager(); @@ -29,20 +49,20 @@ public class TestStreamVariableMapping extends TestCase { public void testAddStreamVariable() { String targetUrl = cm.getStreamVariableTargetUrl(owner, variableName, streamVariable); - assertTrue(targetUrl.startsWith("app://APP/UPLOAD/PID0/myName/")); + assertTrue(targetUrl.startsWith("app://APP/UPLOAD/-1/1/myName/")); StreamVariable streamVariable2 = cm.getStreamVariable( - cm.getPaintableId(owner), variableName); + owner.getConnectorId(), variableName); assertSame(streamVariable, streamVariable2); } public void testRemoverVariable() { cm.getStreamVariableTargetUrl(owner, variableName, streamVariable); - assertNotNull(cm.getStreamVariable(cm.getPaintableId(owner), - variableName)); + assertNotNull(cm + .getStreamVariable(owner.getConnectorId(), variableName)); cm.cleanStreamVariable(owner, variableName); - assertNull(cm.getStreamVariable(cm.getPaintableId(owner), variableName)); + assertNull(cm.getStreamVariable(owner.getConnectorId(), variableName)); } private CommunicationManager createCommunicationManager() { -- 2.39.5