diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-09-28 14:22:00 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-09-28 14:22:00 +0300 |
commit | 9d73de5162b57e85dba00ca8c5f3ebf47b4ed240 (patch) | |
tree | 92eea42da9c7624a63df3c1b7a5b7f3c91fafb0b /server/tests | |
parent | af8fb8ddd2ab54c08a8ac2c120a8d357c98057ec (diff) | |
download | vaadin-framework-9d73de5162b57e85dba00ca8c5f3ebf47b4ed240.tar.gz vaadin-framework-9d73de5162b57e85dba00ca8c5f3ebf47b4ed240.zip |
Ensure there's a service for each session (#9733)
Change-Id: I9425c2d33fd09759b18930741344e9181dc79364
Diffstat (limited to 'server/tests')
10 files changed, 18 insertions, 16 deletions
diff --git a/server/tests/src/com/vaadin/tests/data/converter/ConverterFactory.java b/server/tests/src/com/vaadin/tests/data/converter/ConverterFactory.java index 72747dca2d..0ba7779e79 100644 --- a/server/tests/src/com/vaadin/tests/data/converter/ConverterFactory.java +++ b/server/tests/src/com/vaadin/tests/data/converter/ConverterFactory.java @@ -66,7 +66,8 @@ public class ConverterFactory extends TestCase { public void testApplicationConverterFactoryInBackgroundThread() { VaadinServiceSession.setCurrent(null); - final VaadinServiceSession appWithCustomIntegerConverter = new VaadinServiceSession(); + final VaadinServiceSession appWithCustomIntegerConverter = new VaadinServiceSession( + null); appWithCustomIntegerConverter .setConverterFactory(new ConverterFactory42()); @@ -83,7 +84,8 @@ public class ConverterFactory extends TestCase { } public void testApplicationConverterFactoryForDetachedComponent() { - final VaadinServiceSession appWithCustomIntegerConverter = new VaadinServiceSession(); + final VaadinServiceSession appWithCustomIntegerConverter = new VaadinServiceSession( + null); appWithCustomIntegerConverter .setConverterFactory(new ConverterFactory42()); VaadinServiceSession.setCurrent(appWithCustomIntegerConverter); @@ -96,10 +98,11 @@ public class ConverterFactory extends TestCase { } public void testApplicationConverterFactoryForDifferentThanCurrentApplication() { - final VaadinServiceSession fieldAppWithCustomIntegerConverter = new VaadinServiceSession(); + final VaadinServiceSession fieldAppWithCustomIntegerConverter = new VaadinServiceSession( + null); fieldAppWithCustomIntegerConverter .setConverterFactory(new ConverterFactory42()); - VaadinServiceSession.setCurrent(new VaadinServiceSession()); + VaadinServiceSession.setCurrent(new VaadinServiceSession(null)); TextField tf = new TextField("", "123") { @Override diff --git a/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java b/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java index 0130086371..5c74077ca9 100644 --- a/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java +++ b/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java @@ -21,7 +21,7 @@ public class TestStreamVariableMapping extends TestCase { @Override protected void setUp() throws Exception { - final VaadinServiceSession application = new VaadinServiceSession(); + final VaadinServiceSession application = new VaadinServiceSession(null); final UI uI = new UI() { @Override protected void init(VaadinRequest request) { @@ -66,7 +66,7 @@ public class TestStreamVariableMapping extends TestCase { } private CommunicationManager createCommunicationManager() { - return new CommunicationManager(new VaadinServiceSession()); + return new CommunicationManager(new VaadinServiceSession(null)); } } diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java b/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java index faec1d99a1..8d4cdc3c7c 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java @@ -186,7 +186,7 @@ public class AbstractFieldValueConversions extends TestCase { } public void testNumberDoubleConverterChange() { - final VaadinServiceSession a = new VaadinServiceSession(); + final VaadinServiceSession a = new VaadinServiceSession(null); VaadinServiceSession.setCurrent(a); TextField tf = new TextField() { @Override diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractfield/DefaultConverterFactory.java b/server/tests/src/com/vaadin/tests/server/component/abstractfield/DefaultConverterFactory.java index b29876ef3c..43a7d90922 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractfield/DefaultConverterFactory.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractfield/DefaultConverterFactory.java @@ -26,7 +26,7 @@ public class DefaultConverterFactory extends TestCase { } public void testDefaultNumberConversion() { - VaadinServiceSession app = new VaadinServiceSession(); + VaadinServiceSession app = new VaadinServiceSession(null); VaadinServiceSession.setCurrent(app); TextField tf = new TextField(); tf.setLocale(new Locale("en", "US")); diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java b/server/tests/src/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java index bfa79ec9c8..83bb7c4613 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java @@ -18,9 +18,8 @@ public class RemoveListenersOnDetach { int numReadOnlyChanges = 0; AbstractField field = new AbstractField() { - final private VaadinServiceSession application = new VaadinServiceSession() { - - }; + final private VaadinServiceSession application = new VaadinServiceSession( + null); private UI uI = new UI() { @Override diff --git a/server/tests/src/com/vaadin/tests/server/component/label/LabelConverters.java b/server/tests/src/com/vaadin/tests/server/component/label/LabelConverters.java index 37363e7d4b..68e983f8a5 100644 --- a/server/tests/src/com/vaadin/tests/server/component/label/LabelConverters.java +++ b/server/tests/src/com/vaadin/tests/server/component/label/LabelConverters.java @@ -37,7 +37,7 @@ public class LabelConverters extends TestCase { } public void testIntegerDataSource() { - VaadinServiceSession.setCurrent(new VaadinServiceSession()); + VaadinServiceSession.setCurrent(new VaadinServiceSession(null)); Label l = new Label("Foo"); Property ds = new MethodProperty<Integer>(Person.createTestPerson1(), "age"); diff --git a/server/tests/src/com/vaadin/tests/server/component/root/CustomUIClassLoader.java b/server/tests/src/com/vaadin/tests/server/component/root/CustomUIClassLoader.java index 161165cf64..e071c0e484 100644 --- a/server/tests/src/com/vaadin/tests/server/component/root/CustomUIClassLoader.java +++ b/server/tests/src/com/vaadin/tests/server/component/root/CustomUIClassLoader.java @@ -113,7 +113,7 @@ public class CustomUIClassLoader extends TestCase { } private VaadinServiceSession createStubApplication() { - return new VaadinServiceSession() { + return new VaadinServiceSession(null) { @Override public DeploymentConfiguration getConfiguration() { return createConfigurationMock(); diff --git a/server/tests/src/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java b/server/tests/src/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java index 19cf69422f..8aac9a9598 100644 --- a/server/tests/src/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java +++ b/server/tests/src/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java @@ -25,7 +25,7 @@ public class AddRemoveSubWindow { @Test public void addSubWindow() { - VaadinServiceSession.setCurrent(new VaadinServiceSession()); + VaadinServiceSession.setCurrent(new VaadinServiceSession(null)); TestApp app = new TestApp(); app.init(); Window subWindow = new Window("Sub window"); diff --git a/server/tests/src/com/vaadin/tests/server/component/window/AttachDetachWindow.java b/server/tests/src/com/vaadin/tests/server/component/window/AttachDetachWindow.java index 5374641bea..a00e5e0996 100644 --- a/server/tests/src/com/vaadin/tests/server/component/window/AttachDetachWindow.java +++ b/server/tests/src/com/vaadin/tests/server/component/window/AttachDetachWindow.java @@ -15,7 +15,7 @@ import com.vaadin.ui.Window; public class AttachDetachWindow { - private VaadinServiceSession testApp = new VaadinServiceSession(); + private VaadinServiceSession testApp = new VaadinServiceSession(null); private interface TestContainer { public boolean attachCalled(); diff --git a/server/tests/src/com/vaadin/ui/LabelDataSource.java b/server/tests/src/com/vaadin/ui/LabelDataSource.java index 30295553a2..506a635814 100644 --- a/server/tests/src/com/vaadin/ui/LabelDataSource.java +++ b/server/tests/src/com/vaadin/ui/LabelDataSource.java @@ -39,7 +39,7 @@ public class LabelDataSource { @Before public void setup() { - vaadinSession = new VaadinServiceSession(); + vaadinSession = new VaadinServiceSession(null); VaadinServiceSession.setCurrent(vaadinSession); label = new Label(); |