(no commit message)
authorerik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Sat, 28 Aug 2010 19:33:57 +0000 (19:33 +0000)
committererik <erik@77661180-640e-0410-b3a8-9f9b13e6d0e0>
Sat, 28 Aug 2010 19:33:57 +0000 (19:33 +0000)
wicket/components/src/test/java/org/wamblee/wicket/jquery/JQueryHeaderContributorTest.java [moved from wicket/components/src/test/java/org/wamblee/wicket/jquery/JQueryBehaviorTest.java with 83% similarity]
wicket/components/src/test/java/org/wamblee/wicket/jquery/JQueryUtilsTest.java

similarity index 83%
rename from wicket/components/src/test/java/org/wamblee/wicket/jquery/JQueryBehaviorTest.java
rename to wicket/components/src/test/java/org/wamblee/wicket/jquery/JQueryHeaderContributorTest.java
index ed971c82f445a31e9738a50ccfc0e93feff9c3e8..6aaeb35905c8d7d5fed5aa6dbc77b30570c2dff3 100644 (file)
@@ -25,7 +25,7 @@ import org.junit.Before;
 import org.junit.Test;
 import org.wamblee.wicket.MyPage;
 
-public class JQueryBehaviorTest {
+public class JQueryHeaderContributorTest {
     private WicketTester wicket;
 
     @Before
@@ -41,17 +41,18 @@ public class JQueryBehaviorTest {
     @Test
     public void testJQueryDevelopmentMode() throws Exception {
         MyPage page = new MyPage();
-        page.add(new JQueryBehavior());
+        page.add(new JQueryHeaderContributor());
         wicket.startPage(page);
         wicket.assertRenderedPage(MyPage.class);
         assertTrue(wicket.getServletResponse().getDocument().contains(
-            JQueryBehavior.JQUERY_DEVELOPMENT));
+            JQueryHeaderContributor.JQUERY_DEVELOPMENT));
+        //System.out.println(wicket.getServletResponse().getDocument());
     }
 
     @Test
     public void testJQueryDeploymentMode() throws Exception {
         wicket.destroy();
-        JQueryBehavior.clear();
+        JQueryHeaderContributor.clear();
         wicket = new WicketTester(new DummyWebApplication() {
             @Override
             public String getConfigurationType() {
@@ -59,11 +60,11 @@ public class JQueryBehaviorTest {
             }
         });
         MyPage page = new MyPage();
-        page.add(new JQueryBehavior());
+        page.add(new JQueryHeaderContributor());
         wicket.startPage(page);
         wicket.assertRenderedPage(MyPage.class);
         assertTrue(wicket.getServletResponse().getDocument().contains(
-            JQueryBehavior.JQUERY_DEPLOYMENT));
+            JQueryHeaderContributor.JQUERY_DEPLOYMENT));
     }
 
 }
index c368c7662f1a34cfbc1b740064e599bc44d2641b..4045a5119ab3c55e38098ba148cbe1a324ba616c 100644 (file)
@@ -42,14 +42,14 @@ public class JQueryUtilsTest {
     public void testCreateReadyJavascript() { 
         Component component = new Label("label");
         component.setOutputMarkupId(true);
-        String readyHandler = JQueryUtils.createReadyFunction("myfunc", component);
-        assertEquals("$(function(){org.wamblee.myfunc(\"#" + component.getMarkupId() + "\");});", readyHandler);
+        String readyHandler = AbstractJQueryBehavior.createReadyFunction("myfunc", component);
+        assertEquals("jQuery(function(){org.wamblee.myfunc(\"#" + component.getMarkupId() + "\");});", readyHandler);
     }
     
     @Test(expected = IllegalStateException.class)
     public void testCreateReadyJavascriptNoMarkupId() { 
         Component component = new Label("label");
-        String readyHandler = JQueryUtils.createReadyFunction("myfunc", component);
+        String readyHandler = AbstractJQueryBehavior.createReadyFunction("myfunc", component);
     }
     
 }