summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-06-07 00:32:36 +0300
committerArtur Signell <artur@vaadin.com>2013-06-07 00:38:27 +0300
commit9efd4d676c1c68638cfdb6d70db076761f86c6fc (patch)
tree978d663a637f58f9f78c2ec1de93306af85266b2 /server
parent8eb567eb3e0650fcbaa7296e6ff4e42e8000e4ce (diff)
downloadvaadin-framework-9efd4d676c1c68638cfdb6d70db076761f86c6fc.tar.gz
vaadin-framework-9efd4d676c1c68638cfdb6d70db076761f86c6fc.zip
Fixed test issues
Change-Id: Iebf44d7bff598248fe1cda138ac1d8b4100775ba
Diffstat (limited to 'server')
-rw-r--r--server/tests/src/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java13
-rw-r--r--server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java7
-rw-r--r--server/tests/src/com/vaadin/ui/AbsFieldDataSourceLocaleChange.java3
3 files changed, 7 insertions, 16 deletions
diff --git a/server/tests/src/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java b/server/tests/src/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java
index 2a83f5d5b2..3f940ae0a7 100644
--- a/server/tests/src/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java
+++ b/server/tests/src/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java
@@ -4,10 +4,8 @@ import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
-import java.lang.reflect.Field;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.Properties;
import javax.servlet.http.HttpServletRequest;
@@ -24,16 +22,7 @@ public class TestAbstractApplicationServletStaticFilesLocation extends TestCase
super.setUp();
servlet = new VaadinServlet();
-
- // Workaround to avoid calling init and creating servlet config
- Field f = VaadinServlet.class.getDeclaredField("servletService");
- f.setAccessible(true);
- VaadinServletService service = new VaadinServletService(servlet,
- new DefaultDeploymentConfiguration(servlet.getClass(),
- new Properties()));
- service.init();
- f.set(servlet, service);
-
+ servlet.init(new MockServletConfig());
}
public void testWidgetSetLocation() throws Exception {
diff --git a/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java b/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java
index bee932a29f..fcc54a989d 100644
--- a/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java
+++ b/server/tests/src/com/vaadin/tests/server/TestStreamVariableMapping.java
@@ -5,6 +5,7 @@ import junit.framework.TestCase;
import org.easymock.EasyMock;
import com.vaadin.server.LegacyCommunicationManager;
+import com.vaadin.server.MockServletConfig;
import com.vaadin.server.StreamVariable;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
@@ -78,10 +79,10 @@ public class TestStreamVariableMapping extends TestCase {
private LegacyCommunicationManager createCommunicationManager()
throws Exception {
- VaadinServletService vss = new VaadinServletService(
- EasyMock.createMock(VaadinServlet.class),
+ VaadinServlet servlet = new VaadinServlet();
+ VaadinServletService vss = new VaadinServletService(servlet,
new MockDeploymentConfiguration());
- vss.init();
+ servlet.init(new MockServletConfig());
return new LegacyCommunicationManager(
new AlwaysLockedVaadinSession(vss));
}
diff --git a/server/tests/src/com/vaadin/ui/AbsFieldDataSourceLocaleChange.java b/server/tests/src/com/vaadin/ui/AbsFieldDataSourceLocaleChange.java
index acea0a84c7..55d5771f80 100644
--- a/server/tests/src/com/vaadin/ui/AbsFieldDataSourceLocaleChange.java
+++ b/server/tests/src/com/vaadin/ui/AbsFieldDataSourceLocaleChange.java
@@ -11,6 +11,7 @@ import org.junit.Test;
import com.vaadin.data.util.converter.StringToIntegerConverter;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinSession;
+import com.vaadin.tests.util.AlwaysLockedVaadinSession;
public class AbsFieldDataSourceLocaleChange {
@@ -19,7 +20,7 @@ public class AbsFieldDataSourceLocaleChange {
@Before
public void setup() {
- vaadinSession = new VaadinSession(null);
+ vaadinSession = new AlwaysLockedVaadinSession(null);
VaadinSession.setCurrent(vaadinSession);
ui = new UI() {