diff options
author | Matti Hosio <mhosio@vaadin.com> | 2014-12-17 15:30:46 +0200 |
---|---|---|
committer | Matti Hosio <mhosio@vaadin.com> | 2014-12-17 16:28:36 +0200 |
commit | 3cfe26623baf7a4fd28309747fd45a482a833c94 (patch) | |
tree | b3ee982932ab7dfbcc3d6d9d7987d10ef3451b4d /server | |
parent | d65749f0cac74bfe16edf511f5a4d8c912404efe (diff) | |
download | vaadin-framework-3cfe26623baf7a4fd28309747fd45a482a833c94.tar.gz vaadin-framework-3cfe26623baf7a4fd28309747fd45a482a833c94.zip |
Add namespace element for custom components (#7749)
Change-Id: Iea7e4057df5a61805ba2f6c087fbb3bcd23f68c7
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/ui/declarative/Design.java | 2 | ||||
-rw-r--r-- | server/tests/src/com/vaadin/tests/design/nested/TestNestedCustomLayouts.java | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/server/src/com/vaadin/ui/declarative/Design.java b/server/src/com/vaadin/ui/declarative/Design.java index ff564fabc3..9122e82721 100644 --- a/server/src/com/vaadin/ui/declarative/Design.java +++ b/server/src/com/vaadin/ui/declarative/Design.java @@ -238,7 +238,6 @@ public class Design implements Serializable { html.appendChild(doc.createElement("head")); Element body = doc.createElement("body"); html.appendChild(body); - designContext.storePrefixes(doc); // Append the design under <body> in the html tree. createNode // creates the entire component hierarchy rooted at the @@ -246,6 +245,7 @@ public class Design implements Serializable { Component root = designContext.getRootComponent(); Node rootNode = designContext.createElement(root); body.appendChild(rootNode); + designContext.storePrefixes(doc); return doc; } diff --git a/server/tests/src/com/vaadin/tests/design/nested/TestNestedCustomLayouts.java b/server/tests/src/com/vaadin/tests/design/nested/TestNestedCustomLayouts.java index 2abadaf98e..c71ccca85b 100644 --- a/server/tests/src/com/vaadin/tests/design/nested/TestNestedCustomLayouts.java +++ b/server/tests/src/com/vaadin/tests/design/nested/TestNestedCustomLayouts.java @@ -47,6 +47,8 @@ import com.vaadin.ui.declarative.Design; */ public class TestNestedCustomLayouts extends TestCase { + private static String PACKAGE_MAPPING = "com_vaadin_tests_design_nested_customlayouts:com.vaadin.tests.design.nested.customlayouts"; + @Test public void testNestedLayouts() throws IOException { VerticalLayout rootLayout = new VerticalLayout(); @@ -64,6 +66,8 @@ public class TestNestedCustomLayouts extends TestCase { ByteArrayOutputStream out = new ByteArrayOutputStream(); Design.write(rootLayout, out); Document doc = Jsoup.parse(out.toString("UTF-8")); + assertEquals("package-mapping", doc.head().child(0).attr("name")); + assertEquals(PACKAGE_MAPPING, doc.head().child(0).attr("content")); Element rootNode = doc.body().child(0); assertTrue("Root node must have children", rootNode.children().size() > 0); |