click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r1027859 - /click/trunk/click/mock/test/org/apache/click/MockContextTest.java
Date Wed, 27 Oct 2010 08:55:11 GMT
Author: sabob
Date: Wed Oct 27 08:55:11 2010
New Revision: 1027859

URL: http://svn.apache.org/viewvc?rev=1027859&view=rev
Log:
Moved Ajax functionality into AjaxBehavior

Modified:
    click/trunk/click/mock/test/org/apache/click/MockContextTest.java

Modified: click/trunk/click/mock/test/org/apache/click/MockContextTest.java
URL: http://svn.apache.org/viewvc/click/trunk/click/mock/test/org/apache/click/MockContextTest.java?rev=1027859&r1=1027858&r2=1027859&view=diff
==============================================================================
--- click/trunk/click/mock/test/org/apache/click/MockContextTest.java (original)
+++ click/trunk/click/mock/test/org/apache/click/MockContextTest.java Wed Oct 27 08:55:11
2010
@@ -19,7 +19,7 @@
 package org.apache.click;
 
 import junit.framework.TestCase;
-import org.apache.click.ajax.AjaxBehavior;
+import org.apache.click.ajax.DefaultAjaxBehavior;
 import org.apache.click.control.Submit;
 import org.apache.click.servlet.MockServletConfig;
 import org.apache.click.servlet.MockServletContext;
@@ -139,8 +139,7 @@ public class MockContextTest extends Tes
 
         Submit submit = new Submit("save");
         // Register an ajax behavior
-        submit.addBehavior(new AjaxBehavior() {
-            private static final long serialVersionUID = 1L;
+        submit.addBehavior(new DefaultAjaxBehavior() {
 
             @Override
             public ActionResult onAction(Control source) {
@@ -154,7 +153,7 @@ public class MockContextTest extends Tes
         ActionEventDispatcher dispatcher = ActionEventDispatcher.getThreadLocalDispatcher();
 
         // Assert there is one behavior registered
-        assertEquals(1, dispatcher.getBehaviorSourceSet().size());
+        assertEquals(1, dispatcher.getAjaxBehaviorSourceSet().size());
 
         // Fire all behaviors registered in the onProcess method
         context.executeBehaviors();
@@ -162,7 +161,7 @@ public class MockContextTest extends Tes
         assertTrue("Submit behavior was not invoked", submitCalled);
 
         // Assert there are no behaviors registered after reset is invoked
-        assertEquals(0, dispatcher.getBehaviorSourceSet().size());
+        assertEquals(0, dispatcher.getAjaxBehaviorSourceSet().size());
     }
 
     /**
@@ -176,8 +175,7 @@ public class MockContextTest extends Tes
 
         Submit submit = new Submit("save");
         // Register an ajax behavior
-        submit.addBehavior(new AjaxBehavior() {
-            private static final long serialVersionUID = 1L;
+        submit.addBehavior(new DefaultAjaxBehavior() {
 
             @Override
             public ActionResult onAction(Control source) {
@@ -190,13 +188,13 @@ public class MockContextTest extends Tes
         ActionEventDispatcher dispatcher = ActionEventDispatcher.getThreadLocalDispatcher();
 
         // Assert there is one behavior registered
-        assertEquals(1, dispatcher.getBehaviorSourceSet().size());
+        assertEquals(1, dispatcher.getAjaxBehaviorSourceSet().size());
 
         // Context reset should clear the dispatcher
         context.reset();
 
         // Assert there are no behaviors registered after reset is invoked
-        assertEquals(0, dispatcher.getBehaviorSourceSet().size());
+        assertEquals(0, dispatcher.getAjaxBehaviorSourceSet().size());
     }
 
     // Test Behavior Interceptor Methods --------------------------------------
@@ -327,8 +325,7 @@ public class MockContextTest extends Tes
         preResponseCalled = false;
         preDestroyCalled = false;
 
-        submit.addBehavior(new AjaxBehavior() {
-            private static final long serialVersionUID = 1L;
+        submit.addBehavior(new DefaultAjaxBehavior() {
 
             @Override
             public ActionResult onAction(Control source) {
@@ -359,7 +356,7 @@ public class MockContextTest extends Tes
         ActionEventDispatcher eventDispatcher = ActionEventDispatcher.getThreadLocalDispatcher();
 
         // Assert there is one behavior registered
-        assertEquals(1, eventDispatcher.getBehaviorSourceSet().size());
+        assertEquals(1, eventDispatcher.getAjaxBehaviorSourceSet().size());
 
         // Fire all behaviors registered in the onProcess method
         context.executeBehaviors();
@@ -367,7 +364,7 @@ public class MockContextTest extends Tes
         assertTrue("Submit behavior was not invoked", submitCalled);
 
         // Assert there are no behaviors registered after reset is invoked
-        assertEquals(0, eventDispatcher.getBehaviorSourceSet().size());
+        assertEquals(0, eventDispatcher.getAjaxBehaviorSourceSet().size());
 
         ControlRegistry registry = ControlRegistry.getThreadLocalRegistry();
 



Mime
View raw message