From bcdcc507a21e1af820aff5c1aa876ba02135af3f Mon Sep 17 00:00:00 2001 From: Erik Brakkee Date: Sat, 28 Aug 2010 19:33:57 +0000 Subject: [PATCH] --- ...orTest.java => JQueryHeaderContributorTest.java} | 13 +++++++------ .../org/wamblee/wicket/jquery/JQueryUtilsTest.java | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) rename wicket/components/src/test/java/org/wamblee/wicket/jquery/{JQueryBehaviorTest.java => JQueryHeaderContributorTest.java} (83%) diff --git a/wicket/components/src/test/java/org/wamblee/wicket/jquery/JQueryBehaviorTest.java b/wicket/components/src/test/java/org/wamblee/wicket/jquery/JQueryHeaderContributorTest.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 ed971c82..6aaeb359 100644 --- a/wicket/components/src/test/java/org/wamblee/wicket/jquery/JQueryBehaviorTest.java +++ b/wicket/components/src/test/java/org/wamblee/wicket/jquery/JQueryHeaderContributorTest.java @@ -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)); } } diff --git a/wicket/components/src/test/java/org/wamblee/wicket/jquery/JQueryUtilsTest.java b/wicket/components/src/test/java/org/wamblee/wicket/jquery/JQueryUtilsTest.java index c368c766..4045a511 100644 --- a/wicket/components/src/test/java/org/wamblee/wicket/jquery/JQueryUtilsTest.java +++ b/wicket/components/src/test/java/org/wamblee/wicket/jquery/JQueryUtilsTest.java @@ -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); } } -- 2.31.1