summaryrefslogtreecommitdiffstats
path: root/server/tests
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-09-04 16:48:13 +0300
committerLeif Åstrand <leif@vaadin.com>2012-09-05 11:39:35 +0300
commitc71563c8a6e9993cbbdff3ddfdfccfee4aa34f7b (patch)
tree8f35fb183d97efa07dfca8dcbc6f4b126e973d43 /server/tests
parent437e700dfc4173da66d45abd95b6f661d7216218 (diff)
downloadvaadin-framework-c71563c8a6e9993cbbdff3ddfdfccfee4aa34f7b.tar.gz
vaadin-framework-c71563c8a6e9993cbbdff3ddfdfccfee4aa34f7b.zip
Extract ApplicationConfiguration from DeploymentConfiguration (#9382)
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/src/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java4
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/root/CustomUIClassLoader.java24
2 files changed, 12 insertions, 16 deletions
diff --git a/server/tests/src/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java b/server/tests/src/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java
index b936cae1a5..2aa8d04364 100644
--- a/server/tests/src/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java
+++ b/server/tests/src/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java
@@ -13,6 +13,7 @@ import javax.servlet.http.HttpServletRequest;
import junit.framework.TestCase;
+import com.vaadin.DefaultApplicationConfiguration;
import com.vaadin.server.VaadinServlet.ServletDeploymentConfiguration;
public class TestAbstractApplicationServletStaticFilesLocation extends TestCase {
@@ -32,7 +33,8 @@ public class TestAbstractApplicationServletStaticFilesLocation extends TestCase
.getDeclaredField("deploymentConfiguration");
f.setAccessible(true);
f.set(servlet, new ServletDeploymentConfiguration(servlet,
- new Properties()));
+ new DefaultApplicationConfiguration(servlet.getClass(),
+ new Properties())));
}
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 89da55a31f..aef35084f8 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
@@ -10,6 +10,8 @@ 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.WrappedRequest;
@@ -62,15 +64,11 @@ public class CustomUIClassLoader extends TestCase {
assertEquals(MyUI.class, uiClass);
}
- private static DeploymentConfiguration createConfigurationMock() {
- DeploymentConfiguration configurationMock = EasyMock
- .createMock(DeploymentConfiguration.class);
- EasyMock.expect(configurationMock.isProductionMode()).andReturn(false);
- EasyMock.expect(configurationMock.getInitParameters()).andReturn(
- new Properties());
-
- EasyMock.replay(configurationMock);
- return configurationMock;
+ private static ApplicationConfiguration createConfigurationMock() {
+ Properties properties = new Properties();
+ properties.put(Application.UI_PARAMETER, MyUI.class.getName());
+ return new DefaultApplicationConfiguration(CustomUIClassLoader.class,
+ properties);
}
private static WrappedRequest createRequestMock(ClassLoader classloader) {
@@ -117,12 +115,8 @@ public class CustomUIClassLoader extends TestCase {
private Application createStubApplication() {
return new Application() {
@Override
- public String getProperty(String name) {
- if (name.equals(UI_PARAMETER)) {
- return MyUI.class.getName();
- } else {
- return super.getProperty(name);
- }
+ public ApplicationConfiguration getConfiguration() {
+ return createConfigurationMock();
}
};
}