Author: dmaliarevich
Date: 2009-05-27 05:02:30 -0400 (Wed, 27 May 2009)
New Revision: 15549
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/a4j-include.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/c-import.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/import.html
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/jsp-directive-include-relative.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/jsp-include-relative.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/jsp-include.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/s-decorate.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/ui-decorate.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/ui-define.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/ui-include-relative.xhtml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4373Test.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4373, JUnits for openOn mechanism were added.
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/a4j-include.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/a4j-include.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/c-import.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/c-import.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/import.html
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/import.html
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/import.html 2009-05-27
09:02:30 UTC (rev 15549)
@@ -0,0 +1,9 @@
+<html>
+<body>
+<ol>
+<li> first </li>
+<li> second </li>
+<li> third </li>
+</ol>
+</body>
+</html>
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/import.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:eol-style
+ native
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/jsp-directive-include-relative.jsp
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/jsp-directive-include-relative.jsp
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/jsp-directive-include-relative.jsp 2009-05-27
09:02:30 UTC (rev 15549)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
version="2.0">
+ <jsp:directive.page contentType="application/xhtml+xml;
charset=UTF-8" />
+ <![CDATA[<?xml version="1.0"
encoding="UTF-8"?>]]>
+ <![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">]]>
+ <html
xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
+ <title>jsp:directive.include test with relative path</title>
+ </head>
+ <body>
+ <h1>jsp:directive.include test with relative path</h1>
+ <jsp:directive.include file="./jsp-include.jsp"/>
+ </body>
+ </html>
+</jsp:root>
+
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/jsp-directive-include-relative.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/jsp-include-relative.jsp
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/jsp-include-relative.jsp
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/jsp-include-relative.jsp 2009-05-27
09:02:30 UTC (rev 15549)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
version="2.0">
+ <jsp:directive.page contentType="application/xhtml+xml;
charset=UTF-8" />
+ <![CDATA[<?xml version="1.0"
encoding="UTF-8"?>]]>
+ <![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">]]>
+ <html
xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
+ <title>jsp:include test with relative path</title>
+ </head>
+ <body>
+ <h1>jsp:include test with relative path</h1>
+ <jsp:include page="./jsp-include.jsp"/>
+ </body>
+ </html>
+</jsp:root>
+
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/jsp-include-relative.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/jsp-include.jsp
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/jsp-include.jsp
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/jsp-include.jsp 2009-05-27
09:02:30 UTC (rev 15549)
@@ -0,0 +1,6 @@
+<div>
+jsp-include
+<jsp:expression>
+ new java.util.Date()
+</jsp:expression>
+</div>
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/jsp-include.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/s-decorate.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/s-decorate.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/ui-decorate.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/ui-decorate.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/ui-define.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/ui-define.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/ui-include-relative.xhtml
===================================================================
(Binary files differ)
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/customFaceletsTestProject/WebContent/pages/ui-include-relative.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4373Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4373Test.java 2009-05-27
08:13:55 UTC (rev 15548)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE4373Test.java 2009-05-27
09:02:30 UTC (rev 15549)
@@ -79,6 +79,8 @@
}
/**
+ * Test openOn mechanism for VpeDefineContainerTemplate
+ * in facelets' ui:composition template (VpeCompositionTemplate).
*
* @throws CoreException
*/
@@ -91,4 +93,129 @@
IEditorPart activeEditor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
assertEquals("facelets.taglib.xml file should be
opened","common.xhtml", activeEditor.getEditorInput().getName());
//$NON-NLS-1$ //$NON-NLS-2$
}
+
+ /**
+ * Test openOn mechanism for VpeDefineContainerTemplate
+ * in facelets' ui:decorate template (VpeDecorateTemplate).
+ *
+ * @throws CoreException
+ */
+ public void testOpenOnForUiDecorate() throws CoreException {
+ VpeController vpeController = openInVpe(JsfAllTests.IMPORT_CUSTOM_FACELETS_PROJECT,
"ui-decorate.xhtml"); //$NON-NLS-1$
+ int position =
TestUtil.getLinePositionOffcet(vpeController.getSourceEditor().getTextViewer(), 11, 33);
+ Node sourceNode =
SelectionUtil.getNodeBySourcePosition(vpeController.getSourceEditor(), position);
+ nsIDOMNode domNode = vpeController.getDomMapping().getNearVisualNode(sourceNode);
+ vpeController.getSourceBuilder().openOn(domNode);
+ IEditorPart activeEditor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ assertEquals("/templates/insert.xhtml file should be
opened","insert.xhtml", activeEditor.getEditorInput().getName());
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Test openOn mechanism for VpeDefineContainerTemplate
+ * in facelets' ui:define template (VpeDefineTemplate).
+ *
+ * @throws CoreException
+ */
+ public void testOpenOnForUiDefine() throws CoreException {
+ VpeController vpeController = openInVpe(JsfAllTests.IMPORT_CUSTOM_FACELETS_PROJECT,
"ui-define.xhtml"); //$NON-NLS-1$
+ int position =
TestUtil.getLinePositionOffcet(vpeController.getSourceEditor().getTextViewer(), 6, 40);
+ Node sourceNode =
SelectionUtil.getNodeBySourcePosition(vpeController.getSourceEditor(), position);
+ nsIDOMNode domNode = vpeController.getDomMapping().getNearVisualNode(sourceNode);
+ vpeController.getSourceBuilder().openOn(domNode);
+ IEditorPart activeEditor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ assertEquals("/templates/insert.xhtml file should be
opened","insert.xhtml", activeEditor.getEditorInput().getName());
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Test openOn mechanism for VpeDefineContainerTemplate
+ * in JSTL's c:import template (JstlImportTemplate).
+ *
+ * @throws CoreException
+ */
+ public void _testOpenOnForCImport() throws CoreException {
+ VpeController vpeController = openInVpe(JsfAllTests.IMPORT_CUSTOM_FACELETS_PROJECT,
"c-import.xhtml"); //$NON-NLS-1$
+ int position =
TestUtil.getLinePositionOffcet(vpeController.getSourceEditor().getTextViewer(), 12, 25);
+ Node sourceNode =
SelectionUtil.getNodeBySourcePosition(vpeController.getSourceEditor(), position);
+ nsIDOMNode domNode = vpeController.getDomMapping().getNearVisualNode(sourceNode);
+ vpeController.getSourceBuilder().openOn(domNode);
+ IEditorPart activeEditor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ assertEquals("import.html file should be opened","import.html",
activeEditor.getEditorInput().getName()); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Test openOn mechanism for VpeDefineContainerTemplate
+ * in Seam's s:decorate template (SeamDecorateTemplate).
+ *
+ * @throws CoreException
+ */
+ public void testOpenOnForSDecorate() throws CoreException {
+ VpeController vpeController = openInVpe(JsfAllTests.IMPORT_CUSTOM_FACELETS_PROJECT,
"s-decorate.xhtml"); //$NON-NLS-1$
+ int position =
TestUtil.getLinePositionOffcet(vpeController.getSourceEditor().getTextViewer(), 11, 33);
+ Node sourceNode =
SelectionUtil.getNodeBySourcePosition(vpeController.getSourceEditor(), position);
+ nsIDOMNode domNode = vpeController.getDomMapping().getNearVisualNode(sourceNode);
+ vpeController.getSourceBuilder().openOn(domNode);
+ IEditorPart activeEditor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ assertEquals("/templates/insert.xhtml file should be
opened","insert.xhtml", activeEditor.getEditorInput().getName());
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Test openOn mechanism for VpeIncludeTemplate in ajax4jsf a4j:include.
+ *
+ * @throws CoreException
+ */
+ public void testOpenOnForA4JInclude() throws CoreException {
+ VpeController vpeController = openInVpe(JsfAllTests.IMPORT_CUSTOM_FACELETS_PROJECT,
"a4j-include.xhtml"); //$NON-NLS-1$
+ int position =
TestUtil.getLinePositionOffcet(vpeController.getSourceEditor().getTextViewer(), 15, 55);
+ Node sourceNode =
SelectionUtil.getNodeBySourcePosition(vpeController.getSourceEditor(), position);
+ nsIDOMNode domNode = vpeController.getDomMapping().getNearVisualNode(sourceNode);
+ vpeController.getSourceBuilder().openOn(domNode);
+ IEditorPart activeEditor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ assertEquals("/pages/import.html file should be
opened","import.html", activeEditor.getEditorInput().getName());
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Test openOn mechanism for VpeIncludeTemplate in facelets' ui:include.
+ *
+ * @throws CoreException
+ */
+ public void testOpenOnForUiInclude() throws CoreException {
+ VpeController vpeController = openInVpe(JsfAllTests.IMPORT_CUSTOM_FACELETS_PROJECT,
"ui-include-relative.xhtml"); //$NON-NLS-1$
+ int position =
TestUtil.getLinePositionOffcet(vpeController.getSourceEditor().getTextViewer(), 13, 27);
+ Node sourceNode =
SelectionUtil.getNodeBySourcePosition(vpeController.getSourceEditor(), position);
+ nsIDOMNode domNode = vpeController.getDomMapping().getNearVisualNode(sourceNode);
+ vpeController.getSourceBuilder().openOn(domNode);
+ IEditorPart activeEditor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ assertEquals("/pages/import.html file should be
opened","import.html", activeEditor.getEditorInput().getName());
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Test openOn mechanism for VpeIncludeTemplate in jsp's jsp:directive.include.
+ *
+ * @throws CoreException
+ */
+ public void _testOpenOnForJspDirectiveInclude() throws CoreException {
+ VpeController vpeController = openInVpe(JsfAllTests.IMPORT_CUSTOM_FACELETS_PROJECT,
"jsp-directive-include-relative.jsp"); //$NON-NLS-1$
+ int position =
TestUtil.getLinePositionOffcet(vpeController.getSourceEditor().getTextViewer(), 13, 46);
+ Node sourceNode =
SelectionUtil.getNodeBySourcePosition(vpeController.getSourceEditor(), position);
+ nsIDOMNode domNode = vpeController.getDomMapping().getNearVisualNode(sourceNode);
+ vpeController.getSourceBuilder().openOn(domNode);
+ IEditorPart activeEditor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ assertEquals("jsp-include.jsp file should be
opened","jsp-include.jsp", activeEditor.getEditorInput().getName());
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Test openOn mechanism for VpeIncludeTemplate in jsp's jsp:include.
+ *
+ * @throws CoreException
+ */
+ public void _testOpenOnForJspInclude() throws CoreException {
+ VpeController vpeController = openInVpe(JsfAllTests.IMPORT_CUSTOM_FACELETS_PROJECT,
"jsp-include-relative.jsp"); //$NON-NLS-1$
+ int position =
TestUtil.getLinePositionOffcet(vpeController.getSourceEditor().getTextViewer(), 13, 36);
+ Node sourceNode =
SelectionUtil.getNodeBySourcePosition(vpeController.getSourceEditor(), position);
+ nsIDOMNode domNode = vpeController.getDomMapping().getNearVisualNode(sourceNode);
+ vpeController.getSourceBuilder().openOn(domNode);
+ IEditorPart activeEditor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ assertEquals("jsp-include.jsp file should be
opened","jsp-include.jsp", activeEditor.getEditorInput().getName());
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
}