diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-09-05 19:04:20 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-09-05 19:04:20 +0300 |
commit | d1c361e251800c6f7d596ddf79ed1c7569196856 (patch) | |
tree | 858d5965870a4810e5db37d8522aaa8064a78825 /server/tests/src/com/vaadin | |
parent | 5ab35cc6080653a7e9b25712f637db6c95c183ce (diff) | |
download | vaadin-framework-d1c361e251800c6f7d596ddf79ed1c7569196856.tar.gz vaadin-framework-d1c361e251800c6f7d596ddf79ed1c7569196856.zip |
Rename Application to VaadinSession (#9402)
Diffstat (limited to 'server/tests/src/com/vaadin')
9 files changed, 38 insertions, 38 deletions
diff --git a/server/tests/src/com/vaadin/tests/VaadinClasses.java b/server/tests/src/com/vaadin/tests/VaadinClasses.java index 15e1283e47..b30ddcee7e 100644 --- a/server/tests/src/com/vaadin/tests/VaadinClasses.java +++ b/server/tests/src/com/vaadin/tests/VaadinClasses.java @@ -15,7 +15,7 @@ import java.util.Enumeration; import java.util.List; import java.util.jar.JarEntry; -import com.vaadin.Application; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.Component; import com.vaadin.ui.ComponentContainer; import com.vaadin.ui.CustomComponent; @@ -144,7 +144,7 @@ public class VaadinClasses { String basePackage, String[] ignoredPackages) throws IOException { List<Class<? extends T>> classes = new ArrayList<Class<? extends T>>(); String basePackageDirName = "/" + basePackage.replace('.', '/'); - URL location = Application.class.getResource(basePackageDirName); + URL location = VaadinSession.class.getResource(basePackageDirName); if (location.getProtocol().equals("file")) { try { File f = new File(location.toURI()); 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 6393d61981..66160907b2 100644 --- a/server/tests/src/com/vaadin/tests/data/converter/ConverterFactory.java +++ b/server/tests/src/com/vaadin/tests/data/converter/ConverterFactory.java @@ -19,9 +19,9 @@ import java.util.Locale; import junit.framework.TestCase; -import com.vaadin.Application; import com.vaadin.data.util.converter.Converter; import com.vaadin.data.util.converter.DefaultConverterFactory; +import com.vaadin.server.VaadinSession; import com.vaadin.ui.TextField; public class ConverterFactory extends TestCase { @@ -65,14 +65,14 @@ public class ConverterFactory extends TestCase { } public void testApplicationConverterFactoryInBackgroundThread() { - Application.setCurrent(null); - final Application appWithCustomIntegerConverter = new Application(); + VaadinSession.setCurrent(null); + final VaadinSession appWithCustomIntegerConverter = new VaadinSession(); appWithCustomIntegerConverter .setConverterFactory(new ConverterFactory42()); TextField tf = new TextField("", "123") { @Override - public Application getApplication() { + public VaadinSession getApplication() { return appWithCustomIntegerConverter; }; }; @@ -83,10 +83,10 @@ public class ConverterFactory extends TestCase { } public void testApplicationConverterFactoryForDetachedComponent() { - final Application appWithCustomIntegerConverter = new Application(); + final VaadinSession appWithCustomIntegerConverter = new VaadinSession(); appWithCustomIntegerConverter .setConverterFactory(new ConverterFactory42()); - Application.setCurrent(appWithCustomIntegerConverter); + VaadinSession.setCurrent(appWithCustomIntegerConverter); TextField tf = new TextField("", "123"); tf.setConverter(Integer.class); @@ -96,14 +96,14 @@ public class ConverterFactory extends TestCase { } public void testApplicationConverterFactoryForDifferentThanCurrentApplication() { - final Application fieldAppWithCustomIntegerConverter = new Application(); + final VaadinSession fieldAppWithCustomIntegerConverter = new VaadinSession(); fieldAppWithCustomIntegerConverter .setConverterFactory(new ConverterFactory42()); - Application.setCurrent(new Application()); + VaadinSession.setCurrent(new VaadinSession()); TextField tf = new TextField("", "123") { @Override - public Application getApplication() { + public VaadinSession getApplication() { return fieldAppWithCustomIntegerConverter; } }; diff --git a/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java b/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java index 775348fb5c..e286e7231e 100644 --- a/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java +++ b/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java @@ -4,9 +4,9 @@ import junit.framework.TestCase; import org.easymock.EasyMock; -import com.vaadin.Application; import com.vaadin.server.CommunicationManager; import com.vaadin.server.StreamVariable; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WrappedRequest; import com.vaadin.ui.UI; import com.vaadin.ui.Upload; @@ -21,7 +21,7 @@ public class TestStreamVariableMapping extends TestCase { @Override protected void setUp() throws Exception { - final Application application = new Application(); + final VaadinSession application = new VaadinSession(); final UI uI = new UI() { @Override protected void init(WrappedRequest request) { @@ -30,7 +30,7 @@ public class TestStreamVariableMapping extends TestCase { } @Override - public Application getApplication() { + public VaadinSession getApplication() { return application; } }; @@ -66,7 +66,7 @@ public class TestStreamVariableMapping extends TestCase { } private CommunicationManager createCommunicationManager() { - return new CommunicationManager(new Application()); + return new CommunicationManager(new VaadinSession()); } } 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 57af748247..d372b96339 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 @@ -4,10 +4,10 @@ import java.util.Locale; import junit.framework.TestCase; -import com.vaadin.Application; import com.vaadin.data.util.MethodProperty; import com.vaadin.data.util.converter.Converter; import com.vaadin.data.util.converter.StringToIntegerConverter; +import com.vaadin.server.VaadinSession; import com.vaadin.tests.data.bean.Address; import com.vaadin.tests.data.bean.Country; import com.vaadin.tests.data.bean.Person; @@ -186,11 +186,11 @@ public class AbstractFieldValueConversions extends TestCase { } public void testNumberDoubleConverterChange() { - final Application a = new Application(); - Application.setCurrent(a); + final VaadinSession a = new VaadinSession(); + VaadinSession.setCurrent(a); TextField tf = new TextField() { @Override - public Application getApplication() { + public VaadinSession getApplication() { return a; } }; 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 25430fc9a5..a1b6541ee0 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 @@ -5,8 +5,8 @@ import java.util.Locale; import junit.framework.TestCase; -import com.vaadin.Application; import com.vaadin.data.util.MethodProperty; +import com.vaadin.server.VaadinSession; import com.vaadin.tests.data.bean.Address; import com.vaadin.tests.data.bean.Country; import com.vaadin.tests.data.bean.Person; @@ -26,8 +26,8 @@ public class DefaultConverterFactory extends TestCase { } public void testDefaultNumberConversion() { - Application app = new Application(); - Application.setCurrent(app); + VaadinSession app = new VaadinSession(); + VaadinSession.setCurrent(app); TextField tf = new TextField(); tf.setLocale(new Locale("en", "US")); tf.setPropertyDataSource(new MethodProperty<Integer>(paulaBean, 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 18567b62f0..b498bbe73f 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 @@ -4,10 +4,10 @@ import static org.junit.Assert.assertEquals; import org.junit.Test; -import com.vaadin.Application; import com.vaadin.data.Property; import com.vaadin.data.util.AbstractProperty; import com.vaadin.data.util.converter.Converter.ConversionException; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WrappedRequest; import com.vaadin.ui.AbstractField; import com.vaadin.ui.UI; @@ -18,7 +18,7 @@ public class RemoveListenersOnDetach { int numReadOnlyChanges = 0; AbstractField field = new AbstractField() { - final private Application application = new Application() { + final private VaadinSession application = new VaadinSession() { }; private UI uI = new UI() { @@ -29,7 +29,7 @@ public class RemoveListenersOnDetach { } @Override - public Application getApplication() { + public VaadinSession getApplication() { return application; } @@ -59,7 +59,7 @@ public class RemoveListenersOnDetach { }; @Override - public Application getApplication() { + public VaadinSession getApplication() { return application; }; }; 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 48279c7c88..22cd450af7 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 @@ -17,9 +17,9 @@ package com.vaadin.tests.server.component.label; import junit.framework.TestCase; -import com.vaadin.Application; import com.vaadin.data.Property; import com.vaadin.data.util.MethodProperty; +import com.vaadin.server.VaadinSession; import com.vaadin.tests.data.bean.Person; import com.vaadin.ui.Label; @@ -37,7 +37,7 @@ public class LabelConverters extends TestCase { } public void testIntegerDataSource() { - Application.setCurrent(new Application()); + VaadinSession.setCurrent(new VaadinSession()); 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 aef35084f8..acc2ed3b14 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 @@ -8,13 +8,13 @@ import junit.framework.TestCase; import org.easymock.EasyMock; -import com.vaadin.Application; -import com.vaadin.Application.ApplicationStartEvent; import com.vaadin.DefaultApplicationConfiguration; import com.vaadin.server.ApplicationConfiguration; import com.vaadin.server.DefaultUIProvider; import com.vaadin.server.DeploymentConfiguration; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WrappedRequest; +import com.vaadin.server.VaadinSession.ApplicationStartEvent; import com.vaadin.ui.UI; public class CustomUIClassLoader extends TestCase { @@ -53,7 +53,7 @@ public class CustomUIClassLoader extends TestCase { * if thrown */ public void testWithNullClassLoader() throws Exception { - Application application = createStubApplication(); + VaadinSession application = createStubApplication(); application.start(new ApplicationStartEvent(null, createConfigurationMock(), null)); @@ -66,7 +66,7 @@ public class CustomUIClassLoader extends TestCase { private static ApplicationConfiguration createConfigurationMock() { Properties properties = new Properties(); - properties.put(Application.UI_PARAMETER, MyUI.class.getName()); + properties.put(VaadinSession.UI_PARAMETER, MyUI.class.getName()); return new DefaultApplicationConfiguration(CustomUIClassLoader.class, properties); } @@ -97,7 +97,7 @@ public class CustomUIClassLoader extends TestCase { public void testWithClassLoader() throws Exception { LoggingClassLoader loggingClassLoader = new LoggingClassLoader(); - Application application = createStubApplication(); + VaadinSession application = createStubApplication(); application.start(new ApplicationStartEvent(null, createConfigurationMock(), null)); @@ -112,8 +112,8 @@ public class CustomUIClassLoader extends TestCase { } - private Application createStubApplication() { - return new Application() { + private VaadinSession createStubApplication() { + return new VaadinSession() { @Override public ApplicationConfiguration getConfiguration() { return createConfigurationMock(); 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 0fb0765c9f..bab7ca2c8c 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 @@ -5,7 +5,7 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; -import com.vaadin.Application; +import com.vaadin.server.VaadinSession; import com.vaadin.server.WrappedRequest; import com.vaadin.ui.Label; import com.vaadin.ui.UI; @@ -14,7 +14,7 @@ import com.vaadin.ui.Window; public class AttachDetachWindow { - private Application testApp = new Application(); + private VaadinSession testApp = new VaadinSession(); private interface TestContainer { public boolean attachCalled(); @@ -23,7 +23,7 @@ public class AttachDetachWindow { public TestContent getTestContent(); - public Application getApplication(); + public VaadinSession getApplication(); } private class TestWindow extends Window implements TestContainer { |