Author: dsakovich
Date: 2008-01-11 13:55:27 -0500 (Fri, 11 Jan 2008)
New Revision: 5642
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/components/composition_absolute.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/components/composition_related.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsComponentTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1515
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/components/composition_absolute.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/components/composition_absolute.xhtml 2008-01-11
18:27:31 UTC (rev 5641)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/components/composition_absolute.xhtml 2008-01-11
18:55:27 UTC (rev 5642)
@@ -1,14 +1,12 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core">
-
- <ui:composition template="/pages/components/insert.xhtml">
-
- <ui:define name="pageTitle">JSF 1.2 and Facelets under Tomcat.
KickStart Application</ui:define>
-
- <ui:define name="pageHeader">JSF 1.2 Hello
Application</ui:define>
-
- </ui:composition>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core">
+
+<ui:composition template="/pages/components/insert.xhtml">
+
+ <ui:define name="pageTitle">JSF 1.2 and Facelets under Tomcat. KickStart
Application</ui:define>
+
+</ui:composition>
+</html>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/components/composition_related.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/components/composition_related.xhtml 2008-01-11
18:27:31 UTC (rev 5641)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/components/composition_related.xhtml 2008-01-11
18:55:27 UTC (rev 5642)
@@ -1,14 +1,12 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core">
-
- <ui:composition template="./insert.xhtml">
-
- <ui:define name="pageTitle">JSF 1.2 and Facelets under Tomcat.
KickStart Application</ui:define>
-
- <ui:define name="pageHeader">JSF 1.2 Hello
Application</ui:define>
-
- </ui:composition>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core">
+
+<ui:composition template="./insert.xhtml">
+
+ <ui:define name="pageTitle">JSF 1.2 and Facelets under Tomcat. KickStart
Application</ui:define>
+
+</ui:composition>
+</html>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsComponentTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsComponentTest.java 2008-01-11
18:27:31 UTC (rev 5641)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsComponentTest.java 2008-01-11
18:55:27 UTC (rev 5642)
@@ -125,29 +125,16 @@
// check absolute path
nsIDOMElement element =
performTestForFaceletComponent("components/composition_absolute.xhtml");
- nsIDOMNode node = (nsIDOMNode) element
- .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
- List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+ checkTemplatePage(element, "Page Header",
+ "Template with absolute path is not included");
- // find "table" elements
- TestUtil.findElementsByName(node, elements, HTML.TAG_TABLE);
-
- assertEquals("Template with absolute path is not included", 1, elements
- .size());
-
// check related path
element =
performTestForFaceletComponent("components/composition_related.xhtml");
- node = (nsIDOMNode) element.queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
- elements = new ArrayList<nsIDOMNode>();
+ checkTemplatePage(element, "Page Header",
+ "Template with related path is not included");
- // find "table" elements
- TestUtil.findElementsByName(node, elements, HTML.TAG_TABLE);
-
- assertEquals("Template with related path is not included", 1, elements
- .size());
-
if (getException() != null) {
throw getException();
}
@@ -399,4 +386,35 @@
return element;
}
+ private void checkTemplatePage(nsIDOMElement element, String contextString,
+ String message) {
+ nsIDOMNode node = (nsIDOMNode) element
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "table" elements
+ TestUtil.findElementsByName(node, elements, HTML.TAG_TABLE);
+
+ assertEquals(message, 1, elements.size());
+
+ nsIDOMElement table = (nsIDOMElement) elements.get(0).queryInterface(
+ nsIDOMElement.NS_IDOMELEMENT_IID);
+ nsIDOMElement tbody = (nsIDOMElement) table.getFirstChild()
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ nsIDOMElement tr = (nsIDOMElement) tbody.getFirstChild()
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ nsIDOMElement td = (nsIDOMElement) tr.getFirstChild().queryInterface(
+ nsIDOMElement.NS_IDOMELEMENT_IID);
+ nsIDOMElement div = (nsIDOMElement) td.getFirstChild().queryInterface(
+ nsIDOMElement.NS_IDOMELEMENT_IID);
+ nsIDOMElement span = (nsIDOMElement) div.getFirstChild()
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ nsIDOMText text = (nsIDOMText) span.getFirstChild().queryInterface(
+ nsIDOMText.NS_IDOMTEXT_IID);
+
+ assertEquals(message, contextString, text.getNodeValue());
+ }
+
}