]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed test issue apparently caused by three levels of classes
authorArtur Signell <artur@vaadin.com>
Thu, 13 Jun 2013 17:12:53 +0000 (20:12 +0300)
committerArtur Signell <artur@vaadin.com>
Thu, 13 Jun 2013 17:14:47 +0000 (20:14 +0300)
Change-Id: I4985e39257d55eada134f340fb9981285c9bb26f

server/tests/src/com/vaadin/server/MockUIContainingServlet.java [new file with mode: 0644]
server/tests/src/com/vaadin/server/VaadinServletConfigurationTest.java

diff --git a/server/tests/src/com/vaadin/server/MockUIContainingServlet.java b/server/tests/src/com/vaadin/server/MockUIContainingServlet.java
new file mode 100644 (file)
index 0000000..d54242e
--- /dev/null
@@ -0,0 +1,16 @@
+package com.vaadin.server;
+
+import com.vaadin.ui.UI;
+
+public class MockUIContainingServlet extends UI {
+
+    public static class ServletInUI extends VaadinServlet {
+        // This servlet should automatically be configured to use the
+        // enclosing UI class
+    }
+
+    @Override
+    protected void init(VaadinRequest request) {
+        // Do nothing
+    }
+}
index d347534f5c9ed3ec0fcf06b99253c6459f2f0aac..3098970e6adec4599b46bb54598b27cd71947f5e 100644 (file)
@@ -31,34 +31,21 @@ import org.junit.Test;
 
 import com.vaadin.annotations.VaadinServletConfiguration;
 import com.vaadin.server.DeploymentConfiguration.LegacyProperyToStringMode;
-import com.vaadin.server.VaadinServletConfigurationTest.MockUI;
-import com.vaadin.server.VaadinServletConfigurationTest.MockUI.ServletInUI;
+import com.vaadin.server.MockUIContainingServlet.ServletInUI;
 import com.vaadin.ui.UI;
 
 public class VaadinServletConfigurationTest {
-    public static class MockUI extends UI {
-
-        public static class ServletInUI extends VaadinServlet {
-            // This servlet should automatically be configured to use the
-            // enclosing UI class
-        }
-
-        @Override
-        protected void init(VaadinRequest request) {
-            // Do nothing
-        }
-    }
 
     @Test
     public void testEnclosingUIClass() throws Exception {
-        ServletInUI servlet = new MockUI.ServletInUI();
+        ServletInUI servlet = new MockUIContainingServlet.ServletInUI();
         servlet.init(new MockServletConfig());
 
         Class<? extends UI> uiClass = new DefaultUIProvider()
                 .getUIClass(new UIClassSelectionEvent(new VaadinServletRequest(
                         EasyMock.createMock(HttpServletRequest.class), servlet
                                 .getService())));
-        Assert.assertEquals(MockUI.class, uiClass);
+        Assert.assertEquals(MockUIContainingServlet.class, uiClass);
     }
 
     @Test
@@ -79,7 +66,7 @@ public class VaadinServletConfigurationTest {
                 .getUIClass(new UIClassSelectionEvent(new VaadinServletRequest(
                         EasyMock.createMock(HttpServletRequest.class), servlet
                                 .getService())));
-        Assert.assertEquals(MockUI.class, uiClass);
+        Assert.assertEquals(MockUIContainingServlet.class, uiClass);
     }
 
     @Test
@@ -107,11 +94,11 @@ public class VaadinServletConfigurationTest {
                 .getUIClass(new UIClassSelectionEvent(new VaadinServletRequest(
                         EasyMock.createMock(HttpServletRequest.class), servlet
                                 .getService())));
-        Assert.assertEquals(MockUI.class, uiClass);
+        Assert.assertEquals(MockUIContainingServlet.class, uiClass);
     }
 }
 
-@VaadinServletConfiguration(productionMode = true, ui = MockUI.class, closeIdleSessions = true, heartbeatInterval = 1234, resourceCacheTime = 4321)
+@VaadinServletConfiguration(productionMode = true, ui = MockUIContainingServlet.class, closeIdleSessions = true, heartbeatInterval = 1234, resourceCacheTime = 4321)
 class TestServlet extends VaadinServlet {
 
 }