]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed automated test after refactoring: reference to context.startTransaction()
authorHenri Sara <henri.sara@itmill.com>
Tue, 1 Dec 2009 07:07:12 +0000 (07:07 +0000)
committerHenri Sara <henri.sara@itmill.com>
Tue, 1 Dec 2009 07:07:12 +0000 (07:07 +0000)
svn changeset:10109/svn branch:6.2

tests/src/com/vaadin/tests/server/TransactionListenersConcurrency.java

index d33163ddae9d2685b67535e4db443e64fdc5d3b0..c3e914a806af71bf7a4a6ed24605d26e19b66031 100644 (file)
@@ -13,7 +13,6 @@ import java.util.List;
 import java.util.Properties;\r
 import java.util.Random;\r
 \r
-import javax.servlet.http.HttpServletRequest;\r
 import javax.servlet.http.HttpSession;\r
 \r
 import junit.framework.TestCase;\r
@@ -22,6 +21,7 @@ import org.easymock.EasyMock;
 \r
 import com.vaadin.Application;\r
 import com.vaadin.service.ApplicationContext.TransactionListener;\r
+import com.vaadin.terminal.gwt.server.AbstractWebApplicationContext;\r
 import com.vaadin.terminal.gwt.server.WebApplicationContext;\r
 \r
 public class TransactionListenersConcurrency extends TestCase {\r
@@ -32,7 +32,7 @@ public class TransactionListenersConcurrency extends TestCase {
      * transaction is then started for each application. Some semi-random delays\r
      * are included so that calls to addTransactionListener and\r
      * WebApplicationContext.startTransaction are mixed.\r
-     * \r
+     *\r
      */\r
     public void testTransactionListeners() throws Exception {\r
         final List<Throwable> exceptions = new ArrayList<Throwable>();\r
@@ -81,9 +81,9 @@ public class TransactionListenersConcurrency extends TestCase {
                         // Call the transaction listener using reflection as\r
                         // startTransaction is protected.\r
 \r
-                        Method m = context.getClass().getDeclaredMethod(\r
-                                "startTransaction", Application.class,\r
-                                HttpServletRequest.class);\r
+                        Method m = AbstractWebApplicationContext.class\r
+                                .getDeclaredMethod("startTransaction",\r
+                                        Application.class, Object.class);\r
                         m.setAccessible(true);\r
                         m.invoke(context, app, null);\r
                     } catch (Exception e) {\r
@@ -133,7 +133,7 @@ public class TransactionListenersConcurrency extends TestCase {
 \r
     /**\r
      * Creates a HttpSession mock\r
-     * \r
+     *\r
      */\r
     private static HttpSession createSession() {\r
         HttpSession session = createMock(HttpSession.class);\r
@@ -151,7 +151,7 @@ public class TransactionListenersConcurrency extends TestCase {
     /**\r
      * A transaction listener that just sleeps for the given amount of time in\r
      * transactionStart and transactionEnd.\r
-     * \r
+     *\r
      */\r
     public static class DelayTransactionListener implements TransactionListener {\r
 \r