X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=wicket%2Fcomponents%2Fsrc%2Ftest%2Fjava%2Forg%2Fwamblee%2Fwicket%2Fbehavior%2FSupportBehaviorTest.java;fp=wicket%2Fcomponents%2Fsrc%2Ftest%2Fjava%2Forg%2Fwamblee%2Fwicket%2Fbehavior%2FSupportBehaviorTest.java;h=e1ca2eeb332f6febb48c52722081e80ca7403d31;hb=6c5dc665abfe021a7add911d1ca167113f4ccae8;hp=0000000000000000000000000000000000000000;hpb=74740c132a0713c9505a775bf345795cf2198c95;p=utils diff --git a/wicket/components/src/test/java/org/wamblee/wicket/behavior/SupportBehaviorTest.java b/wicket/components/src/test/java/org/wamblee/wicket/behavior/SupportBehaviorTest.java new file mode 100644 index 00000000..e1ca2eeb --- /dev/null +++ b/wicket/components/src/test/java/org/wamblee/wicket/behavior/SupportBehaviorTest.java @@ -0,0 +1,49 @@ +/* + * Copyright 2005-2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.wamblee.wicket.behavior; + +import static junit.framework.Assert.*; + +import org.apache.wicket.util.tester.WicketTester; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.wamblee.wicket.MyPage; +import org.wamblee.wicket.jquery.JQueryHeaderContributor; + +public class SupportBehaviorTest { + private WicketTester wicket; + + @Before + public void setUp() { + wicket = new WicketTester(); + } + + @After + public void tearDown() { + wicket.destroy(); + } + + @Test + public void testRender() { + MyPage page = new MyPage(); + page.add(new SupportBehavior()); + wicket.startPage(page); + wicket.assertRenderedPage(MyPage.class); + assertTrue(wicket.getServletResponse().getDocument().contains(SupportBehavior.SUPPORT_SCRIPT)); + } + +}