Author: sdzmitrovich
Date: 2009-10-01 13:32:40 -0400 (Thu, 01 Oct 2009)
New Revision: 17854
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/include.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/openOnTest.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/OpenOnInsideJspRoot_JBIDE4852.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
trunk/jst/plugins/org.jboss.tools.jst.text.ext/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4852
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/include.jsp
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/include.jsp
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/include.jsp 2009-10-01
17:32:40 UTC (rev 17854)
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
+<title>Insert title here</title>
+</head>
+<body>
+
+</body>
+</html>
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/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/jsfTest/WebContent/pages/JBIDE/4852/openOnTest.jsp
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/openOnTest.jsp
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/openOnTest.jsp 2009-10-01
17:32:40 UTC (rev 17854)
@@ -0,0 +1,14 @@
+<?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>
+ <title></title>
+ </head>
+ <body>
+ <jsp:include page="include.jsp"
id="openOn"></jsp:include>
+ </body>
+ </html>
+</jsp:root>
\ No newline at end of file
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/4852/openOnTest.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
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 2009-10-01
16:05:29 UTC (rev 17853)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2009-10-01
17:32:40 UTC (rev 17854)
@@ -76,6 +76,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide2170Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide2362Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.OpenOnCssClassTest_JBIDE4775;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.OpenOnInsideJspRoot_JBIDE4852;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.SelectAllAndCut_JBIDE4853;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.SelectWholeElement_JBIDE4713;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.VPERefreshTest;
@@ -167,6 +168,7 @@
suite.addTestSuite(JBIDE2550Test.class);
suite.addTestSuite(OpenOnCssClassTest_JBIDE4775.class);
suite.addTestSuite(VPERefreshTest.class);
+ suite.addTestSuite(OpenOnInsideJspRoot_JBIDE4852.class);
// $JUnit-END$
// added by Max Areshkau
// add here projects which should be imported for junit tests
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/OpenOnInsideJspRoot_JBIDE4852.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/OpenOnInsideJspRoot_JBIDE4852.java
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/OpenOnInsideJspRoot_JBIDE4852.java 2009-10-01
17:32:40 UTC (rev 17854)
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+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.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.ui.test.OpenOnUtil;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * @author Sergey Dzmitrovich
+ *
+ */
+public class OpenOnInsideJspRoot_JBIDE4852 extends VpeTest {
+
+ private static final String TEST_PAGE_NAME = "JBIDE/4852/openOnTest.jsp";
//$NON-NLS-1$
+
+ private static String INCLUDE_TAG_ID = "openOn"; //$NON-NLS-1$
+
+ private static String PAGE_ATTRIBUTE = "page"; //$NON-NLS-1$
+
+ private static String PAGE_ATTRIBUTE_VALUE = "include.jsp"; //$NON-NLS-1$
+
+ public OpenOnInsideJspRoot_JBIDE4852(String name) {
+ super(name);
+ }
+
+ public void testOpenOnLinkStyles() throws Throwable {
+
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,
+ JsfAllTests.IMPORT_PROJECT_NAME);
+
+ assertNotNull("Could not open specified file. componentPage = "
+ + TEST_PAGE_NAME
+ + ";projectName = " + JsfAllTests.IMPORT_PROJECT_NAME, file);//$NON-NLS-1$
+
+ IEditorInput input = new FileEditorInput(file);
+
+ assertNotNull("Editor input is null", input);
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ // get controller
+ VpeController controller = TestUtil.getVpeController(part);
+ assertNotNull(controller);
+
+ // get source document
+ Document sourceDocument = getSourceDocument(controller);
+ assertNotNull(sourceDocument);
+
+ Element openOnTestedElement = sourceDocument
+ .getElementById(INCLUDE_TAG_ID);
+ Attr testedClassAttr = openOnTestedElement
+ .getAttributeNode(PAGE_ATTRIBUTE);
+
+ OpenOnUtil.performOpenOnAction(part.getSourceEditor(),
+ ((IDOMAttr) testedClassAttr).getValueRegionStartOffset() + 1);
+
+ IEditorPart editorPart = (IEditorPart) PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().getActivePart();
+
+ TestUtil.waitForJobs();
+
+ assertNotNull(editorPart);
+
+ assertTrue(editorPart.getEditorInput().getName().endsWith(
+ PAGE_ATTRIBUTE_VALUE));
+
+ // check exception
+ if (getException() != null) {
+ throw getException();
+ }
+
+ }
+
+}
Property changes on:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/OpenOnInsideJspRoot_JBIDE4852.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: trunk/jst/plugins/org.jboss.tools.jst.text.ext/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.text.ext/plugin.xml 2009-10-01 16:05:29 UTC (rev
17853)
+++ trunk/jst/plugins/org.jboss.tools.jst.text.ext/plugin.xml 2009-10-01 17:32:40 UTC (rev
17854)
@@ -206,11 +206,17 @@
<partitionType
id="org.jboss.tools.common.text.ext.xml.XML_ATTRIBUTE_VALUE">
<axis path="*/a/href/" ignoreCase="true"/>
<axis path="*/jsp:directive.include/file/" />
+ <axis
path="*/[http://java.sun.com/JSP/Page]:directive.include/file/" />
<axis path="*/jsp:directive.page/errorPage/" />
+ <axis
path="*/[http://java.sun.com/JSP/Page]:directive.page/errorPage/" />
<axis path="*/jsp:include/page/" />
+ <axis
path="*/[http://java.sun.com/JSP/Page]:include/page/"
/>
<axis path="*/jsp:forward/page/" />
+ <axis
path="*/[http://java.sun.com/JSP/Page]:forward/page/"
/>
<axis path="*/jsp:plugin/iepluginurl/" />
+ <axis
path="*/[http://java.sun.com/JSP/Page]:plugin/iepluginurl/" />
<axis path="*/jsp:plugin/nspluginurl/" />
+ <axis
path="*/[http://java.sun.com/JSP/Page]:plugin/nspluginurl/" />
</partitionType>
</contentType>
<contentType id="org.eclipse.wst.html.core.htmlsource">