Author: sdzmitrovich
Date: 2008-02-27 06:38:19 -0500 (Wed, 27 Feb 2008)
New Revision: 6593
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1548/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1548/JBIDE-1548.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/Jbide1548Test.java
Removed:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/1548/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1548Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
Log:
replace junit for 1548 from jsf test to richfaces test
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-02-27
11:16:08 UTC (rev 6592)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-02-27
11:38:19 UTC (rev 6593)
@@ -26,7 +26,6 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE788Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1467Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1501Test;
-import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1548Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1568Test;
import org.jboss.tools.vpe.ui.test.VpeTestSetup;
import org.jboss.tools.vpe.ui.test.beans.ImportBean;
@@ -48,7 +47,6 @@
suite.addTestSuite(JsfJbide1467Test.class);
suite.addTestSuite(JsfJbide1501Test.class);
suite.addTestSuite(JBIDE1484Test.class);
- suite.addTestSuite(JsfJbide1548Test.class);
suite.addTestSuite(JsfJbide1568Test.class);
suite.addTestSuite(JBIDE1615Test.class);
suite.addTestSuite(JBIDE1479Test.class);
Deleted:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1548Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1548Test.java 2008-02-27
11:16:08 UTC (rev 6592)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1548Test.java 2008-02-27
11:38:19 UTC (rev 6593)
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 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
- *
- * Contributors:
- * 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;
-
-/**
- * Class for testing all jsf bugs
- *
- * @author sdzmitrovich
- *
- * test for
http://jira.jboss.com/jira/browse/JBIDE-1548
- *
- *
- */
-public class JsfJbide1548Test extends VpeTest {
-
- // type of input tag
-
- // import project name
-
- public static final String IMPORT_PROJECT_NAME = "jsfTest";
-
- public JsfJbide1548Test(String name) {
- super(name);
- }
-
- /*
- * JBIDE's test cases
- */
-
- public void testJbide() throws Throwable {
-
- // wait
- TestUtil.waitForJobs();
- // set exception
- setException(null);
-
- // get test page path
- IFile file = (IFile) TestUtil.getComponentPath(
- "JBIDE/1548/JBIDE-1548.jsp", 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();
-
- assertNotNull(element);
-
- // get root node
- nsIDOMNode node = (nsIDOMNode) element
- .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
-
- List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
-
- // find "table" elements
- TestUtil.findElementsByName(node, elements, HTML.TAG_TABLE);
-
- assertEquals(2, elements.size());
-
- // get first table. It has default attributes (minValue=0, maxValue=100)
- nsIDOMNode defaultInputSlider = elements.get(0);
- // check min-,max- values
- checkMinMaxValue(defaultInputSlider, 0, 100);
-
- // get first table. It has edited attributes (minValue=-10,
- // maxValue=200)
- nsIDOMNode editedInputSlider = elements.get(1);
- // check min-,max- values
- checkMinMaxValue(editedInputSlider, -10, 200);
-
- // check exception
- if (getException() != null) {
- throw getException();
- }
-
- }
-
- /**
- * check minValue and maxValue
- *
- * inputNumberSlider has next structure
- *
- * <code>
- * <table>
- * <tr>
- * <td>minValue</td>
- * <td>maxValue</td>
- * </tr>
- * ....
- * </table>
- * </code>
- *
- */
- private void checkMinMaxValue(nsIDOMNode defaultInputSlider,
- int expectedMinValue, int expectedMaxValue) {
-
- // get "tr" element
- nsIDOMNode trNode = defaultInputSlider.getChildNodes().item(0);
- assertNotNull(trNode);
- // get first "td" element which contain minValue
- nsIDOMNode td1Node = trNode.getChildNodes().item(0);
- assertNotNull(td1Node);
-
- // get second "td" element which contain maxValue
- nsIDOMNode td2Node = trNode.getChildNodes().item(1);
- assertNotNull(td2Node);
-
- // get minValue
- nsIDOMNode minValue = td1Node.getChildNodes().item(0);
- assertNotNull(minValue);
-
- // get maxValue
- nsIDOMNode maxValue = td2Node.getChildNodes().item(0);
- assertNotNull(maxValue);
-
- // check min value
- String minValueString = minValue.getNodeValue();
- assertNotNull(minValueString);
- assertEquals(expectedMinValue, Integer.parseInt(minValueString));
-
- // check max value
- String maxValueString = maxValue.getNodeValue();
- assertNotNull(maxValueString);
- assertEquals(expectedMaxValue, Integer.parseInt(maxValueString));
-
- return;
- }
-
-}
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1548/JBIDE-1548.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1548/JBIDE-1548.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/JBIDE/1548/JBIDE-1548.xhtml 2008-02-27
11:38:19 UTC (rev 6593)
@@ -0,0 +1,17 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+
+<head>
+</head>
+<body>
+ <!-- Input Number Slider -->
+ <rich:inputNumberSlider />
+
+ <rich:inputNumberSlider minValue="-10" maxValue="200"
value="40" />
+</body>
+</html>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/Jbide1548Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/Jbide1548Test.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/jbide/Jbide1548Test.java 2008-02-27
11:38:19 UTC (rev 6593)
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+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;
+
+/**
+ * Class for testing all jsf bugs
+ *
+ * @author sdzmitrovich
+ *
+ * test for
http://jira.jboss.com/jira/browse/JBIDE-1548
+ *
+ *
+ */
+public class Jbide1548Test extends VpeTest {
+
+ // type of input tag
+
+ // import project name
+
+ public static final String IMPORT_PROJECT_NAME = "richFacesTest";
+
+ public Jbide1548Test(String name) {
+ super(name);
+ }
+
+ /*
+ * JBIDE's test cases
+ */
+
+ public void testJbide() throws Throwable {
+
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(
+ "JBIDE/1548/JBIDE-1548.xhtml", 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();
+
+ assertNotNull(element);
+
+ // get root node
+ nsIDOMNode node = (nsIDOMNode) element
+ .queryInterface(nsIDOMNode.NS_IDOMNODE_IID);
+
+ List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
+
+ // find "table" elements
+ TestUtil.findElementsByName(node, elements, HTML.TAG_TABLE);
+
+ assertEquals(2, elements.size());
+
+ // get first table. It has default attributes (minValue=0, maxValue=100)
+ nsIDOMNode defaultInputSlider = elements.get(0);
+ // check min-,max- values
+ checkMinMaxValue(defaultInputSlider, 0, 100);
+
+ // get first table. It has edited attributes (minValue=-10,
+ // maxValue=200)
+ nsIDOMNode editedInputSlider = elements.get(1);
+ // check min-,max- values
+ checkMinMaxValue(editedInputSlider, -10, 200);
+
+ // check exception
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+
+ /**
+ * check minValue and maxValue
+ *
+ * inputNumberSlider has next structure
+ *
+ * <code>
+ * <table>
+ * <tr>
+ * <td>minValue</td>
+ * <td>maxValue</td>
+ * </tr>
+ * ....
+ * </table>
+ * </code>
+ *
+ */
+ private void checkMinMaxValue(nsIDOMNode defaultInputSlider,
+ int expectedMinValue, int expectedMaxValue) {
+
+ // get "tr" element
+ nsIDOMNode trNode = defaultInputSlider.getChildNodes().item(0);
+ assertNotNull(trNode);
+ // get first "td" element which contain minValue
+ nsIDOMNode td1Node = trNode.getChildNodes().item(0);
+ assertNotNull(td1Node);
+
+ // get second "td" element which contain maxValue
+ nsIDOMNode td2Node = trNode.getChildNodes().item(1);
+ assertNotNull(td2Node);
+
+ // get minValue
+ nsIDOMNode minValue = td1Node.getChildNodes().item(0);
+ assertNotNull(minValue);
+
+ // get maxValue
+ nsIDOMNode maxValue = td2Node.getChildNodes().item(0);
+ assertNotNull(maxValue);
+
+ // check min value
+ String minValueString = minValue.getNodeValue();
+ assertNotNull(minValueString);
+ assertEquals(expectedMinValue, Integer.parseInt(minValueString));
+
+ // check max value
+ String maxValueString = maxValue.getNodeValue();
+ assertNotNull(maxValueString);
+ assertEquals(expectedMaxValue, Integer.parseInt(maxValueString));
+
+ return;
+ }
+
+}