From jbosstools-commits at lists.jboss.org Tue Jul 8 09:24:19 2008 Content-Type: multipart/mixed; boundary="===============3358006332417130427==" MIME-Version: 1.0 From: jbosstools-commits at lists.jboss.org To: jbosstools-commits at lists.jboss.org Subject: [jbosstools-commits] JBoss Tools SVN: r9089 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test: resources/jsfTest/WebContent/pages/JBIDE/2119 and 2 other directories. Date: Tue, 08 Jul 2008 09:24:18 -0400 Message-ID: --===============3358006332417130427== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: dsakovich Date: 2008-07-08 09:24:18 -0400 (Tue, 08 Jul 2008) New Revision: 9089 Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebCo= ntent/pages/JBIDE/2119/ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebCo= ntent/pages/JBIDE/2119/JBIDE-2119.jsp trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf= /vpe/jsf/test/jbide/JBIDE2119Test.java Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf= /vpe/jsf/test/JsfAllTests.java Log: JUnit test for http://jira.jboss.org/jira/browse/JBIDE-2119 Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/W= ebContent/pages/JBIDE/2119/JBIDE-2119.jsp =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.jsf.test/resources/jsfTest/WebC= ontent/pages/JBIDE/2119/JBIDE-2119.jsp (rev 0) +++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebC= ontent/pages/JBIDE/2119/JBIDE-2119.jsp 2008-07-08 13:24:18 UTC (rev 9089) @@ -0,0 +1,54 @@ +<%@ taglib uri=3D"http://java.sun.com/jsf/core" prefix=3D"f"%> +<%@ taglib uri=3D"http://java.sun.com/jsf/html" prefix=3D"h"%> + + + + + + + +Input User Name Page + + + +

Hello people

+ + +

+ +

Posted by + erwin | = + Home page | = + abcdef +

+ + + + + + + = +
+ = + +
+
+ + \ No newline at end of file Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/to= ols/jsf/vpe/jsf/test/JsfAllTests.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.jsf.test/src/org/jboss/tools/js= f/vpe/jsf/test/JsfAllTests.java 2008-07-08 12:25:59 UTC (rev 9088) +++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/js= f/vpe/jsf/test/JsfAllTests.java 2008-07-08 13:24:18 UTC (rev 9089) @@ -25,6 +25,7 @@ import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1720Test; import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1730Test; import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE1744Test; +import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2119Test; import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2297Test; import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2434Test; import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE675Test; @@ -72,6 +73,7 @@ suite.addTestSuite(JsfJbide2170Test.class); suite.addTestSuite(JBIDE2434Test.class); suite.addTestSuite(JsfJbide2362Test.class); + suite.addTestSuite(JBIDE2119Test.class); // $JUnit-END$ // added by Max Areshkau // add here projects which should be imported for junit tests Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools= /jsf/vpe/jsf/test/jbide/JBIDE2119Test.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.jsf.test/src/org/jboss/tools/js= f/vpe/jsf/test/jbide/JBIDE2119Test.java (rev 0) +++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/js= f/vpe/jsf/test/jbide/JBIDE2119Test.java 2008-07-08 13:24:18 UTC (rev 9089) @@ -0,0 +1,88 @@ +/*************************************************************************= ****** + * Copyright (c) 2007-2008 Red Hat, Inc. + * Distributed under license by Red Hat, Inc. All rights reserved. + * This program is made available under the terms of the + * Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + * + * Contributor: + * Red Hat, Inc. - initial API and implementation + ************************************************************************= ******/ +package org.jboss.tools.jsf.vpe.jsf.test.jbide; + +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.resources.IFile; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.part.FileEditorInput; +import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor; +import org.jboss.tools.vpe.editor.util.HTML; +import org.jboss.tools.vpe.ui.test.TestUtil; +import org.jboss.tools.vpe.ui.test.VpeTest; +import org.mozilla.interfaces.nsIDOMDocument; +import org.mozilla.interfaces.nsIDOMElement; +import org.mozilla.interfaces.nsIDOMNode; + +/** + * @author Dzmitry Sakovich (dsakovich(a)exadel.com) + * = + */ +public class JBIDE2119Test extends VpeTest { + + private static final String IMPORT_PROJECT_NAME =3D "jsfTest"; + + private static final String TEST_PAGE_NAME =3D "JBIDE/2119/JBIDE-2119.jsp= "; + + /** + * @param name + */ + public JBIDE2119Test(String name) { + super(name); + } + + // test method for JBIDE 2119 + public void testJBIDE_2119() throws Throwable { + // wait + TestUtil.waitForJobs(); + // set exception + setException(null); + + // get test page path + IFile file =3D (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME, + IMPORT_PROJECT_NAME); + + assertNotNull("Could not open specified file " + file.getFullPath(), + file); + + IEditorInput input =3D new FileEditorInput(file); + + assertNotNull("Editor input is null", input); + // open and get editor + JSPMultiPageEditor part =3D openEditor(input); + + // get dom document + nsIDOMDocument document =3D getVpeVisualDocument(part); + nsIDOMElement element =3D document.getDocumentElement(); + + // check that element is not null + assertNotNull(element); + + // get root node + nsIDOMNode node =3D (nsIDOMNode) element + .queryInterface(nsIDOMNode.NS_IDOMNODE_IID); + + List elements =3D new ArrayList(); + + // find "a" elements + TestUtil.findElementsByName(node, elements, HTML.TAG_A); + // method does not look for nested tables + // thus only one element is found + assertEquals(3, elements.size()); + = + if (getException() !=3D null) { + throw getException(); + } + } + +} --===============3358006332417130427==--