Author: estherbin
Date: 2008-08-06 05:44:17 -0400 (Wed, 06 Aug 2008)
New Revision: 9560
Removed:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/CommonRichFacesTestCase.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesColumnsTemplateTestCase.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComboBoxTemplateTestCase.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesFileUploadTemplateTestCase.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesInplaceInputTemplateTestCase.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesInplaceSelectTemplateTestCase.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesPickListTemplateTestCase.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesProgressBarTemplateTestCase.java
Log:
Move test cases from *.vpe.test to the vpe.ui.test package.
Deleted:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/CommonRichFacesTestCase.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/CommonRichFacesTestCase.java 2008-08-06
09:39:08 UTC (rev 9559)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/CommonRichFacesTestCase.java 2008-08-06
09:44:17 UTC (rev 9560)
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * 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.richfaces.test;
-
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.FileEditorInput;
-import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
-import org.jboss.tools.vpe.editor.VpeController;
-import org.jboss.tools.vpe.editor.VpeEditorPart;
-import org.jboss.tools.vpe.ui.test.TestUtil;
-import org.jboss.tools.vpe.ui.test.VpeTest;
-import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
-import org.mozilla.interfaces.nsIDOMDocument;
-import org.mozilla.interfaces.nsIDOMElement;
-
-
-/**
- * The Class CommonRichFacesTestCase.
- *
- * @author Eugene Stherbin
- */
-public abstract class CommonRichFacesTestCase extends VpeTest {
-
- /**
- * The Constructor.
- *
- * @param name the name
- */
- public CommonRichFacesTestCase(String name) {
- super(name);
- setCheckWarning(false);
- }
-
- /**
- * get xulrunner source page.
- *
- * @param part - JSPMultiPageEditor
- *
- * @return nsIDOMDocument
- */
- protected nsIDOMDocument getVpeVisualDocument(JSPMultiPageEditor part) {
-
- VpeEditorPart visualEditor = (VpeEditorPart) part.getVisualEditor();
-
- VpeController vpeController = visualEditor.getController();
-
- // get xulRunner editor
- XulRunnerEditor xulRunnerEditor = vpeController.getXulRunnerEditor();
-
- // get dom document
- nsIDOMDocument document = xulRunnerEditor.getDOMDocument();
-
- return document;
- }
-
- /**
- * Perform test for rich faces component.
- *
- * @param componentPage the component page
- *
- * @return the ns IDOM element
- *
- * @throws Throwable the throwable
- */
- protected nsIDOMElement performTestForRichFacesComponent(IFile componentPage) throws
Throwable {
- nsIDOMElement rst = null;
- TestUtil.waitForJobs();
-
- setException(null);
-
- // IFile file = (IFile)
- // TestUtil.getComponentPath(componentPage,getImportProjectName());
- IEditorInput input = new FileEditorInput(componentPage);
-
- TestUtil.waitForJobs();
- //
- JSPMultiPageEditor editor = (JSPMultiPageEditor)
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(
- input, EDITOR_ID, true);
-
- // get dom document
- nsIDOMDocument document = getVpeVisualDocument(editor);
- rst = document.getDocumentElement();
- // check that element is not null
- assertNotNull(rst);
- return rst;
- }
-
- void fail(Throwable t){
- fail("Test case was fail "+t.getMessage()+":"+t);
- }
-}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesColumnsTemplateTestCase.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesColumnsTemplateTestCase.java 2008-08-06
09:39:08 UTC (rev 9559)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesColumnsTemplateTestCase.java 2008-08-06
09:44:17 UTC (rev 9560)
@@ -13,6 +13,8 @@
package org.jboss.tools.jsf.vpe.richfaces.test;
+import static org.jboss.tools.vpe.ui.test.TestUtil.performTestForRichFacesComponent;
+
import java.util.ArrayList;
import java.util.List;
@@ -20,17 +22,16 @@
import org.eclipse.core.runtime.CoreException;
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.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
-
/**
* Test case for testing <rich:columns>.
*
* @author Eugene Stherbin
*/
-public class RichFacesColumnsTemplateTestCase extends CommonRichFacesTestCase {
-
+public class RichFacesColumnsTemplateTestCase extends VpeTest {
/** The Constant COLUMNS_WITH_ATTRIBUTES. */
private static final String COLUMNS_WITH_ATTRIBUTES =
"components/columns/columnsWithAttributes.xhtml";
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComboBoxTemplateTestCase.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComboBoxTemplateTestCase.java 2008-08-06
09:39:08 UTC (rev 9559)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComboBoxTemplateTestCase.java 2008-08-06
09:44:17 UTC (rev 9560)
@@ -20,6 +20,7 @@
import org.eclipse.ui.PartInitException;
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.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -29,37 +30,37 @@
*
* @author Eugene Stherbin
*/
-public class RichFacesComboBoxTemplateTestCase extends CommonRichFacesTestCase {
+public class RichFacesComboBoxTemplateTestCase extends VpeTest {
/** The Constant _150PX. */
- private static final String _150PX = "150px";
+ private static final String _150PX = "150px"; //$NON-NLS-1$
/** The Constant _250PX. */
- private static final String _250PX = "150px";
+ private static final String _250PX = "150px"; //$NON-NLS-1$
/** The Constant _255PX. */
- private static final String _255PX = "255px";
+ private static final String _255PX = "255px"; //$NON-NLS-1$
/** The Constant COMPONENTS_COMBO_BOX_WITHOUT_ATTR. */
- private static final String COMPONENTS_COMBO_BOX_WITHOUT_ATTR =
"components/comboBox/comboBox.xhtml";
+ private static final String COMPONENTS_COMBO_BOX_WITHOUT_ATTR =
"components/comboBox/comboBox.xhtml"; //$NON-NLS-1$
/** The Constant COMPONENTS_COMBO_WITH_ATTR_TEMPLATE. */
- private static final String COMPONENTS_COMBO_WITH_ATTR_TEMPLATE =
"components/comboBox/comboBoxWithAttributes.xhtml";
+ private static final String COMPONENTS_COMBO_WITH_ATTR_TEMPLATE =
"components/comboBox/comboBoxWithAttributes.xhtml"; //$NON-NLS-1$
/** The Constant COMPONENTS_COMBO_WITH_ATTR_TEMPLATE2. */
- private static final String COMPONENTS_COMBO_WITH_ATTR_TEMPLATE2 =
"components/comboBox/comboBoxWithAttributes2.xhtml";
+ private static final String COMPONENTS_COMBO_WITH_ATTR_TEMPLATE2 =
"components/comboBox/comboBoxWithAttributes2.xhtml"; //$NON-NLS-1$
/** DEFAULT_INPUT_STYLE. */
- private static final String DEFAULT_INPUT_STYLE = "rich-combobox-font-disabled
rich-combobox-input-inactive";
+ private static final String DEFAULT_INPUT_STYLE = "rich-combobox-font-disabled
rich-combobox-input-inactive"; //$NON-NLS-1$
/** The Constant DEFAULT_WIDTH. */
- private static final String DEFAULT_WIDTH = "width: 150px;";
+ private static final String DEFAULT_WIDTH = "width: 150px;"; //$NON-NLS-1$
/** The Constant EL_VALUE. */
- private static final String EL_VALUE = "#{bean.value}";
+ private static final String EL_VALUE = "#{bean.value}"; //$NON-NLS-1$
/** The Constant SELECT_ANY_VALUE. */
- private static final String SELECT_ANY_VALUE = "Select Any Value";
+ private static final String SELECT_ANY_VALUE = "Select Any Value";
//$NON-NLS-1$
/** The Constant ZERO. */
private static final int ZERO = 0;
@@ -85,7 +86,7 @@
* @throws PartInitException the part init exception
*/
private nsIDOMElement baseTableCheck(String page, String width) throws
PartInitException, Throwable {
- final nsIDOMElement rst = performTestForRichFacesComponent((IFile)
TestUtil.getComponentPath(page,
+ final nsIDOMElement rst = TestUtil.performTestForRichFacesComponent((IFile)
TestUtil.getComponentPath(page,
RichFacesComponentTest.IMPORT_PROJECT_NAME));
List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
@@ -95,15 +96,15 @@
TestUtil.findAllElementsByName(rst, elements, HTML.TAG_DIV);
for(nsIDOMNode e:elements){
nsIDOMElement div = (nsIDOMElement)
e.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
-
System.err.println(div.getNodeName()+":"+div.getAttribute(HTML.ATTR_CLASS));
+
System.err.println(div.getNodeName()+":"+div.getAttribute(HTML.ATTR_CLASS));
//$NON-NLS-1$
}
// assertEquals("Size should be 5", 5, elements.size());
nsIDOMElement divOne = (nsIDOMElement)
elements.get(4).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- assertTrue("Style classes should be contains
",divOne.getAttribute(HTML.ATTR_CLASS).contains("rich-combobox-font
rich-combobox"));
- assertTrue("Defaule style should be contains " + width,
divOne.getAttribute(HTML.ATTR_STYLE).indexOf(width) > 1);
- assertTrue("Defaule style should be contains " + width,
divOne.getAttribute(HTML.ATTR_STYLE).contains("width"));
+ assertTrue("Style classes should be contains
",divOne.getAttribute(HTML.ATTR_CLASS).contains("rich-combobox-font
rich-combobox")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertTrue("Defaule style should be contains " + width,
divOne.getAttribute(HTML.ATTR_STYLE).indexOf(width) > 1); //$NON-NLS-1$
+ assertTrue("Defaule style should be contains " + width,
divOne.getAttribute(HTML.ATTR_STYLE).contains("width")); //$NON-NLS-1$
//$NON-NLS-2$
// Check input
return rst;
@@ -120,9 +121,9 @@
TestUtil.findAllElementsByName(rst, elements, HTML.TAG_INPUT);
- assertEquals("Size should be equals 2", 3, elements.size());
+ assertEquals("Size should be equals 2", 3, elements.size());
//$NON-NLS-1$
final nsIDOMElement input = (nsIDOMElement)
elements.get(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- assertEquals("Value should be equals " + inputValue, inputValue,
input.getAttribute(HTML.ATTR_VALUE));
+ assertEquals("Value should be equals " + inputValue, inputValue,
input.getAttribute(HTML.ATTR_VALUE)); //$NON-NLS-1$
}
/**
@@ -164,11 +165,11 @@
TestUtil.findAllElementsByName(rst, elements, HTML.TAG_INPUT);
- assertEquals("Size should be equals 2", 3, elements.size());
+ assertEquals("Size should be equals 2", 3, elements.size());
//$NON-NLS-1$
final nsIDOMElement input = (nsIDOMElement)
elements.get(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- assertEquals("Default input class should be equals " +
DEFAULT_INPUT_STYLE, input.getAttribute(HTML.ATTR_CLASS),
+ assertEquals("Default input class should be equals " +
DEFAULT_INPUT_STYLE, input.getAttribute(HTML.ATTR_CLASS), //$NON-NLS-1$
DEFAULT_INPUT_STYLE);
// assertEquals("Input style style should be empty", "",
input.getAttribute(HTML.ATTR_STYLE));
// assertEquals("Input type should be text", HTML.VALUE_TEXT_TYPE,
input.getAttribute(HTML.ATTR_TYPE));
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesFileUploadTemplateTestCase.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesFileUploadTemplateTestCase.java 2008-08-06
09:39:08 UTC (rev 9559)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesFileUploadTemplateTestCase.java 2008-08-06
09:44:17 UTC (rev 9560)
@@ -6,6 +6,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.PartInitException;
import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
/**
@@ -13,10 +14,10 @@
*
* @author Eugene Stherbin
*/
-public class RichFacesFileUploadTemplateTestCase extends CommonRichFacesTestCase {
+public class RichFacesFileUploadTemplateTestCase extends VpeTest {
/** The Constant COMPONENTS_FILE_UPLOAD_FILE_UPLOAD_BASE. */
- private static final String COMPONENTS_FILE_UPLOAD_FILE_UPLOAD_BASE =
"components/fileUpload/fileUpload.xhtml";
+ private static final String COMPONENTS_FILE_UPLOAD_FILE_UPLOAD_BASE =
"components/fileUpload/fileUpload.xhtml"; //$NON-NLS-1$
/**
* The Constructor.
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesInplaceInputTemplateTestCase.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesInplaceInputTemplateTestCase.java 2008-08-06
09:39:08 UTC (rev 9559)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesInplaceInputTemplateTestCase.java 2008-08-06
09:44:17 UTC (rev 9560)
@@ -20,6 +20,7 @@
import org.eclipse.core.runtime.CoreException;
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.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -29,28 +30,28 @@
*
* @author Eugene Stherbin
*/
-public class RichFacesInplaceInputTemplateTestCase extends CommonRichFacesTestCase {
+public class RichFacesInplaceInputTemplateTestCase extends VpeTest {
/** The Constant EL_VALUE. */
- private static final String EL_VALUE = "#{person.name}";
+ private static final String EL_VALUE = "#{person.name}"; //$NON-NLS-1$
/** The Constant MY_STYLE_CLASS. */
- private static final String MY_STYLE_CLASS = "myStyleClass";
+ private static final String MY_STYLE_CLASS = "myStyleClass"; //$NON-NLS-1$
/** The Constant NULL. */
- private static final String NULL = "null";
+ private static final String NULL = "null"; //$NON-NLS-1$
/** The Constant RICH_INPLACE_VIEW. */
- private static final String RICH_INPLACE_VIEW = "rich-inplace
rich-inplace-view";
+ private static final String RICH_INPLACE_VIEW = "rich-inplace
rich-inplace-view"; //$NON-NLS-1$
/** The Constant TEMPLATE_WITH_EMPTY_TAG. */
- private static final String TEMPLATE_WITH_EMPTY_TAG =
"components/inplaceInput/inplaceInput.xhtml";
+ private static final String TEMPLATE_WITH_EMPTY_TAG =
"components/inplaceInput/inplaceInput.xhtml"; //$NON-NLS-1$
/** The Constant TEMPLATE_WITH_VALUE_AND_STYLE_CLASS. */
- private static final String TEMPLATE_WITH_VALUE_AND_STYLE_CLASS =
"components/inplaceInput/inplaceInputWithStyleClassAttribute.xhtml";
+ private static final String TEMPLATE_WITH_VALUE_AND_STYLE_CLASS =
"components/inplaceInput/inplaceInputWithStyleClassAttribute.xhtml";
//$NON-NLS-1$
/** The Constant TEMPLATE_WITH_VALUE_ATTR. */
- private static final String TEMPLATE_WITH_VALUE_ATTR =
"components/inplaceInput/inplaceInputWithValueAttribute.xhtml";
+ private static final String TEMPLATE_WITH_VALUE_ATTR =
"components/inplaceInput/inplaceInputWithValueAttribute.xhtml"; //$NON-NLS-1$
/**
* The Constructor.
@@ -72,19 +73,19 @@
* @throws Throwable the throwable
*/
private void baseCheck(String page, String value, String styleClass) throws
Throwable, CoreException {
- final nsIDOMElement rst = performTestForRichFacesComponent((IFile)
TestUtil.getComponentPath(page,
+ final nsIDOMElement rst = TestUtil.performTestForRichFacesComponent((IFile)
TestUtil.getComponentPath(page,
RichFacesComponentTest.IMPORT_PROJECT_NAME));
List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
TestUtil.findAllElementsByName(rst, elements, HTML.TAG_SPAN);
- assertEquals("Count of items should be 1", 1, elements.size());
+ assertEquals("Count of items should be 1", 1, elements.size());
//$NON-NLS-1$
final nsIDOMElement element = (nsIDOMElement)
elements.get(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- String first = "null";
- String second = "null";
+ String first = "null"; //$NON-NLS-1$
+ String second = "null"; //$NON-NLS-1$
if(value!=null){
first = value;
@@ -93,9 +94,9 @@
if(element.getFirstChild().getNodeValue()!=null){
second = element.getFirstChild().getNodeValue();
}
- assertEquals("Text value should be equals 'null'", first,
second);
+ assertEquals("Text value should be equals 'null'", first,
second); //$NON-NLS-1$
- assertTrue("Style class should be equals " + styleClass,
element.getAttribute(HTML.ATTR_CLASS).contains(styleClass));
+ assertTrue("Style class should be equals " + styleClass,
element.getAttribute(HTML.ATTR_CLASS).contains(styleClass)); //$NON-NLS-1$
}
/**
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesInplaceSelectTemplateTestCase.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesInplaceSelectTemplateTestCase.java 2008-08-06
09:39:08 UTC (rev 9559)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesInplaceSelectTemplateTestCase.java 2008-08-06
09:44:17 UTC (rev 9560)
@@ -17,6 +17,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ui.PartInitException;
import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
/**
@@ -24,7 +25,7 @@
*
* @author Eugene Stherbin
*/
-public class RichFacesInplaceSelectTemplateTestCase extends CommonRichFacesTestCase {
+public class RichFacesInplaceSelectTemplateTestCase extends VpeTest {
/** The Constant COMPONENTS_INPLACE_SELECT_INPLACE_SELECT_XHTML. */
private static final String COMPONENTS_INPLACE_SELECT_INPLACE_SELECT_XHTML =
"components/inplaceSelect/inplaceSelect.xhtml";
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesPickListTemplateTestCase.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesPickListTemplateTestCase.java 2008-08-06
09:39:08 UTC (rev 9559)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesPickListTemplateTestCase.java 2008-08-06
09:44:17 UTC (rev 9560)
@@ -20,6 +20,7 @@
import org.eclipse.core.runtime.CoreException;
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.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -29,7 +30,7 @@
*
* @author Eugene Stherbin
*/
-public class RichFacesPickListTemplateTestCase extends CommonRichFacesTestCase {
+public class RichFacesPickListTemplateTestCase extends VpeTest {
/**
* The Constructor.
@@ -46,28 +47,28 @@
public void testSimplePickList() {
nsIDOMElement rst;
try {
- rst = performTestForRichFacesComponent((IFile)
TestUtil.getComponentPath("components/pickList/pickList.xhtml",
+ rst = TestUtil.performTestForRichFacesComponent((IFile)
TestUtil.getComponentPath("components/pickList/pickList.xhtml", //$NON-NLS-1$
RichFacesComponentTest.IMPORT_PROJECT_NAME));
final List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
TestUtil.findAllElementsByName(rst, elements, HTML.TAG_TABLE);
- assertEquals("Count of tables should be 3", 3, elements.size());
+ assertEquals("Count of tables should be 3", 3, elements.size());
//$NON-NLS-1$
nsIDOMElement tableOne = (nsIDOMElement)
elements.get(0).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- assertEquals("Style class should be equals",
"rich-list-picklist", tableOne.getAttribute(HTML.ATTR_CLASS));
- assertEquals("Style should be empty", "",
tableOne.getAttribute(HTML.ATTR_STYLE));
+ assertEquals("Style class should be equals",
"rich-list-picklist", tableOne.getAttribute(HTML.ATTR_CLASS)); //$NON-NLS-1$
//$NON-NLS-2$
+ assertEquals("Style should be empty", "",
tableOne.getAttribute(HTML.ATTR_STYLE)); //$NON-NLS-1$ //$NON-NLS-2$
elements.clear();
TestUtil.findAllElementsByName(rst, elements, HTML.TAG_DIV);
- assertEquals("Count of divs should be 18", 18, elements.size());
+ assertEquals("Count of divs should be 18", 18, elements.size());
//$NON-NLS-1$
elements.clear();
TestUtil.findAllElementsByName(rst, elements, HTML.TAG_IMG);
- assertEquals("Count of divs should be 18", 4, elements.size());
+ assertEquals("Count of divs should be 18", 4, elements.size());
//$NON-NLS-1$
} catch (CoreException e) {
- fail(e);
+ TestUtil.fail(e);
} catch (Throwable e) {
- fail(e);
+ TestUtil.fail(e);
}
}
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesProgressBarTemplateTestCase.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesProgressBarTemplateTestCase.java 2008-08-06
09:39:08 UTC (rev 9559)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesProgressBarTemplateTestCase.java 2008-08-06
09:44:17 UTC (rev 9560)
@@ -20,6 +20,7 @@
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -29,28 +30,28 @@
*
* @author Eugene Stherbin
*/
-public class RichFacesProgressBarTemplateTestCase extends CommonRichFacesTestCase {
+public class RichFacesProgressBarTemplateTestCase extends VpeTest {
/** The Constant CHECK_BASE_STYLE. */
- private static final String CHECK_BASE_STYLE = "rich-progress-bar-block
rich-progress-bar-width rich-progress-bar-shell";
+ private static final String CHECK_BASE_STYLE = "rich-progress-bar-block
rich-progress-bar-width rich-progress-bar-shell"; //$NON-NLS-1$
/** The Constant MY_STYLE_CLASS. */
- private static final String MY_STYLE_CLASS = " myStyleClass";
+ private static final String MY_STYLE_CLASS = " myStyleClass";
//$NON-NLS-1$
/** The Constant PERCENTAGES. */
- private static final String PERCENTAGES = " 60%;";
+ private static final String PERCENTAGES = " 60%;"; //$NON-NLS-1$
/** The Constant SIMPLE_PAGE. */
- private static final String SIMPLE_PAGE =
"/components/progressBar/progressBar.xhtml";
+ private static final String SIMPLE_PAGE =
"/components/progressBar/progressBar.xhtml"; //$NON-NLS-1$
/** The Constant SIMPLE_WITH_ATTRIBUTES. */
- private static final String SIMPLE_WITH_ATTRIBUTES =
"/components/progressBar/progressBarWithAttributes.xhtml";
+ private static final String SIMPLE_WITH_ATTRIBUTES =
"/components/progressBar/progressBarWithAttributes.xhtml"; //$NON-NLS-1$
/** The Constant STYLE_1_FOR_CHECK. */
- private static final String STYLE_1_FOR_CHECK = "width: 250px; text-align:
left;";
+ private static final String STYLE_1_FOR_CHECK = "width: 250px; text-align:
left;"; //$NON-NLS-1$
/** The Constant STYLE_CLASS_2. */
- private static final String STYLE_CLASS_2 = "rich-progress-bar-height
rich-progress-bar-uploaded null";
+ private static final String STYLE_CLASS_2 = "rich-progress-bar-height
rich-progress-bar-uploaded null"; //$NON-NLS-1$
/**
* The Constructor.
@@ -74,7 +75,7 @@
nsIDOMElement rst = null;
try {
- rst = performTestForRichFacesComponent((IFile)
TestUtil.getComponentPath(page, RichFacesComponentTest.IMPORT_PROJECT_NAME));
+ rst = TestUtil.performTestForRichFacesComponent((IFile)
TestUtil.getComponentPath(page, RichFacesComponentTest.IMPORT_PROJECT_NAME));
} catch (CoreException e) {
fail(e.getMessage() + e);
} catch (Throwable e) {
@@ -84,16 +85,16 @@
final List<nsIDOMNode> elements = new ArrayList<nsIDOMNode>();
TestUtil.findAllElementsByName(rst, elements, HTML.TAG_DIV);
- assertEquals("Size should be 2", 5, elements.size());
+ assertEquals("Size should be 2", 5, elements.size()); //$NON-NLS-1$
final nsIDOMElement divOne = (nsIDOMElement)
elements.get(3).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- assertEquals("Style class should be equals" + styleClass, styleClass,
divOne.getAttribute(HTML.ATTR_CLASS));
- assertEquals("Style should be equals" + style, style,
divOne.getAttribute(HTML.ATTR_STYLE));
+ assertEquals("Style class should be equals" + styleClass, styleClass,
divOne.getAttribute(HTML.ATTR_CLASS)); //$NON-NLS-1$
+ assertEquals("Style should be equals" + style, style,
divOne.getAttribute(HTML.ATTR_STYLE)); //$NON-NLS-1$
final nsIDOMElement divTwo = (nsIDOMElement)
elements.get(4).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- assertEquals("Style class should be equals" + twoStyleClass,
twoStyleClass, divTwo.getAttribute(HTML.ATTR_CLASS));
- assertEquals("Style should be equals" + style2, style2,
divTwo.getAttribute(HTML.ATTR_STYLE));
+ assertEquals("Style class should be equals" + twoStyleClass,
twoStyleClass, divTwo.getAttribute(HTML.ATTR_CLASS)); //$NON-NLS-1$
+ assertEquals("Style should be equals" + style2, style2,
divTwo.getAttribute(HTML.ATTR_STYLE)); //$NON-NLS-1$
}
@@ -101,7 +102,7 @@
* Test simple.
*/
public void testSimple() {
- baseTest(SIMPLE_PAGE, CHECK_BASE_STYLE, "height: 13px; text-align:
left;", STYLE_CLASS_2,"height: 13px; width: 60%;");
+ baseTest(SIMPLE_PAGE, CHECK_BASE_STYLE, "height: 13px; text-align:
left;", STYLE_CLASS_2,"height: 13px; width: 60%;"); //$NON-NLS-1$
//$NON-NLS-2$
}
/**