diff options
author | Nitin Dahyabhai | 2013-01-24 21:50:39 +0000 |
---|---|---|
committer | Nitin Dahyabhai | 2013-01-24 21:50:39 +0000 |
commit | 6845de30a516829a8a04cf4761d08d7ae392502d (patch) | |
tree | 631a619f8154714f25397fd5e3d4d5b3245c0fac | |
parent | 63eacde32ae0f8622a5b7b332ab7558d9b57699d (diff) | |
download | webtools.sourceediting.tests-6845de30a516829a8a04cf4761d08d7ae392502d.tar.gz webtools.sourceediting.tests-6845de30a516829a8a04cf4761d08d7ae392502d.tar.xz webtools.sourceediting.tests-6845de30a516829a8a04cf4761d08d7ae392502d.zip |
[399017] Errors while attempting to work with JSP model when JSF/JSTL facets are installedv201301242151
7 files changed, 90 insertions, 14 deletions
diff --git a/tests/org.eclipse.jst.jsp.core.tests/src/org/eclipse/jst/jsp/core/tests/util/FMCSTests.java b/tests/org.eclipse.jst.jsp.core.tests/src/org/eclipse/jst/jsp/core/tests/util/FMCSTests.java index d0dbb0d05..fabfb9faa 100644 --- a/tests/org.eclipse.jst.jsp.core.tests/src/org/eclipse/jst/jsp/core/tests/util/FMCSTests.java +++ b/tests/org.eclipse.jst.jsp.core.tests/src/org/eclipse/jst/jsp/core/tests/util/FMCSTests.java @@ -12,7 +12,6 @@ package org.eclipse.jst.jsp.core.tests.util; import java.io.IOException; -import junit.framework.Test; import junit.framework.TestCase; import org.eclipse.core.resources.IProject; @@ -24,19 +23,6 @@ import org.eclipse.jst.jsp.core.internal.util.FacetModuleCoreSupport; import org.eclipse.jst.jsp.core.tests.taglibindex.BundleResourceUtil; public class FMCSTests extends TestCase { - - public FMCSTests(String name) { - super(name); - } - - public FMCSTests() { - super(); - } - - public static Test suite() { - return new FMCSTests(); - } - private IProject createProject(String name) throws CoreException { IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name); if (!project.exists()) @@ -57,4 +43,22 @@ public class FMCSTests extends TestCase { assertEquals("/BugDemo2/src/META-INF/resources/referenced.jsp", "" + FacetModuleCoreSupport.resolve(new Path("BugDemo1/WebContent/index.jsp"), "referenced.jsp")); } + public void testFacetModuleAbstractionWithoutWebFragment() throws Exception { + IProject bd1 = createProject("BugDemo1"); + IProject bd2 = createProject("BugDemo2"); + BundleResourceUtil.copyBundleZippedEntriesIntoWorkspace("/testfiles/jsp_include_false_error.zip", Path.ROOT); + + bd1.refreshLocal(IResource.DEPTH_INFINITE, null); + bd2.refreshLocal(IResource.DEPTH_INFINITE, null); + + assertEquals("/BugDemo2/WEB-INF/web.xml", "" + FacetModuleCoreSupport.resolve(new Path("/BugDemo2/src/META-INF/resources/referenced.jsp"), "/WEB-INF/web.xml")); + } + public void testFacetModuleAbstractionInDynamicWebProject() throws Exception { + IProject bd1 = createProject("bug_399017"); + BundleResourceUtil.copyBundleEntriesIntoWorkspace("/testfiles/bug_399017", bd1.getFullPath().toString()); + + bd1.refreshLocal(IResource.DEPTH_INFINITE, null); + + assertEquals("/bug_399017/WebContent/header.jspf", "" + FacetModuleCoreSupport.resolve(new Path("/bug_399017/WebContent/main.jsp"), "header.jspf")); + } } diff --git a/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/.classpath b/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/.classpath new file mode 100644 index 000000000..4600e2b0b --- /dev/null +++ b/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/.classpath @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="lib" path="WebContent/WEB-INF/lib/struts.jar"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.5.0_08"/> +</classpath> diff --git a/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/.project b/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/.project new file mode 100644 index 000000000..fd713f61a --- /dev/null +++ b/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/.project @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>bug_399017</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.common.project.facet.core.builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.validation.validationbuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.wst.common.project.facet.core.nature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> + <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> + </natures> +</projectDescription> diff --git a/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/WebContent/WEB-INF/lib/.keepme b/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/WebContent/WEB-INF/lib/.keepme new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/WebContent/WEB-INF/lib/.keepme diff --git a/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/WebContent/WEB-INF/web.xml b/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/WebContent/WEB-INF/web.xml new file mode 100644 index 000000000..34906a0e5 --- /dev/null +++ b/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/WebContent/WEB-INF/web.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> + <display-name> + TagTest</display-name> + <welcome-file-list> + <welcome-file>index.html</welcome-file> + <welcome-file>index.htm</welcome-file> + <welcome-file>index.jsp</welcome-file> + <welcome-file>default.html</welcome-file> + <welcome-file>default.htm</welcome-file> + <welcome-file>default.jsp</welcome-file> + </welcome-file-list> + <jsp-config> + <jsp-property-group> + <url-pattern>*.jsp</url-pattern> + <include-prelude>/header.jspf</include-prelude> + </jsp-property-group></jsp-config> +</web-app> diff --git a/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/WebContent/header.jspf b/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/WebContent/header.jspf new file mode 100644 index 000000000..4dc2f5bd9 --- /dev/null +++ b/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/WebContent/header.jspf @@ -0,0 +1,5 @@ +<%@ taglib prefix="logic" uri="http://jakarta.apache.org/struts/tags-logic"%>
+<%! int alpha = 5; %>
+<%@ taglib prefix="bean" uri="http://jakarta.apache.org/struts/tags-bean"%>
+
+<% %>
diff --git a/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/WebContent/main.jsp b/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/WebContent/main.jsp new file mode 100644 index 000000000..5d094dc1a --- /dev/null +++ b/tests/org.eclipse.jst.jsp.core.tests/testfiles/bug_399017/WebContent/main.jsp @@ -0,0 +1,14 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<!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=ISO-8859-1"> +<title>Insert title here</title> +</head> +<body> +<!-- note: the directive for bean exists in header.jspf as specified in the web.xml file --> +<bean:define id="foo" ></bean:define> +<%=alpha%>
+</body> +</html> |