Author: estherbin
Date: 2008-08-04 08:50:23 -0400 (Mon, 04 Aug 2008)
New Revision: 9489
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/JBIDE2582Test.java
Log:
Fix bug.
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/JBIDE2582Test.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/JBIDE2582Test.java 2008-08-04
12:50:19 UTC (rev 9488)
+++
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/JBIDE2582Test.java 2008-08-04
12:50:23 UTC (rev 9489)
@@ -17,8 +17,10 @@
import java.util.List;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -33,6 +35,10 @@
/** The Constant DIR_TEST_PAGE_NAME_3. */
protected static final String PAGE_1 = "JBIDE/2582/page1.xhtml";
+
+
+ /** The Constant DIR_TEST_PAGE_NAME_3. */
+ protected static final String PAGE_2 = "JBIDE/2582/page2.xhtml";
/**
* The Constructor.
@@ -63,6 +69,30 @@
final nsIDOMElement spanOne = (nsIDOMElement)
elements.get(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
assertEquals("Style attribute should be substituted",
"Hello", spanOne.getFirstChild().getNodeValue());
+
+ }
+
+
+
+ public void testResourceSubstitutionInText() throws CoreException, Throwable {
+ final nsIDOMElement rst = performTestForRichFacesComponent((IFile)
TestUtil.getComponentPath(PAGE_2, getOpenProjectName()));
+ final List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+// DOMTreeDumper dumper = new DOMTreeDumper();
+// dumper.dumpToStream(System.out, rst);
+ TestUtil.findAllElementsByName(rst, elements, "H3");
+ assertEquals("Size should be equals 1",1,elements.size());
+
+ final nsIDOMElement h3one = (nsIDOMElement)
elements.get(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+
+ assertEquals("Style attribute should be substituted",
"Hello", h3one.getFirstChild().getFirstChild().getNodeValue());
+
+ //There are the label:#{msg.header}f
+
+ TestUtil.findAllElementsByName(rst, elements, "SPAN");
+ assertEquals("Size should be equals 1",4,elements.size());
+ final nsIDOMElement pOne = ((nsIDOMElement)
elements.get(2).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID));
+
+ assertEquals("Style attribute should be substituted", "There are
the label:Hello Demo Application", pOne.getFirstChild().getNodeValue());
}
Show replies by date