JBoss Tools SVN: r10359 - in trunk: vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-09-18 10:51:55 -0400 (Thu, 18 Sep 2008)
New Revision: 10359
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2781
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java 2008-09-18 14:48:16 UTC (rev 10358)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java 2008-09-18 14:51:55 UTC (rev 10359)
@@ -10,10 +10,6 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.jsf.test;
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-
import org.jboss.tools.vpe.ui.test.ComponentContentTest;
/**
@@ -24,134 +20,106 @@
*/
public class JsfComponentContentTest extends ComponentContentTest {
- // import project name
- public static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
-
- public static final String TESTS_ROOT_NAME = "tests"; //$NON-NLS-1$
-
public JsfComponentContentTest(String name) {
super(name);
setCheckWarning(false);
}
public void testCommandButton() throws Throwable {
-
- Map<String, String> mapIds = new HashMap<String, String>();
- mapIds.put("commandButton1", "commandButton1");
- mapIds.put("commandButton2", "commandButton2");
- mapIds.put("commandButton3", "commandButton3");
- mapIds.put("commandButton4", "commandButton4");
- mapIds.put("commandButton5", "commandButton5");
- performContentTest("components/commandButton.jsp", //$NON-NLS-1$
- "commandButton.xml", mapIds); //$NON-NLS-1$
+ performContentTest("components/commandButton.jsp"); //$NON-NLS-1$
}
public void testCommandLink() throws Throwable {
- Map<String, String> mapIds = new HashMap<String, String>();
- mapIds.put("commandLink1", "commandLink1");
- mapIds.put("commandLink2", "commandLink2");
- performContentTest("components/commandLink.jsp", //$NON-NLS-1$
- "commandLink.xml", mapIds); //$NON-NLS-1$
+ performContentTest("components/commandLink.jsp"); //$NON-NLS-1$
}
public void testDataTable() throws Throwable {
- performContentTest("components/dataTable.jsp", "dataTable",
- "dataTable.xml");
+ performContentTest("components/dataTable.jsp"); //$NON-NLS-1$
}
public void testForm() throws Throwable {
- performContentTest("components/form.jsp", "form", "form.xml");
+ performContentTest("components/form.jsp"); //$NON-NLS-1$
}
public void testGraphicImage() throws Throwable {
- Map<String, String> mapIds = new HashMap<String, String>();
- mapIds.put("graphicImage1", "graphicImage1");
- mapIds.put("graphicImage2", "graphicImage2");
- performContentTest("components/graphicImage.jsp", //$NON-NLS-1$
- "graphicImage.xml", mapIds); //$NON-NLS-1$
+ performContentTest("components/graphicImage.jsp"); //$NON-NLS-1$
}
public void testInputHidden() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testInputSecret() throws Throwable {
- performContentTest("components/inputSecret.jsp", "inputSecret",
- "inputSecret.xml");
+ performContentTest("components/inputSecret.jsp"); //$NON-NLS-1$
}
public void testInputText() throws Throwable {
+ performContentTest("components/inputText.jsp"); //$NON-NLS-1$
- performContentTest("components/inputText.jsp", "inputText", //$NON-NLS-1$ //$NON-NLS-2$
- "inputText.xml"); //$NON-NLS-1$
-
}
public void testInputTextArea() throws Throwable {
- performContentTest("components/inputTextArea.jsp", "inputTextArea", //$NON-NLS-1$ //$NON-NLS-2$
- "inputTextArea.xml"); //$NON-NLS-1$
+ performContentTest("components/inputTextArea.jsp"); //$NON-NLS-1$
}
public void testMessage() throws Throwable {
- performContentTest("components/message.jsp", "message", //$NON-NLS-1$ //$NON-NLS-2$
- "message.xml"); //$NON-NLS-1$
+ performContentTest("components/message.jsp"); //$NON-NLS-1$
}
public void testMessages() throws Throwable {
- performContentTest("components/messages.jsp", "messages", //$NON-NLS-1$ //$NON-NLS-2$
- "messages.xml"); //$NON-NLS-1$
+ performContentTest("components/messages.jsp"); //$NON-NLS-1$
}
public void testOutputFormat() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testOutputLabel() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testOutputLink() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testOutputText() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testPanelGrid() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testPanelGroup() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testSelectBooleanCheckbox() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testSelectManyCheckbox() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testSelectManyListbox() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testSelectManyMenu() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testSelectOneListbox() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testSelectOneMenu() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void _testSelectOneRadio() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
/*
@@ -159,92 +127,87 @@
*/
public void testActionListener() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testAttribute() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testConvertDateTime() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testConvertNumber() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testConverter() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testFacet() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testLoadBundle() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testParam() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testPhaseListener() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testSelectItem() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testSelectItems() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testSetPropertyActionListener() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testSubview() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testValidateDoubleRange() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testValidateLength() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testValidateLongRange() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testValidator() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testValueChangeListener() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testVerbatim() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
public void testView() throws Throwable {
- assertTrue("it is necessery to add body of the test", false);
+ assertTrue("it is necessery to add body of the test", false); //$NON-NLS-1$
}
protected String getTestProjectName() {
- return IMPORT_PROJECT_NAME;
+ return JsfAllTests.IMPORT_PROJECT_NAME;
}
- @Override
- protected String getTestsRoot() {
- return JsfTestPlugin.getPluginResourcePath() + File.separator
- + TESTS_ROOT_NAME;
- }
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java 2008-09-18 14:48:16 UTC (rev 10358)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java 2008-09-18 14:51:55 UTC (rev 10359)
@@ -11,7 +11,7 @@
package org.jboss.tools.vpe.ui.test;
import java.io.File;
-import java.util.Map;
+import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IEditorInput;
@@ -31,176 +31,32 @@
*/
public abstract class ComponentContentTest extends VpeTest {
+ public static final String XML_FILE_EXTENSION = ".xml"; //$NON-NLS-1$
+
public ComponentContentTest(String name) {
super(name);
}
/**
*
- * @param elementPagePath
- * - path to test page
- * @param elementId
- * - id of element which will be tested
- * @param XmlSchemeContent
- * - probable content of test element
+ * there are several conditions:
*
- * @throws Throwable
- */
- protected void performContentTestByContent(String elementPagePath,
- String elementId, String xmlTestContent) throws Throwable {
- setException(null);
-
- IFile elementPageFile = (IFile) TestUtil.getComponentPath(
- elementPagePath, getTestProjectName());
-
- IEditorInput input = new FileEditorInput(elementPageFile);
-
- TestUtil.waitForJobs();
-
- IEditorPart editor = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage().openEditor(input,
- EDITOR_ID, true);
-
- assertNotNull(editor);
-
- TestUtil.waitForJobs();
-
- // get element by id
- nsIDOMElement vpeElement = findElementById(
- getVpeController((JSPMultiPageEditor) editor), elementId);
- assertNotNull(vpeElement);
-
- // get document
- Document modelDocument = TestDomUtil.getDocument(xmlTestContent);
- assertNotNull(modelDocument);
-
- // get element
- Element modelElement = modelDocument.getDocumentElement();
- assertNotNull(modelElement);
-
- assertEquals(true, TestDomUtil.compareNodes(vpeElement, modelElement));
-
- if (getException() != null) {
- throw getException();
- }
-
- }
-
- /**
- * use if xml file contain only one test
+ * 1) xml file which contain tests must be named 'name of test page' +
+ * '.xml'
*
- * @param elementPagePath
- * - path to test page
- * @param elementId
- * - id of element which will be tested
- * @param xmlTestPath
- * - path to xml file which contains tests of content
- * @param xmlTestId
- * - current id of test in xml file
- * @throws Throwable
- */
- protected void performContentTest(String elementPagePath, String elementId,
- String xmlTestPath) throws Throwable {
- setException(null);
-
- IFile elementPageFile = (IFile) TestUtil.getComponentPath(
- elementPagePath, getTestProjectName());
-
- IEditorInput input = new FileEditorInput(elementPageFile);
-
- TestUtil.waitForJobs();
-
- IEditorPart editor = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage().openEditor(input,
- EDITOR_ID, true);
-
- assertNotNull(editor);
-
- TestUtil.waitForJobs();
-
- // get xml test file
- File xmlTestFile = TestUtil.getXmlTestFile(xmlTestPath, getTestsRoot());
-
- // get document
- Document xmlTestDocument = TestDomUtil.getDocument(xmlTestFile);
- assertNotNull(xmlTestDocument);
-
- // compare DOMs
- assertEquals(true, compareElements(
- getVpeController((JSPMultiPageEditor) editor), xmlTestDocument,
- elementId));
-
- if (getException() != null) {
- throw getException();
- }
-
- }
-
- /**
+ * Example: test.jsp and test.jsp.xml
*
- * use if xml file contain several tests
+ * 2) a tag <test> in xml file and required element in test page must have
+ * the same attribute "id"
*
- * @param elementPagePath
- * - path to test page
- * @param elementId
- * - id of element which will be tested
- * @param xmlTestPath
- * - path to xml file which contains tests of content
- * @param xmlTestId
- * - current id of test in xml file
- * @throws Throwable
- */
- protected void performContentTest(String elementPagePath, String elementId,
- String xmlTestPath, String xmlTestId) throws Throwable {
- setException(null);
-
- IFile elementPageFile = (IFile) TestUtil.getComponentPath(
- elementPagePath, getTestProjectName());
-
- IEditorInput input = new FileEditorInput(elementPageFile);
-
- TestUtil.waitForJobs();
-
- IEditorPart editor = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow().getActivePage().openEditor(input,
- EDITOR_ID, true);
-
- assertNotNull(editor);
-
- TestUtil.waitForJobs();
-
- VpeController controller = getVpeController((JSPMultiPageEditor) editor);
-
- // get xml test file
- File xmlTestFile = TestUtil.getXmlTestFile(xmlTestPath, getTestsRoot());
-
- // get document
- Document xmlTestDocument = TestDomUtil.getDocument(xmlTestFile);
- assertNotNull(xmlTestDocument);
-
- assertEquals(true, compareElements(controller, xmlTestDocument,
- elementId, xmlTestId));
-
- if (getException() != null) {
- throw getException();
- }
-
- }
-
- /**
- * use if it is necessary to check several elements at the same time
+ * Example: <tests>... <test id="testId" > ...<tests> - in xml file and
+ * <html>... <x:testElement id="testId" > ... </html> - in test page
*
* @param elementPagePath
* - path to test page
- * @param xmlTestPath
- * - path to xml file which contains tests of content
- * @param mapId
- * - key is id of element which will be tested, value is
- * corresponding id of test in xml file
* @throws Throwable
*/
- protected void performContentTest(String elementPagePath,
- String xmlTestPath, Map<String, String> mapId) throws Throwable {
+ protected void performContentTest(String elementPagePath) throws Throwable {
setException(null);
IFile elementPageFile = (IFile) TestUtil.getComponentPath(
@@ -221,16 +77,20 @@
VpeController controller = getVpeController((JSPMultiPageEditor) editor);
// get xml test file
- File xmlTestFile = TestUtil.getXmlTestFile(xmlTestPath, getTestsRoot());
+ File xmlTestFile = TestUtil.getComponentPath(
+ elementPagePath + XML_FILE_EXTENSION, getTestProjectName())
+ .getLocation().toFile();
// get document
Document xmlTestDocument = TestDomUtil.getDocument(xmlTestFile);
assertNotNull(xmlTestDocument);
- for (String elementId : mapId.keySet()) {
+ List<String> ids = TestDomUtil.getTestIds(xmlTestDocument);
- assertEquals(true, compareElements(controller, xmlTestDocument,
- elementId, mapId.get(elementId)));
+ for (String id : ids) {
+
+ assertEquals(true, compareElements(controller, xmlTestDocument, id,
+ id));
}
if (getException() != null) {
@@ -258,29 +118,6 @@
}
- protected boolean compareElements(VpeController controller,
- Document xmlTestDocument, String elementId) {
-
- // get element by id
- nsIDOMElement vpeElement = findElementById(controller, elementId);
- assertNotNull(vpeElement);
-
- // get test element, get the first <test> tag in file
- Element xmlTestElement = TestDomUtil
- .getFirstChildElement(xmlTestDocument.getDocumentElement());
- assertNotNull(xmlTestElement);
-
- // model element is the first child of <test> tag
- Element xmlModelElement = TestDomUtil
- .getFirstChildElement(xmlTestElement);
-
- assertNotNull(xmlModelElement);
-
- // compare DOMs
- return TestDomUtil.compareNodes(vpeElement, xmlModelElement);
-
- }
-
/**
* find visual element by "id" entered in source part of vpe
*
@@ -306,10 +143,4 @@
*/
abstract protected String getTestProjectName();
- /**
- *
- * @return
- */
- abstract protected String getTestsRoot();
-
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java 2008-09-18 14:48:16 UTC (rev 10358)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java 2008-09-18 14:51:55 UTC (rev 10359)
@@ -14,6 +14,8 @@
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
import org.jboss.tools.common.model.util.XMLUtil;
import org.mozilla.interfaces.nsIDOMElement;
@@ -109,8 +111,8 @@
|| (!schemeNode.getNodeName().equalsIgnoreCase(
vpeNode.getNodeName()))
|| ((schemeNode.getNodeValue() != null) && (!schemeNode
- .getNodeValue().trim()
- .equalsIgnoreCase(vpeNode.getNodeValue().trim()))))
+ .getNodeValue().trim().equalsIgnoreCase(
+ vpeNode.getNodeValue().trim()))))
return false;
// compare node's attributes
@@ -163,4 +165,22 @@
return true;
}
+
+ /**
+ * get ids of tests
+ * @param testDocument
+ * @return
+ */
+ public static List<String> getTestIds(Document testDocument) {
+ Element rootElement = testDocument.getDocumentElement();
+ List<String> ids = new ArrayList<String>();
+ NodeList children = rootElement.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ if (child.getNodeType() == Node.ELEMENT_NODE)
+ ids.add(((Element) child).getAttribute(ID_ATTRIBUTE));
+
+ }
+ return ids;
+ }
}
15 years, 9 months
JBoss Tools SVN: r10358 - trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-09-18 10:48:16 -0400 (Thu, 18 Sep 2008)
New Revision: 10358
Modified:
trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericModelEditor.java
Log:
mark the editor dirty after editing
Modified: trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericModelEditor.java
===================================================================
--- trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericModelEditor.java 2008-09-18 12:29:03 UTC (rev 10357)
+++ trunk/flow/plugins/org.jboss.tools.flow.common/src/org/jboss/tools/flow/common/editor/GenericModelEditor.java 2008-09-18 14:48:16 UTC (rev 10358)
@@ -111,6 +111,7 @@
protected void initializeEditDomain() {
setEditDomain(new DefaultEditDomain(this));
+ getCommandStack().addCommandStackListener(this);
}
protected void initializeLanguage() {
15 years, 9 months
JBoss Tools SVN: r10357 - trunk/documentation/guides/GettingStartedGuide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-09-18 08:29:03 -0400 (Thu, 18 Sep 2008)
New Revision: 10357
Modified:
trunk/documentation/guides/GettingStartedGuide/en/modules/further_reading.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-407 - adding the role "updated";
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/further_reading.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/further_reading.xml 2008-09-18 12:11:28 UTC (rev 10356)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/further_reading.xml 2008-09-18 12:29:03 UTC (rev 10357)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="further_reading" xreflabel="further_reading">
+<chapter id="further_reading" xreflabel="further_reading" role="updated">
<?dbhtml filename="further_reading.html"?>
<chapterinfo>
<keywordset>
15 years, 9 months
JBoss Tools SVN: r10356 - trunk/documentation/guides/GettingStartedGuide/en.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-09-18 08:11:28 -0400 (Thu, 18 Sep 2008)
New Revision: 10356
Modified:
trunk/documentation/guides/GettingStartedGuide/en/master.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-407 - adding reference entity on path to JBoss Portal Tools Reference guide;
Modified: trunk/documentation/guides/GettingStartedGuide/en/master.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/master.xml 2008-09-18 12:09:59 UTC (rev 10355)
+++ trunk/documentation/guides/GettingStartedGuide/en/master.xml 2008-09-18 12:11:28 UTC (rev 10356)
@@ -20,7 +20,8 @@
<!ENTITY jsftutoriallink "../../jsf_tools_tutorial/html_single/index.html">
<!ENTITY strutsreflink "../../struts_tools_ref_guide/html_single/index.html">
<!ENTITY strutstutoriallink "../../struts_tools_tutorial/html_single/index.html">
-<!ENTITY strutstutoriallink "../../struts_tools_tutorial/html_single/index.html">
+<!ENTITY strutstutoriallink "../../struts_tools_tutorial/html_single/index.html">
+<!ENTITY jbossportallink "../../jboss_portal_tools_ref_guide/html_single/index.html">
<!ENTITY migrationlink "../../Exadel-migration/html_single/index.html">
]>
15 years, 9 months
JBoss Tools SVN: r10355 - trunk/documentation/guides/GettingStartedGuide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-09-18 08:09:59 -0400 (Thu, 18 Sep 2008)
New Revision: 10355
Modified:
trunk/documentation/guides/GettingStartedGuide/en/modules/further_reading.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-407 - adding link to new guide on JBoss Portal Tools
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/further_reading.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/further_reading.xml 2008-09-18 11:48:19 UTC (rev 10354)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/further_reading.xml 2008-09-18 12:09:59 UTC (rev 10355)
@@ -27,7 +27,7 @@
<para>
<emphasis role="bold">JSF Tools Tutorial</emphasis>
<ulink url="&jsftutoriallink;">(html)</ulink>
- </para>
+ </para>
<para> This tutorial will describe how to deal with classic/old style of JSF development and how
to create a simple JSF application using the JBoss Developer Studio. </para>
@@ -72,7 +72,7 @@
<para>
<emphasis role="bold">jBPM Tools Reference Guide</emphasis>
<ulink url="&jbpmlink;">(html)</ulink>
- </para>
+ </para>
<para>With jBPM Tools Reference Guide we'll help you to facilitate a cross-product
learning and know how you can speed your development using special editors and visual designers.
We'll also guide you through the steps on how to create a simple process and test it
@@ -81,20 +81,28 @@
<para>
<emphasis role="bold">Hibernate Tools Reference Guide</emphasis>
<ulink url="&hibernatelink;">(html)</ulink>
- </para>
+ </para>
<para>Throughout this guide you will learn how to install and use Hibernate Tools bath via Ant and
through Eclipse. We'll supply you with the information on how to create mapping files,
configuration file as well as a file for controlling reverse engineering by using specific
wizards that Hibernate tooling provides. Also you will know about Code Generation and
peculiarities of work within Hibernate Console Perspective.</para>
-
+
<para>
<emphasis role="bold">ESB Editor Reference Guide</emphasis>
<ulink url="&esblink;">(html)</ulink>
</para>
- <para>This guide provides you with the information on ESB Editor which allows you to develop ESB file.</para>
+ <para>This guide provides you with the information on ESB Editor which allows you to develop ESB
+ file.</para>
<para>
+ <emphasis role="bold">JBoss Portal Tools Reference Guide</emphasis>
+ <ulink url="&jbossportallink;">(html)</ulink>
+ </para>
+ <para>The guide gives a detail look at how you can easily build a Portlet Web Application with
+ JBoss Tools and deploy it onto JBoss Portal.</para>
+
+ <para>
<emphasis role="bold">Exadel Studio Migration Guide</emphasis>
<ulink url="&migrationlink;">(html)</ulink>
</para>
15 years, 9 months
JBoss Tools SVN: r10354 - trunk/documentation/jboss-tools-docs.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-09-18 07:48:19 -0400 (Thu, 18 Sep 2008)
New Revision: 10354
Modified:
trunk/documentation/jboss-tools-docs/all-guides.xml
trunk/documentation/jboss-tools-docs/pom.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-407 - adding JBoss Portal Tools Ref guide
Modified: trunk/documentation/jboss-tools-docs/all-guides.xml
===================================================================
--- trunk/documentation/jboss-tools-docs/all-guides.xml 2008-09-18 11:47:35 UTC (rev 10353)
+++ trunk/documentation/jboss-tools-docs/all-guides.xml 2008-09-18 11:48:19 UTC (rev 10354)
@@ -245,6 +245,20 @@
<fileMode>0644</fileMode>
<directoryMode>0755</directoryMode>
</fileSet>
+
+ <fileSet>
+ <directory>../../portlet/docs/reference/target/docbook/publish/en-US</directory>
+ <outputDirectory>/jboss_portal_tools_ref_guide</outputDirectory>
+ <filtered>false</filtered>
+ <lineEnding>keep</lineEnding>
+ <includes>
+ <include>**/*.*</include>
+ </includes>
+ <useStrictFiltering>false</useStrictFiltering>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <fileMode>0644</fileMode>
+ <directoryMode>0755</directoryMode>
+ </fileSet>
</fileSets>
</assembly>
\ No newline at end of file
Modified: trunk/documentation/jboss-tools-docs/pom.xml
===================================================================
--- trunk/documentation/jboss-tools-docs/pom.xml 2008-09-18 11:47:35 UTC (rev 10353)
+++ trunk/documentation/jboss-tools-docs/pom.xml 2008-09-18 11:48:19 UTC (rev 10354)
@@ -24,6 +24,7 @@
<module>../../struts/docs/struts_tools_tutorial</module>
<module>../../esb/docs/esb_ref_guide</module>
<module>../../ws/docs/reference</module>
+ <module>../../portlet/docs/reference</module>
<module>index</module>
</modules>
15 years, 9 months
JBoss Tools SVN: r10353 - trunk/documentation/jboss-tools-docs/index/en.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-09-18 07:47:35 -0400 (Thu, 18 Sep 2008)
New Revision: 10353
Modified:
trunk/documentation/jboss-tools-docs/index/en/master.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-407 - adding JBoss Portal Tools Ref guide
Modified: trunk/documentation/jboss-tools-docs/index/en/master.xml
===================================================================
--- trunk/documentation/jboss-tools-docs/index/en/master.xml 2008-09-18 11:42:42 UTC (rev 10352)
+++ trunk/documentation/jboss-tools-docs/index/en/master.xml 2008-09-18 11:47:35 UTC (rev 10353)
@@ -115,6 +115,14 @@
</primaryie>
</indexentry>
+ <indexentry>
+ <primaryie>JBoss Portal Tools Reference Guide <ulink
+ url="en/jboss_portal_tools_ref_guide/html/index.html">(html)</ulink>
+ <ulink url="en/jboss_portal_tools_ref_guide/html_single/index.html">(html single)</ulink>
+ <ulink url="en/jboss_portal_tools_ref_guide/pdf/JBoss_Portal_Tools_Reference_Guide.pdf"
+ >(pdf)</ulink>
+ </primaryie>
+ </indexentry>
<indexentry>
<primaryie>Exadel Studio Migration Guide <ulink
15 years, 9 months
JBoss Tools SVN: r10351 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test: resources/jsfTest/WebContent/pages/components/img and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-09-18 07:04:32 -0400 (Thu, 18 Sep 2008)
New Revision: 10351
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/img/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/img/image.jpeg
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/graphicImage.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/inputSecret.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/inputTextArea.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/message.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/messages.xml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandButton.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandLink.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/dataTable.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/graphicImage.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/inputSecret.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/inputText.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/inputTextArea.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/message.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/messages.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2781
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandButton.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandButton.jsp 2008-09-18 09:52:04 UTC (rev 10350)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandButton.jsp 2008-09-18 11:04:32 UTC (rev 10351)
@@ -11,8 +11,16 @@
<h:form id="commandButtonForm">
- <h:commandButton value="commandButton" />
+ <h:commandButton value="commandButton" id="commandButton1" />
+ <h:commandButton value="commandButton1" id="commandButton2" type="button" />
+
+ <h:commandButton value="commandButton3" id="commandButton3" type="reset" />
+
+ <h:commandButton value="commandButton4" id="commandButton4" type="submit" />
+
+ <h:commandButton value="commandButton5" id="commandButton5" image="" />
+
</h:form>
</f:view>
</body>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandLink.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandLink.jsp 2008-09-18 09:52:04 UTC (rev 10350)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/commandLink.jsp 2008-09-18 11:04:32 UTC (rev 10351)
@@ -11,7 +11,8 @@
<h:form id="commandLinkForm">
- <h:commandLink value="commandLink" />
+ <h:commandLink id="commandLink1" value="commandLink1" disabled="true" />
+ <h:commandLink id="commandLink2" value="commandLink2" disabled="false" />
</h:form>
</f:view>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/dataTable.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/dataTable.jsp 2008-09-18 09:52:04 UTC (rev 10350)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/dataTable.jsp 2008-09-18 11:04:32 UTC (rev 10351)
@@ -9,7 +9,7 @@
<f:view>
<h1><h:outputText value="dataTable" /></h1>
- <h:dataTable value="data">
+ <h:dataTable value="data" id="dataTable" >
<h:column>
<f:facet name="header">
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/graphicImage.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/graphicImage.jsp 2008-09-18 09:52:04 UTC (rev 10350)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/graphicImage.jsp 2008-09-18 11:04:32 UTC (rev 10351)
@@ -9,8 +9,9 @@
<f:view>
<h1><h:outputText value="graphicImage" /></h1>
- <h:graphicImage value="/img/image.jpeg"/>
-
+ <h:graphicImage value="" id="graphicImage1" />
+ <h:graphicImage value="img/image.jpeg" id="graphicImage2" />
+
</f:view>
</body>
</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/img/image.jpeg
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/img/image.jpeg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/inputSecret.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/inputSecret.jsp 2008-09-18 09:52:04 UTC (rev 10350)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/inputSecret.jsp 2008-09-18 11:04:32 UTC (rev 10351)
@@ -9,7 +9,7 @@
<f:view>
<h1><h:outputText value="inputSecret" /></h1>
- <h:inputSecret value="inputSecret"/>
+ <h:inputSecret value="inputSecret" id="inputSecret"/>
</f:view>
</body>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/inputText.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/inputText.jsp 2008-09-18 09:52:04 UTC (rev 10350)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/inputText.jsp 2008-09-18 11:04:32 UTC (rev 10351)
@@ -9,7 +9,7 @@
<f:view>
<h1><h:outputText value="inputText" /></h1>
- <h:inputText value="inputText"/>
+ <h:inputText id="inputText" value="inputText"/>
</f:view>
</body>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/inputTextArea.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/inputTextArea.jsp 2008-09-18 09:52:04 UTC (rev 10350)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/inputTextArea.jsp 2008-09-18 11:04:32 UTC (rev 10351)
@@ -9,7 +9,7 @@
<f:view>
<h1><h:outputText value="inputTextArea" /></h1>
- <h:inputTextarea value="inputTextArea"/>
+ <h:inputTextarea value="inputTextArea" id="inputTextArea" />
</f:view>
</body>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/message.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/message.jsp 2008-09-18 09:52:04 UTC (rev 10350)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/message.jsp 2008-09-18 11:04:32 UTC (rev 10351)
@@ -11,7 +11,7 @@
<h:inputText required="true" id="name"/>
- <h:message for="name" />
+ <h:message for="name" id="message" />
</f:view>
</body>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/messages.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/messages.jsp 2008-09-18 09:52:04 UTC (rev 10350)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/messages.jsp 2008-09-18 11:04:32 UTC (rev 10351)
@@ -9,7 +9,7 @@
<f:view>
<h1><h:outputText value="messages" /></h1>
- <h:messages style="color: red"/>
+ <h:messages style="color: red" id="messages" />
<h:inputText required="true" />
</f:view>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/graphicImage.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/graphicImage.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/graphicImage.xml 2008-09-18 11:04:32 UTC (rev 10351)
@@ -0,0 +1,8 @@
+<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <test id="graphicImage1">
+ <IMG SRC="unresolved.gif" />
+ </test>
+ <test id="graphicImage2">
+ <IMG />
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/inputSecret.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/inputSecret.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/inputSecret.xml 2008-09-18 11:04:32 UTC (rev 10351)
@@ -0,0 +1,5 @@
+<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <test id="inputSecret">
+ <input type="password"/>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/inputTextArea.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/inputTextArea.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/inputTextArea.xml 2008-09-18 11:04:32 UTC (rev 10351)
@@ -0,0 +1,5 @@
+<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <test id="inputTextArea">
+ <TEXTAREA> inputTextArea </TEXTAREA>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/message.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/message.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/message.xml 2008-09-18 11:04:32 UTC (rev 10351)
@@ -0,0 +1,5 @@
+<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <test id="message">
+ <span> Error Message </span>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/messages.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/messages.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/messages.xml 2008-09-18 11:04:32 UTC (rev 10351)
@@ -0,0 +1,5 @@
+<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <test id="messages">
+ <span> Error Messages </span>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java 2008-09-18 09:52:04 UTC (rev 10350)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java 2008-09-18 11:04:32 UTC (rev 10351)
@@ -55,21 +55,29 @@
}
public void testDataTable() throws Throwable {
- performContentTest("components/dataTable.jsp", "dataTable", "dataTable.xml");
+ performContentTest("components/dataTable.jsp", "dataTable",
+ "dataTable.xml");
}
public void testForm() throws Throwable {
performContentTest("components/form.jsp", "form", "form.xml");
}
- public void _testGraphicImage() throws Throwable {
- // -1$
+ public void testGraphicImage() throws Throwable {
+ Map<String, String> mapIds = new HashMap<String, String>();
+ mapIds.put("graphicImage1", "graphicImage1");
+ mapIds.put("graphicImage2", "graphicImage2");
+ performContentTest("components/graphicImage.jsp", //$NON-NLS-1$
+ "graphicImage.xml", mapIds); //$NON-NLS-1$
}
- public void _testInputHidden() throws Throwable {
+ public void testInputHidden() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testInputSecret() throws Throwable {
+ public void testInputSecret() throws Throwable {
+ performContentTest("components/inputSecret.jsp", "inputSecret",
+ "inputSecret.xml");
}
public void testInputText() throws Throwable {
@@ -79,116 +87,155 @@
}
- public void _testInputTextArea() throws Throwable {
+ public void testInputTextArea() throws Throwable {
+ performContentTest("components/inputTextArea.jsp", "inputTextArea", //$NON-NLS-1$ //$NON-NLS-2$
+ "inputTextArea.xml"); //$NON-NLS-1$
}
- public void _testMessage() throws Throwable {
+ public void testMessage() throws Throwable {
+ performContentTest("components/message.jsp", "message", //$NON-NLS-1$ //$NON-NLS-2$
+ "message.xml"); //$NON-NLS-1$
}
- public void _testMessages() throws Throwable {
+ public void testMessages() throws Throwable {
+ performContentTest("components/messages.jsp", "messages", //$NON-NLS-1$ //$NON-NLS-2$
+ "messages.xml"); //$NON-NLS-1$
}
- public void _testOutputFormat() throws Throwable {
+ public void testOutputFormat() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testOutputLabel() throws Throwable {
+ public void testOutputLabel() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testOutputLink() throws Throwable {
+ public void testOutputLink() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testOutputText() throws Throwable {
+ public void testOutputText() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testPanelGrid() throws Throwable {
+ public void testPanelGrid() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testPanelGroup() throws Throwable {
+ public void testPanelGroup() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testSelectBooleanCheckbox() throws Throwable {
+ public void testSelectBooleanCheckbox() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testSelectManyCheckbox() throws Throwable {
+ public void testSelectManyCheckbox() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testSelectManyListbox() throws Throwable {
+ public void testSelectManyListbox() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testSelectManyMenu() throws Throwable {
+ public void testSelectManyMenu() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testSelectOneListbox() throws Throwable {
+ public void testSelectOneListbox() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testSelectOneMenu() throws Throwable {
+ public void testSelectOneMenu() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
public void _testSelectOneRadio() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
/*
* JSF Core test cases
*/
- public void _testActionListener() throws Throwable {
+ public void testActionListener() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testAttribute() throws Throwable {
+ public void testAttribute() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testConvertDateTime() throws Throwable {
+ public void testConvertDateTime() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testConvertNumber() throws Throwable {
+ public void testConvertNumber() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testConverter() throws Throwable {
+ public void testConverter() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testFacet() throws Throwable {
+ public void testFacet() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testLoadBundle() throws Throwable {
+ public void testLoadBundle() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testParam() throws Throwable {
+ public void testParam() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testPhaseListener() throws Throwable {
+ public void testPhaseListener() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testSelectItem() throws Throwable {
+ public void testSelectItem() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testSelectItems() throws Throwable {
+ public void testSelectItems() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testSetPropertyActionListener() throws Throwable {
+ public void testSetPropertyActionListener() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testSubview() throws Throwable {
+ public void testSubview() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testValidateDoubleRange() throws Throwable {
+ public void testValidateDoubleRange() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testValidateLength() throws Throwable {
+ public void testValidateLength() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testValidateLongRange() throws Throwable {
+ public void testValidateLongRange() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testValidator() throws Throwable {
+ public void testValidator() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testValueChangeListener() throws Throwable {
+ public void testValueChangeListener() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testVerbatim() throws Throwable {
+ public void testVerbatim() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
- public void _testView() throws Throwable {
+ public void testView() throws Throwable {
+ assertTrue("it is necessery to add body of the test", false);
}
protected String getTestProjectName() {
15 years, 9 months
JBoss Tools SVN: r10350 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-09-18 05:52:04 -0400 (Thu, 18 Sep 2008)
New Revision: 10350
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2781
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-09-18 08:48:34 UTC (rev 10349)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-09-18 09:52:04 UTC (rev 10350)
@@ -96,6 +96,7 @@
suite.addTestSuite(JBIDE2526Test.class);
suite.addTestSuite(JBIDE2624.class);
suite.addTestSuite(JBIDE1805Test.class);
+ suite.addTestSuite(JsfComponentContentTest.class);
// $JUnit-END$
// added by Max Areshkau
// add here projects which should be imported for junit tests
15 years, 9 months
JBoss Tools SVN: r10349 - in trunk: jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-09-18 04:48:34 -0400 (Thu, 18 Sep 2008)
New Revision: 10349
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/commandButton.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/commandLink.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/dataTable.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/form.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/inputText.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2781
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/commandButton.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/commandButton.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/commandButton.xml 2008-09-18 08:48:34 UTC (rev 10349)
@@ -0,0 +1,17 @@
+<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <test id="commandButton1">
+ <input type="submit" />
+ </test>
+ <test id="commandButton2">
+ <input type="button" />
+ </test>
+ <test id="commandButton3">
+ <input type="reset" />
+ </test>
+ <test id="commandButton4">
+ <input type="submit" />
+ </test>
+ <test id="commandButton5">
+ <input type="image" />
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/commandLink.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/commandLink.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/commandLink.xml 2008-09-18 08:48:34 UTC (rev 10349)
@@ -0,0 +1,8 @@
+<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <test id="commandLink1">
+ <span>commandLink1</span>
+ </test>
+ <test id="commandLink2">
+ <a>commandLink2</a>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/dataTable.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/dataTable.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/dataTable.xml 2008-09-18 08:48:34 UTC (rev 10349)
@@ -0,0 +1,81 @@
+<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <test id="1">
+ <TABLE>
+ <TR>
+ <TD>
+ <DIV>
+ <TABLE>
+ <CAPTION>
+ <BR />
+ </CAPTION>
+ <THEAD>
+ <TR>
+ <TH>
+ <BR />
+ </TH>
+ </TR>
+ </THEAD>
+ <TFOOT>
+ <TR>
+ <TD>
+ <BR />
+ </TD>
+ </TR>
+ </TFOOT>
+ <TBODY>
+ <TR>
+ <TD>
+ <TABLE WIDTH="100%" BORDER="0">
+ <THEAD>
+ <TR>
+ <TH>
+ <DIV>
+ <SPAN> Last Name </SPAN>
+ </DIV>
+ </TH>
+ <TH>
+ <DIV>
+ <SPAN> First Name </SPAN>
+ </DIV>
+ </TH>
+ </TR>
+ </THEAD>
+ <TFOOT>
+ <TR>
+ <TD>
+ <DIV>
+ <SPAN> footer </SPAN>
+ </DIV>
+ </TD>
+ <TD>
+ <DIV>
+ <SPAN> footer </SPAN>
+ </DIV>
+ </TD>
+ </TR>
+ </TFOOT>
+ <TBODY>
+ <TR>
+ <TD>
+ <SPAN> Dupont </SPAN>
+ </TD>
+ <TD>
+ <SPAN> William </SPAN>
+ </TD>
+ </TR>
+ </TBODY>
+ <COLGROUP>
+ <COL />
+ <COL />
+ </COLGROUP>
+ </TABLE>
+ </TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </DIV>
+ </TD>
+ </TR>
+ </TABLE>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/form.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/form.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/form.xml 2008-09-18 08:48:34 UTC (rev 10349)
@@ -0,0 +1,14 @@
+<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <test id="form">
+ <TABLE
+ STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
+ <TR>
+ <TD>
+ <DIV>
+ </DIV>
+ <BR />
+ </TD>
+ </TR>
+ </TABLE>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/inputText.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/inputText.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/tests/inputText.xml 2008-09-18 08:48:34 UTC (rev 10349)
@@ -0,0 +1,5 @@
+<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <test id="inputText">
+ <input />
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java 2008-09-18 08:48:34 UTC (rev 10349)
@@ -0,0 +1,203 @@
+/*******************************************************************************
+ * 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;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.tools.vpe.ui.test.ComponentContentTest;
+
+/**
+ * Class for testing all jsf components
+ *
+ * @author sdzmitrovich
+ *
+ */
+public class JsfComponentContentTest extends ComponentContentTest {
+
+ // import project name
+ public static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
+
+ public static final String TESTS_ROOT_NAME = "tests"; //$NON-NLS-1$
+
+ public JsfComponentContentTest(String name) {
+ super(name);
+ setCheckWarning(false);
+ }
+
+ public void testCommandButton() throws Throwable {
+
+ Map<String, String> mapIds = new HashMap<String, String>();
+ mapIds.put("commandButton1", "commandButton1");
+ mapIds.put("commandButton2", "commandButton2");
+ mapIds.put("commandButton3", "commandButton3");
+ mapIds.put("commandButton4", "commandButton4");
+ mapIds.put("commandButton5", "commandButton5");
+ performContentTest("components/commandButton.jsp", //$NON-NLS-1$
+ "commandButton.xml", mapIds); //$NON-NLS-1$
+ }
+
+ public void testCommandLink() throws Throwable {
+ Map<String, String> mapIds = new HashMap<String, String>();
+ mapIds.put("commandLink1", "commandLink1");
+ mapIds.put("commandLink2", "commandLink2");
+ performContentTest("components/commandLink.jsp", //$NON-NLS-1$
+ "commandLink.xml", mapIds); //$NON-NLS-1$
+ }
+
+ public void testDataTable() throws Throwable {
+ performContentTest("components/dataTable.jsp", "dataTable", "dataTable.xml");
+ }
+
+ public void testForm() throws Throwable {
+ performContentTest("components/form.jsp", "form", "form.xml");
+ }
+
+ public void _testGraphicImage() throws Throwable {
+ // -1$
+ }
+
+ public void _testInputHidden() throws Throwable {
+ }
+
+ public void _testInputSecret() throws Throwable {
+ }
+
+ public void testInputText() throws Throwable {
+
+ performContentTest("components/inputText.jsp", "inputText", //$NON-NLS-1$ //$NON-NLS-2$
+ "inputText.xml"); //$NON-NLS-1$
+
+ }
+
+ public void _testInputTextArea() throws Throwable {
+ }
+
+ public void _testMessage() throws Throwable {
+ }
+
+ public void _testMessages() throws Throwable {
+ }
+
+ public void _testOutputFormat() throws Throwable {
+ }
+
+ public void _testOutputLabel() throws Throwable {
+ }
+
+ public void _testOutputLink() throws Throwable {
+ }
+
+ public void _testOutputText() throws Throwable {
+ }
+
+ public void _testPanelGrid() throws Throwable {
+ }
+
+ public void _testPanelGroup() throws Throwable {
+ }
+
+ public void _testSelectBooleanCheckbox() throws Throwable {
+ }
+
+ public void _testSelectManyCheckbox() throws Throwable {
+ }
+
+ public void _testSelectManyListbox() throws Throwable {
+ }
+
+ public void _testSelectManyMenu() throws Throwable {
+ }
+
+ public void _testSelectOneListbox() throws Throwable {
+ }
+
+ public void _testSelectOneMenu() throws Throwable {
+ }
+
+ public void _testSelectOneRadio() throws Throwable {
+ }
+
+ /*
+ * JSF Core test cases
+ */
+
+ public void _testActionListener() throws Throwable {
+ }
+
+ public void _testAttribute() throws Throwable {
+ }
+
+ public void _testConvertDateTime() throws Throwable {
+ }
+
+ public void _testConvertNumber() throws Throwable {
+ }
+
+ public void _testConverter() throws Throwable {
+ }
+
+ public void _testFacet() throws Throwable {
+ }
+
+ public void _testLoadBundle() throws Throwable {
+ }
+
+ public void _testParam() throws Throwable {
+ }
+
+ public void _testPhaseListener() throws Throwable {
+ }
+
+ public void _testSelectItem() throws Throwable {
+ }
+
+ public void _testSelectItems() throws Throwable {
+ }
+
+ public void _testSetPropertyActionListener() throws Throwable {
+ }
+
+ public void _testSubview() throws Throwable {
+ }
+
+ public void _testValidateDoubleRange() throws Throwable {
+ }
+
+ public void _testValidateLength() throws Throwable {
+ }
+
+ public void _testValidateLongRange() throws Throwable {
+ }
+
+ public void _testValidator() throws Throwable {
+ }
+
+ public void _testValueChangeListener() throws Throwable {
+ }
+
+ public void _testVerbatim() throws Throwable {
+ }
+
+ public void _testView() throws Throwable {
+ }
+
+ protected String getTestProjectName() {
+ return IMPORT_PROJECT_NAME;
+ }
+
+ @Override
+ protected String getTestsRoot() {
+ return JsfTestPlugin.getPluginResourcePath() + File.separator
+ + TESTS_ROOT_NAME;
+ }
+}
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java 2008-09-18 08:48:34 UTC (rev 10349)
@@ -0,0 +1,315 @@
+/*******************************************************************************
+ * 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.vpe.ui.test;
+
+import java.io.File;
+import java.util.Map;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+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.mapping.VpeElementMapping;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * @author Sergey Dzmitrovich
+ *
+ */
+public abstract class ComponentContentTest extends VpeTest {
+
+ public ComponentContentTest(String name) {
+ super(name);
+ }
+
+ /**
+ *
+ * @param elementPagePath
+ * - path to test page
+ * @param elementId
+ * - id of element which will be tested
+ * @param XmlSchemeContent
+ * - probable content of test element
+ *
+ * @throws Throwable
+ */
+ protected void performContentTestByContent(String elementPagePath,
+ String elementId, String xmlTestContent) throws Throwable {
+ setException(null);
+
+ IFile elementPageFile = (IFile) TestUtil.getComponentPath(
+ elementPagePath, getTestProjectName());
+
+ IEditorInput input = new FileEditorInput(elementPageFile);
+
+ TestUtil.waitForJobs();
+
+ IEditorPart editor = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().openEditor(input,
+ EDITOR_ID, true);
+
+ assertNotNull(editor);
+
+ TestUtil.waitForJobs();
+
+ // get element by id
+ nsIDOMElement vpeElement = findElementById(
+ getVpeController((JSPMultiPageEditor) editor), elementId);
+ assertNotNull(vpeElement);
+
+ // get document
+ Document modelDocument = TestDomUtil.getDocument(xmlTestContent);
+ assertNotNull(modelDocument);
+
+ // get element
+ Element modelElement = modelDocument.getDocumentElement();
+ assertNotNull(modelElement);
+
+ assertEquals(true, TestDomUtil.compareNodes(vpeElement, modelElement));
+
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+
+ /**
+ * use if xml file contain only one test
+ *
+ * @param elementPagePath
+ * - path to test page
+ * @param elementId
+ * - id of element which will be tested
+ * @param xmlTestPath
+ * - path to xml file which contains tests of content
+ * @param xmlTestId
+ * - current id of test in xml file
+ * @throws Throwable
+ */
+ protected void performContentTest(String elementPagePath, String elementId,
+ String xmlTestPath) throws Throwable {
+ setException(null);
+
+ IFile elementPageFile = (IFile) TestUtil.getComponentPath(
+ elementPagePath, getTestProjectName());
+
+ IEditorInput input = new FileEditorInput(elementPageFile);
+
+ TestUtil.waitForJobs();
+
+ IEditorPart editor = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().openEditor(input,
+ EDITOR_ID, true);
+
+ assertNotNull(editor);
+
+ TestUtil.waitForJobs();
+
+ // get xml test file
+ File xmlTestFile = TestUtil.getXmlTestFile(xmlTestPath, getTestsRoot());
+
+ // get document
+ Document xmlTestDocument = TestDomUtil.getDocument(xmlTestFile);
+ assertNotNull(xmlTestDocument);
+
+ // compare DOMs
+ assertEquals(true, compareElements(
+ getVpeController((JSPMultiPageEditor) editor), xmlTestDocument,
+ elementId));
+
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+
+ /**
+ *
+ * use if xml file contain several tests
+ *
+ * @param elementPagePath
+ * - path to test page
+ * @param elementId
+ * - id of element which will be tested
+ * @param xmlTestPath
+ * - path to xml file which contains tests of content
+ * @param xmlTestId
+ * - current id of test in xml file
+ * @throws Throwable
+ */
+ protected void performContentTest(String elementPagePath, String elementId,
+ String xmlTestPath, String xmlTestId) throws Throwable {
+ setException(null);
+
+ IFile elementPageFile = (IFile) TestUtil.getComponentPath(
+ elementPagePath, getTestProjectName());
+
+ IEditorInput input = new FileEditorInput(elementPageFile);
+
+ TestUtil.waitForJobs();
+
+ IEditorPart editor = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().openEditor(input,
+ EDITOR_ID, true);
+
+ assertNotNull(editor);
+
+ TestUtil.waitForJobs();
+
+ VpeController controller = getVpeController((JSPMultiPageEditor) editor);
+
+ // get xml test file
+ File xmlTestFile = TestUtil.getXmlTestFile(xmlTestPath, getTestsRoot());
+
+ // get document
+ Document xmlTestDocument = TestDomUtil.getDocument(xmlTestFile);
+ assertNotNull(xmlTestDocument);
+
+ assertEquals(true, compareElements(controller, xmlTestDocument,
+ elementId, xmlTestId));
+
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+
+ /**
+ * use if it is necessary to check several elements at the same time
+ *
+ * @param elementPagePath
+ * - path to test page
+ * @param xmlTestPath
+ * - path to xml file which contains tests of content
+ * @param mapId
+ * - key is id of element which will be tested, value is
+ * corresponding id of test in xml file
+ * @throws Throwable
+ */
+ protected void performContentTest(String elementPagePath,
+ String xmlTestPath, Map<String, String> mapId) throws Throwable {
+ setException(null);
+
+ IFile elementPageFile = (IFile) TestUtil.getComponentPath(
+ elementPagePath, getTestProjectName());
+
+ IEditorInput input = new FileEditorInput(elementPageFile);
+
+ TestUtil.waitForJobs();
+
+ IEditorPart editor = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().openEditor(input,
+ EDITOR_ID, true);
+
+ assertNotNull(editor);
+
+ TestUtil.waitForJobs();
+
+ VpeController controller = getVpeController((JSPMultiPageEditor) editor);
+
+ // get xml test file
+ File xmlTestFile = TestUtil.getXmlTestFile(xmlTestPath, getTestsRoot());
+
+ // get document
+ Document xmlTestDocument = TestDomUtil.getDocument(xmlTestFile);
+ assertNotNull(xmlTestDocument);
+
+ for (String elementId : mapId.keySet()) {
+
+ assertEquals(true, compareElements(controller, xmlTestDocument,
+ elementId, mapId.get(elementId)));
+ }
+
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+
+ protected boolean compareElements(VpeController controller,
+ Document xmlTestDocument, String elementId, String xmlTestId) {
+
+ // get element by id
+ nsIDOMElement vpeElement = findElementById(controller, elementId);
+ assertNotNull(vpeElement);
+
+ // get test element by id - get <test id="..." > element and get his
+ // first child
+ Element xmlModelElement = TestDomUtil.getFirstChildElement(TestDomUtil
+ .getElemenById(xmlTestDocument, xmlTestId));
+
+ assertNotNull(xmlModelElement);
+
+ // compare DOMs
+ return TestDomUtil.compareNodes(vpeElement, xmlModelElement);
+
+ }
+
+ protected boolean compareElements(VpeController controller,
+ Document xmlTestDocument, String elementId) {
+
+ // get element by id
+ nsIDOMElement vpeElement = findElementById(controller, elementId);
+ assertNotNull(vpeElement);
+
+ // get test element, get the first <test> tag in file
+ Element xmlTestElement = TestDomUtil
+ .getFirstChildElement(xmlTestDocument.getDocumentElement());
+ assertNotNull(xmlTestElement);
+
+ // model element is the first child of <test> tag
+ Element xmlModelElement = TestDomUtil
+ .getFirstChildElement(xmlTestElement);
+
+ assertNotNull(xmlModelElement);
+
+ // compare DOMs
+ return TestDomUtil.compareNodes(vpeElement, xmlModelElement);
+
+ }
+
+ /**
+ * find visual element by "id" entered in source part of vpe
+ *
+ * @param controller
+ * @param elementId
+ * @return
+ */
+ protected nsIDOMElement findElementById(VpeController controller,
+ String elementId) {
+
+ Element sourceElement = getSourceDocument(controller).getElementById(
+ elementId);
+
+ VpeElementMapping elementMapping = controller.getDomMapping()
+ .getNearElementMapping(sourceElement);
+
+ return elementMapping.getVisualElement();
+ }
+
+ /**
+ *
+ * @return
+ */
+ abstract protected String getTestProjectName();
+
+ /**
+ *
+ * @return
+ */
+ abstract protected String getTestsRoot();
+
+}
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java 2008-09-18 08:48:34 UTC (rev 10349)
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * 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.vpe.ui.test;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.StringReader;
+
+import org.jboss.tools.common.model.util.XMLUtil;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * @author Sergey Dzmitrovich
+ *
+ */
+public class TestDomUtil {
+
+ public static String ID_ATTRIBUTE = "id";
+
+ public static Document getDocument(File file) throws FileNotFoundException {
+ // create reader
+ FileReader reader = new FileReader(file);
+
+ // return document
+ return XMLUtil.getDocument(reader);
+ }
+
+ public static Document getDocument(String content)
+ throws FileNotFoundException {
+ // create reader
+ StringReader reader = new StringReader(content);
+
+ // return document
+ return XMLUtil.getDocument(reader);
+ }
+
+ /**
+ *
+ * @param document
+ * @param elementId
+ * @return
+ */
+ public static Element getElemenById(Document document, String elementId) {
+
+ Element element = document.getDocumentElement();
+
+ NodeList children = element.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ if ((child.getNodeType() == Node.ELEMENT_NODE)
+ && elementId.equals(((Element) child)
+ .getAttribute(ID_ATTRIBUTE)))
+ return (Element) child;
+
+ }
+
+ return null;
+
+ }
+
+ /**
+ *
+ * @param element
+ * @return
+ */
+ public static Element getFirstChildElement(Element element) {
+
+ if (element != null) {
+ NodeList children = element.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+
+ if (child.getNodeType() == Node.ELEMENT_NODE)
+ return (Element) child;
+
+ }
+ }
+ return null;
+
+ }
+
+ /**
+ *
+ * @param vpeNode
+ * @param schemeNode
+ * @return
+ */
+ public static boolean compareNodes(nsIDOMNode vpeNode, Node schemeNode) {
+
+ // compare node's features
+ if ((schemeNode.getNodeType() != vpeNode.getNodeType())
+ || (!schemeNode.getNodeName().equalsIgnoreCase(
+ vpeNode.getNodeName()))
+ || ((schemeNode.getNodeValue() != null) && (!schemeNode
+ .getNodeValue().trim()
+ .equalsIgnoreCase(vpeNode.getNodeValue().trim()))))
+ return false;
+
+ // compare node's attributes
+ if (schemeNode.getNodeType() == Node.ELEMENT_NODE) {
+
+ NamedNodeMap attributes = schemeNode.getAttributes();
+ nsIDOMElement vpeElement = (nsIDOMElement) vpeNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ if (attributes != null) {
+ for (int i = 0; i < attributes.getLength(); i++) {
+ Attr attr = (Attr) attributes.item(i);
+ if ((!vpeElement.hasAttribute(attr.getName()))
+ || (!attr.getNodeValue().equals(
+ vpeElement.getAttributeNode(attr.getName())
+ .getNodeValue())))
+ return false;
+ }
+ }
+ }
+
+ // compare children
+ nsIDOMNodeList vpeChildren = vpeNode.getChildNodes();
+ NodeList schemeChildren = schemeNode.getChildNodes();
+ int realCount = 0;
+ for (int i = 0; i < schemeChildren.getLength(); i++) {
+
+ Node schemeChild = schemeChildren.item(i);
+
+ // leave out empty text nodes in test dom model
+ if ((schemeChild.getNodeType() == Node.TEXT_NODE)
+ && ((schemeChild.getNodeValue() == null) || (schemeChild
+ .getNodeValue().trim().length() == 0)))
+ continue;
+
+ nsIDOMNode vpeChild = vpeChildren.item(realCount++);
+
+ // leave out empty text nodes in vpe dom model
+ while (((vpeChild.getNodeType() == Node.TEXT_NODE) && ((vpeChild
+ .getNodeValue() == null) || (vpeChild.getNodeValue().trim()
+ .length() == 0)))) {
+ vpeChild = vpeChildren.item(realCount++);
+
+ }
+
+ if (!compareNodes(vpeChild, schemeChild))
+ return false;
+
+ }
+
+ return true;
+
+ }
+}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java 2008-09-18 07:50:01 UTC (rev 10348)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java 2008-09-18 08:48:34 UTC (rev 10349)
@@ -154,6 +154,16 @@
return null;
}
+
+
+ /**
+ * @param xmlScheme
+ * @param xmlSchemesRoot
+ * @return
+ */
+ public static File getXmlTestFile(String xmlTestPath, String xmlTestsRoot) {
+ return new File(xmlTestsRoot + File.separator + xmlTestPath);
+ }
/**
* Removes the project.
15 years, 9 months