use of com.github.bordertech.wcomponents.WApplication in project wcomponents by BorderTech.
the class WApplicationRenderer_Test method testCssResources.
@Test
public void testCssResources() throws IOException, SAXException, XpathException {
// No resource
WApplication application = new WApplication();
assertSchemaMatch(application);
assertXpathNotExists("//ui:application/ui:css", application);
// Add URL resource
application.addCssUrl("URL");
assertSchemaMatch(application);
assertXpathEvaluatesTo("URL", "//ui:application/ui:css/@url", application);
}
use of com.github.bordertech.wcomponents.WApplication in project wcomponents by BorderTech.
the class WApplicationRenderer_Test method testRenderedFormatWithFocussedComponent.
@Test
public void testRenderedFormatWithFocussedComponent() throws XpathException, IOException, SAXException {
MockWEnvironment environment = new MockWEnvironment();
WApplication application = new WApplication();
environment.setPostPath("WApplicationRendererTest.postPath");
WTextField focussedComponent = new WTextField();
application.add(focussedComponent);
UIContext uic = createUIContext();
uic.setEnvironment(environment);
uic.setUI(application);
uic.setFocusRequired(true);
uic.setFocussed(focussedComponent);
setActiveContext(uic);
assertSchemaMatch(application);
assertXpathEvaluatesTo(environment.getPostPath(), "//ui:application/@applicationUrl", application);
assertXpathEvaluatesTo(WComponent.DEFAULT_APPLICATION_ID, "//ui:application/@id", application);
assertXpathEvaluatesTo(environment.getWServletPath(), "//ui:application/@ajaxUrl", application);
assertXpathEvaluatesTo(focussedComponent.getId(), "//ui:application/@defaultFocusId", application);
uic.setFocusRequired(false);
assertXpathNotExists("//ui:application/@defaultFocusId", application);
}
use of com.github.bordertech.wcomponents.WApplication in project wcomponents by BorderTech.
the class WApplicationRenderer_Test method testJsResources.
@Test
public void testJsResources() throws IOException, SAXException, XpathException {
// No resource
WApplication application = new WApplication();
assertSchemaMatch(application);
assertXpathNotExists("//ui:application/ui:js", application);
// Add URL resource
application.addJsUrl("URL");
assertSchemaMatch(application);
assertXpathEvaluatesTo("URL", "//ui:application/ui:js/@url", application);
}
Aggregations