From jbosstools-commits at lists.jboss.org Fri Jan 11 12:06:33 2008 Content-Type: multipart/mixed; boundary="===============4829577791411808509==" MIME-Version: 1.0 From: jbosstools-commits at lists.jboss.org To: jbosstools-commits at lists.jboss.org Subject: [jbosstools-commits] JBoss Tools SVN: r5635 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test: src/org/jboss/tools/jsf/vpe/facelets/test and 1 other directory. Date: Fri, 11 Jan 2008 12:06:33 -0500 Message-ID: --===============4829577791411808509== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dsakovich Date: 2008-01-11 12:06:32 -0500 (Fri, 11 Jan 2008) New Revision: 5635 Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/facelets= Test/WebContent/pages/components/repeat.xhtml trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/tool= s/jsf/vpe/facelets/test/FaceletsComponentTest.java Log: http://jira.jboss.com/jira/browse/JBIDE-1524 Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/f= aceletsTest/WebContent/pages/components/repeat.xhtml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/facelet= sTest/WebContent/pages/components/repeat.xhtml 2008-01-11 17:01:37 UTC (rev= 5634) +++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/resources/facelet= sTest/WebContent/pages/components/repeat.xhtml 2008-01-11 17:06:32 UTC (rev= 5635) @@ -8,13 +8,11 @@ Repeat Test -
- -
#{dept.name}
- -
#{emp.lastName}, #{emp.firstName}
-
-
+
+ +
#{dept.name}
+
#{dept.lastName}, #{dept.firstName}
+
\ No newline at end of file Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jbo= ss/tools/jsf/vpe/facelets/test/FaceletsComponentTest.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/too= ls/jsf/vpe/facelets/test/FaceletsComponentTest.java 2008-01-11 17:01:37 UTC= (rev 5634) +++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.facelets.test/src/org/jboss/too= ls/jsf/vpe/facelets/test/FaceletsComponentTest.java 2008-01-11 17:06:32 UTC= (rev 5635) @@ -71,7 +71,8 @@ nsIDOMText text =3D (nsIDOMText) div.getFirstChild().queryInterface( nsIDOMText.NS_IDOMTEXT_IID); = - assertEquals(text.getNodeValue(), "Ctrl+Shift+"); + assertEquals("Debug's content is not shown", text.getNodeValue(), + "Ctrl+Shift+"); = if (getException() !=3D null) { throw getException(); @@ -105,8 +106,10 @@ nsIDOMText text1 =3D (nsIDOMText) elementSpan1.getFirstChild() .queryInterface(nsIDOMText.NS_IDOMTEXT_IID); = - assertEquals(text0.getNodeValue(), "Greeting Page"); - assertEquals(text1.getNodeValue(), "#{person.name}!"); + assertEquals("Defined content is not shown", text0.getNodeValue(), + "Greeting Page"); + assertEquals("Defined content is not shown", text1.getNodeValue(), + "#{person.name}!"); = if (getException() !=3D null) { throw getException(); @@ -130,7 +133,8 @@ // find "table" elements TestUtil.findElementsByName(node, elements, HTML.TAG_TABLE); = - assertEquals(1, elements.size()); + assertEquals("Template with absolute path is not included", 1, elements + .size()); = // check related path element =3D performTestForFaceletComponent("components/composition_relate= d.xhtml"); @@ -141,7 +145,8 @@ // find "table" elements TestUtil.findElementsByName(node, elements, HTML.TAG_TABLE); = - assertEquals(1, elements.size()); + assertEquals("Template with related path is not included", 1, elements + .size()); = if (getException() !=3D null) { throw getException(); @@ -175,8 +180,8 @@ = String title =3D div.getAttribute("title"); = - assertEquals(title.replaceAll("\\s+", ""), - "ui:componentbinding:#{backingBean.menu}"); + assertEquals("Component's content is not shown", title.replaceAll( + "\\s+", ""), "ui:componentbinding:#{backingBean.menu}"); if (getException() !=3D null) { throw getException(); } @@ -205,8 +210,8 @@ nsIDOMText text =3D (nsIDOMText) elementSpan.getFirstChild() .queryInterface(nsIDOMText.NS_IDOMTEXT_IID); = - assertEquals(false, text.getNodeValue().equals( - "\nThis will be removed.\n")); + assertEquals("Content inside ui:remove tag shouldn't be shown", false, + text.getNodeValue().equals("\nThis will be removed.\n")); = if (getException() !=3D null) { throw getException(); @@ -229,7 +234,8 @@ // find "table" elements TestUtil.findElementsByName(node, elements, HTML.TAG_TABLE); = - assertEquals(1, elements.size()); + assertEquals("Template with absolute path is not included", 1, elements + .size()); = // check related path element =3D performTestForFaceletComponent("components/decorate_related.x= html"); @@ -240,7 +246,8 @@ // find "table" elements TestUtil.findElementsByName(node, elements, HTML.TAG_TABLE); = - assertEquals(1, elements.size()); + assertEquals("Template with related path is not included", 1, elements + .size()); = if (getException() !=3D null) { throw getException(); @@ -253,9 +260,29 @@ * @throws Throwable */ public void testRepeat() throws Throwable { - performTestForVpeComponent((IFile) TestUtil.getComponentPath( - "components/repeat.xhtml", IMPORT_PROJECT_NAME)); // $NON-NLS-1$ - assertTrue("Component's content is not shown", false); + nsIDOMElement element =3D performTestForFaceletComponent("components/repe= at.xhtml"); + nsIDOMNode node =3D (nsIDOMNode) element + .queryInterface(nsIDOMNode.NS_IDOMNODE_IID); + + List elements =3D new ArrayList(); + + // find "dl" elements + TestUtil.findElementsByName(node, elements, HTML.TAG_DL); + + assertEquals(1, elements.size()); + + nsIDOMElement elementDL =3D (nsIDOMElement) elements.get(0) + .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID); + + nsIDOMElement elementDT =3D (nsIDOMElement) elementDL.getFirstChild() + .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID); + + assertEquals("Component's content is not shown", HTML.TAG_DT, elementDT + .getNodeName().toUpperCase()); + + if (getException() !=3D null) { + throw getException(); + } } = /** @@ -274,7 +301,8 @@ // find "table" elements TestUtil.findElementsByName(node, elements, HTML.TAG_TABLE); = - assertEquals(1, elements.size()); + assertEquals("Template with absolute path is not included", 1, elements + .size()); = // check related path element =3D performTestForFaceletComponent("components/include_related.xh= tml"); @@ -285,7 +313,8 @@ // find "table" elements TestUtil.findElementsByName(node, elements, HTML.TAG_TABLE); = - assertEquals(1, elements.size()); + assertEquals("Template with related path is not included", 1, elements + .size()); = if (getException() !=3D null) { throw getException(); @@ -318,8 +347,8 @@ = String title =3D div.getAttribute("title"); = - assertEquals(title.replaceAll("\\s+", ""), - "ui:fragmentbinding:#{uiCache['searchResult']}"); + assertEquals("Fragment's content is not shown", title.replaceAll( + "\\s+", ""), "ui:fragmentbinding:#{uiCache['searchResult']}"); if (getException() !=3D null) { throw getException(); } --===============4829577791411808509==--