use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class NodeBorderTest method properlyClosed.
/**
* WICKET-5447
*/
@Test
public void properlyClosed() throws Exception {
WicketTester tester = new WicketTester();
Label label = new Label("label");
label.add(new NodeBorder(new boolean[] { true, false, true }));
tester.startComponentInPage(label);
tester.assertResultPage("<div class=\"tree-branch tree-branch-mid\"><div class=\"tree-subtree\"><div class=\"tree-branch tree-branch-last\"><div class=\"tree-subtree\"><div class=\"tree-branch tree-branch-mid\"><span wicket:id=\"label\" class=\"tree-node\"></span></div></div></div></div></div>");
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class CryptoMapperTest method before.
/**
* Creates the {@link CryptoMapper}
*
* @throws Exception
*/
@Before
public void before() throws Exception {
tester = new WicketTester(HomePage.class);
WebApplication application = tester.getApplication();
application.mountPage(MOUNTED_URL, Page1.class);
/**
* Use explicit crypt provider to prevent crypt warning output, see
* SecuritySettings#getCryptFactory()
*/
Supplier<ICrypt> cryptProvider = new Supplier<ICrypt>() {
private ICryptFactory cryptFactory = new CachingSunJceCryptFactory(SecuritySettings.DEFAULT_ENCRYPTION_KEY);
@Override
public ICrypt get() {
return cryptFactory.newCrypt();
}
};
mapper = new CryptoMapper(application.getRootRequestMapper(), cryptProvider);
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class MoreSpecificResourceMountPathTest method can_use_resource_mounted_without_parameter.
@Test
public void can_use_resource_mounted_without_parameter() {
WicketTester browser = new WicketTester(new WicketApplication());
browser.executeUrl(WicketApplication.urlFor("howdy"));
Assert.assertThat(browser.getLastResponseAsString(), is(equalTo("howdy")));
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class HtmlImportHeaderItemTest method wicketPageUrl.
@Test
public void wicketPageUrl() throws Exception {
WicketTester tester = new WicketTester();
PageParameters parameters = new PageParameters();
parameters.add("foo", "foo");
parameters.add("bar", "bar");
CharSequence pageUrl = tester.getRequestCycle().urlFor(SimplePage.class, parameters);
MetaDataHeaderItem importLink = HtmlImportHeaderItem.forImportLinkTag(SimplePage.class, parameters, "monitor", true);
assertEquals("<link rel=\"import\" href=\"" + pageUrl + "\" media=\"monitor\" async />\n", importLink.generateString());
}
use of org.apache.wicket.util.tester.WicketTester in project wicket by apache.
the class SendPayloadWithContextTest method before.
@Before
public void before() {
tester = new WicketTester();
WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(tester.getApplication());
webSocketSettings.setSendPayloadExecutor(new WebSocketSettings.SameThreadExecutor() {
@Override
public void run(Runnable command) {
context.set(true);
super.run(command);
context.set(false);
}
});
}
Aggregations