Author: dsakovich
Date: 2008-01-11 09:14:15 -0500 (Fri, 11 Jan 2008)
New Revision: 5619
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/components/remove.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-1521
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/components/remove.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/components/remove.xhtml 2008-01-11
13:47:01 UTC (rev 5618)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/faceletsTest/WebContent/pages/components/remove.xhtml 2008-01-11
14:14:15 UTC (rev 5619)
@@ -12,7 +12,6 @@
<ui:remove>
This will be removed.
</ui:remove>
-<span jsfc="ui:remove"> This won't be compiled either
<h:outputText
- value="#{foo.bar}" /> </span>
+This is ui:remove test
</body>
</html>
\ No newline at end of file
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
13:47:01 UTC (rev 5618)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsComponentTest.java 2008-01-11
14:14:15 UTC (rev 5619)
@@ -161,10 +161,28 @@
* @throws Throwable
*/
public void testRemove() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath(
- "components/remove.xhtml", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
- // TODO check that content in ui:remove isn't shown in VPE
- assertTrue("Content inside ui:remove tag shouldn't be shown", false);
+ nsIDOMElement element =
performTestForFaceletComponent("components/remove.xhtml");
+ nsIDOMNode node = (nsIDOMNode) element
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "span" elements
+ TestUtil.findElementsByName(node, elements, HTML.TAG_SPAN);
+
+ assertEquals(1, elements.size());
+
+ nsIDOMElement elementSpan = (nsIDOMElement) elements.get(0)
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ nsIDOMText text = (nsIDOMText) elementSpan.getFirstChild()
+ .queryInterface(nsIDOMText.NS_IDOMTEXT_IID);
+
+ assertEquals(false, text.getNodeValue().equals("\nThis will be removed.\n"));
+
+ if (getException() != null) {
+ throw getException();
+ }
}
/**