Author: dsakovich
Date: 2008-01-11 10:07:46 -0500 (Fri, 11 Jan 2008)
New Revision: 5620
Modified:
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-1520
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
14:14:15 UTC (rev 5619)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tools/jsf/vpe/facelets/test/FaceletsComponentTest.java 2008-01-11
15:07:46 UTC (rev 5620)
@@ -178,7 +178,8 @@
nsIDOMText text = (nsIDOMText) elementSpan.getFirstChild()
.queryInterface(nsIDOMText.NS_IDOMTEXT_IID);
- assertEquals(false, text.getNodeValue().equals("\nThis will be removed.\n"));
+ assertEquals(false, text.getNodeValue().equals(
+ "\nThis will be removed.\n"));
if (getException() != null) {
throw getException();
@@ -270,10 +271,31 @@
* @throws Throwable
*/
public void testFragment() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath(
- "components/fragment.xhtml", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
- // TODO check that fragment's content is showed
- assertTrue("Fragment's content is not sown", false);
+ nsIDOMElement element =
performTestForFaceletComponent("components/fragment.xhtml");
+ nsIDOMNode node = (nsIDOMNode) element
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "div" elements
+ TestUtil.findElementsByName(node, elements, HTML.TAG_DIV);
+ assertEquals(1, elements.size());
+ nsIDOMElement divElement = (nsIDOMElement) elements.get(0)
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ nsIDOMElement divBody = (nsIDOMElement) divElement.getLastChild()
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ nsIDOMElement div = (nsIDOMElement) divBody.getLastChild()
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ String title = div.getAttribute("title");
+
+ assertEquals(title.replaceAll("\\s+", ""),
+ "ui:fragmentbinding:#{uiCache['searchResult']}");
+ if (getException() != null) {
+ throw getException();
+ }
}
/**