Search in sources :

Example 1 with Link

use of org.structr.web.entity.html.Link in project structr by structr.

the class DeploymentTest method test04ContentTypes.

@Test
public void test04ContentTypes() {
    // setup
    try (final Tx tx = app.tx()) {
        final Page page = Page.createNewPage(securityContext, "test04");
        final Html html = createElement(page, page, "html");
        final Head head = createElement(page, html, "head");
        createElement(page, head, "title", "test04");
        createElement(page, head, "link");
        createElement(page, head, "link");
        createComment(page, head, "commentöäüÖÄÜß+#");
        final Link link3 = createElement(page, head, "link");
        final PropertyMap link3Properties = new PropertyMap();
        link3Properties.put(StructrApp.key(Link.class, "_html_href"), "/");
        link3Properties.put(StructrApp.key(Link.class, "_html_media"), "screen");
        link3Properties.put(StructrApp.key(Link.class, "_html_type"), "stylesheet");
        link3.setProperties(link3.getSecurityContext(), link3Properties);
        final Body body = createElement(page, html, "body");
        final Div div1 = createElement(page, body, "div");
        createElement(page, div1, "h1", "private");
        tx.success();
    } catch (FrameworkException fex) {
        fail("Unexpected exception.");
    }
    // test
    compare(calculateHash(), true);
}
Also used : Div(org.structr.web.entity.html.Div) Head(org.structr.web.entity.html.Head) PropertyMap(org.structr.core.property.PropertyMap) Tx(org.structr.core.graph.Tx) FrameworkException(org.structr.common.error.FrameworkException) Html(org.structr.web.entity.html.Html) Page(org.structr.web.entity.dom.Page) Body(org.structr.web.entity.html.Body) Link(org.structr.web.entity.html.Link) Test(org.junit.Test) StructrUiTest(org.structr.web.StructrUiTest)

Aggregations

Test (org.junit.Test)1 FrameworkException (org.structr.common.error.FrameworkException)1 Tx (org.structr.core.graph.Tx)1 PropertyMap (org.structr.core.property.PropertyMap)1 StructrUiTest (org.structr.web.StructrUiTest)1 Page (org.structr.web.entity.dom.Page)1 Body (org.structr.web.entity.html.Body)1 Div (org.structr.web.entity.html.Div)1 Head (org.structr.web.entity.html.Head)1 Html (org.structr.web.entity.html.Html)1 Link (org.structr.web.entity.html.Link)1