Author: dmaliarevich
Date: 2008-01-15 09:18:49 -0500 (Tue, 15 Jan 2008)
New Revision: 5687
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/JBIDE1579Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesAllTests.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentTest.java
Log:
JUnit test for the rich faces orderingList template
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesAllTests.java 2008-01-15
14:18:09 UTC (rev 5686)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesAllTests.java 2008-01-15
14:18:49 UTC (rev 5687)
@@ -15,6 +15,7 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.jboss.tools.jsf.vpe.richfaces.test.jbide.JBIDE1579Test;
import org.jboss.tools.vpe.ui.test.VpeTestSetup;
import org.jboss.tools.vpe.ui.test.beans.ImportBean;
@@ -33,6 +34,7 @@
// $JUnit-BEGIN$
suite.addTestSuite(RichFacesComponentTest.class);
+ suite.addTestSuite(JBIDE1579Test.class);
// $JUnit-END$
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentTest.java 2008-01-15
14:18:09 UTC (rev 5686)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentTest.java 2008-01-15
14:18:49 UTC (rev 5687)
@@ -138,6 +138,11 @@
"components/modalPanel.xhtml", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
}
+ public void testOrderingList() throws PartInitException, Throwable {
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath(
+ "components/orderingList.xhtml", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ }
+
public void testPaint2D() throws PartInitException, Throwable {
performTestForVpeComponent((IFile) TestUtil.getComponentPath(
"components/paint2D.xhtml", IMPORT_PROJECT_NAME)); // $NON-NLS-1$
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/JBIDE1579Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/JBIDE1579Test.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/JBIDE1579Test.java 2008-01-15
14:18:49 UTC (rev 5687)
@@ -0,0 +1,104 @@
+package org.jboss.tools.jsf.vpe.richfaces.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;
+
+public class JBIDE1579Test extends VpeTest {
+
+ public static final String IMPORT_PROJECT_NAME = "richFacesTest";
+
+ private static final String TEST_PAGE_NAME_2BUTTONS =
"JBIDE/1579/JBIDE-1579-2buttons.xhtml";
+ private static final String TEST_PAGE_NAME_4BUTTONS =
"JBIDE/1579/JBIDE-1579-4buttons.xhtml";
+
+ public JBIDE1579Test(String name) {
+ super(name);
+ }
+
+ public void testJBIDE_1579_2buttons() throws Throwable{
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(
+ TEST_PAGE_NAME_2BUTTONS, IMPORT_PROJECT_NAME);
+
+ assertNotNull("Could not open specified file " + file.getFullPath(),
+ file);
+
+ IEditorInput input = new FileEditorInput(file);
+
+ assertNotNull("Editor input is null", input);
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ // get dom document
+ nsIDOMDocument document = getVpeVisualDocument(part);
+ nsIDOMElement element = document.getDocumentElement();
+
+ //check that element is not null
+ assertNotNull(element);
+
+ // get root node
+ nsIDOMNode node = (nsIDOMNode) element
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "img" elements
+ TestUtil.findElementsByName(node, elements, HTML.TAG_IMG);
+ assertEquals(2, elements.size());
+
+ }
+
+ public void testJBIDE_1579_4buttons() throws Throwable{
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(
+ TEST_PAGE_NAME_4BUTTONS, IMPORT_PROJECT_NAME);
+
+ assertNotNull("Could not open specified file " + file.getFullPath(),
+ file);
+
+ IEditorInput input = new FileEditorInput(file);
+
+ assertNotNull("Editor input is null", input);
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ // get dom document
+ nsIDOMDocument document = getVpeVisualDocument(part);
+ nsIDOMElement element = document.getDocumentElement();
+
+ //check that element is not null
+ assertNotNull(element);
+
+ // get root node
+ nsIDOMNode node = (nsIDOMNode) element
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "img" elements
+ TestUtil.findElementsByName(node, elements, HTML.TAG_IMG);
+ assertEquals(4, elements.size());
+
+ }
+
+}
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/JBIDE1579Test.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native