diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-07-26 14:54:24 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-07-26 14:54:24 +0300 |
commit | 27b5da863a558b028243439bbf77f4e5c6994104 (patch) | |
tree | 900577e71663883d2787790aabc2bcf4157e3b65 /tests/server-side/com/vaadin | |
parent | 6455d8a5f809c98d93f6bfe89fbe55a64c66a03f (diff) | |
download | vaadin-framework-27b5da863a558b028243439bbf77f4e5c6994104.tar.gz vaadin-framework-27b5da863a558b028243439bbf77f4e5c6994104.zip |
Update test to work with Vaadin 7
Diffstat (limited to 'tests/server-side/com/vaadin')
-rw-r--r-- | tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java | 32 |
1 files 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() { |