import org.apache.wicket.Component;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.util.tester.TagTester;
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 static junit.framework.TestCase.*;
wicket.destroy();
}
+ @Test
+ public void testVerifyBasicFunc() {
+ MyPage page = new MyPage();
+ page.getLabel().add(new AbstractJQueryBehavior("initfunc"));
+ wicket.startPage(page);
+ wicket.assertRenderedPage(MyPage.class);
+ TagTester tag = wicket.getTagByWicketId("label");
+ assertNotNull(tag.getAttribute("id"));
+ String doc = wicket.getServletResponse().getDocument();
+ assertTrue(doc.contains("jquery-noconflict"));
+ assertTrue(doc.contains("initfunc"));
+ }
+
@Test
public void testCreateReadyJavascript() {
Component component = new Label("label");