Author: estherbin
Date: 2008-07-17 12:23:43 -0400 (Thu, 17 Jul 2008)
New Revision: 9168
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/CommonJBIDE2010Test.java
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/JBIDE2010Test.java
Log:
ADD JUNIT
https://jira.jboss.com:8443/jira/browse/JBIDE-2010
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/CommonJBIDE2010Test.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/CommonJBIDE2010Test.java 2008-07-17
16:22:13 UTC (rev 9167)
+++
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/CommonJBIDE2010Test.java 2008-07-17
16:23:43 UTC (rev 9168)
@@ -29,7 +29,16 @@
* >JBIDE-2010</a>issue.
*/
public abstract class CommonJBIDE2010Test extends CommonRichFacesTestCase {
+
+ /** The Constant DIR_TEST_PAGE_NAME_3. */
+ protected static final String DIR_TEST_PAGE_NAME_3 =
"JBIDE/2010/page3.xhtml";
+ /** The Constant VALUE_5. */
+ protected static final String VALUE_5 = "world";
+
+ /** The Constant KEY_5. */
+ protected static final String KEY_5 = "#{bean1.property3}";
+
/** The Constant VALUE_4. */
protected static final String VALUE_4 = "background:red";
@@ -82,6 +91,7 @@
elValuesMap.put(KEY_2, "/path2/");
elValuesMap.put(KEY_3, "/facesContext/");
elValuesMap.put(KEY_4, VALUE_4);
+ elValuesMap.put(KEY_5, VALUE_5);
file = (IFile) TestUtil.getComponentPath(DIR_TEST_PAGE_NAME,
IMPORT_PROJECT_NAME);
ResourceReference[] entries = new ResourceReference[elValuesMap.size()];
int i = 0;
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/JBIDE2010Test.java
===================================================================
---
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/JBIDE2010Test.java 2008-07-17
16:22:13 UTC (rev 9167)
+++
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/JBIDE2010Test.java 2008-07-17
16:23:43 UTC (rev 9168)
@@ -18,10 +18,8 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
-import org.jboss.tools.jsf.vpe.richfaces.test.RichFacesComponentTest;
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;
@@ -34,6 +32,7 @@
*/
public class JBIDE2010Test extends CommonJBIDE2010Test {
+
/**
* The Constructor.
*
@@ -63,16 +62,33 @@
final nsIDOMElement spanOne = (nsIDOMElement)
elements.get(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
assertEquals("Style attribute should be substituted", VALUE_4,
spanOne.getFirstChild().getNodeValue());
- int i = 0;
- DOMTreeDumper dumper = new DOMTreeDumper();
- dumper.dumpToStream(System.out, rst);
- // for(nsIDOMNode n:elements){
- // final nsIDOMElement d = (nsIDOMElement)
- // elements.get(i++).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- // System.out.println("JBIDE2010Test.testElTemplateSimple()-"+d.
- // getAttribute("style"));
- // }
}
+
+ /**
+ * Test el template simple.
+ *
+ * @throws CoreException the core exception
+ * @throws Throwable the throwable
+ */
+ public void testElTemplateSimple2() throws CoreException, Throwable {
+ final nsIDOMElement rst = performTestForRichFacesComponent((IFile)
TestUtil.getComponentPath(DIR_TEST_PAGE_NAME_3,
+ IMPORT_PROJECT_NAME));
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "td" elements
+
+ TestUtil.findAllElementsByName(rst, elements, HTML.TAG_P);
+
+ assertEquals("Value should be equals", 1, elements.size());
+ final nsIDOMElement pOne = (nsIDOMElement)
elements.get(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ // DOMTreeDumper d = new DOMTreeDumper();
+ // d.dumpToStream(System.out, rst);
+// assertEquals("Value should be equals", "Hello "+VALUE_5,
pOne.getFirstChild().getFirstChild().getNodeValue());
+ assertTrue("Value should be
contains",pOne.getAttribute(HTML.ATTR_STYLE).contains(VALUE_4));
+
+ }
+
}