Bug 501935: Add test case
diff --git a/org.eclipse.gemini.web.test/src/test/java/org/eclipse/gemini/web/test/tomcat/TomcatServletContainerTests.java b/org.eclipse.gemini.web.test/src/test/java/org/eclipse/gemini/web/test/tomcat/TomcatServletContainerTests.java
index 9f18194..fba0834 100644
--- a/org.eclipse.gemini.web.test/src/test/java/org/eclipse/gemini/web/test/tomcat/TomcatServletContainerTests.java
+++ b/org.eclipse.gemini.web.test/src/test/java/org/eclipse/gemini/web/test/tomcat/TomcatServletContainerTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2014 VMware Inc.
+ * Copyright (c) 2009, 2016 VMware Inc.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -486,6 +486,7 @@
Object[] result = startWebApplicationWith(LOCATION_WAR_WITH_WEB_XML_FROM_FRAGMENT, "/war-with-web-xml-from-fragment");
try {
validateURL("http://localhost:8080/war-with-web-xml-from-fragment");
+ validateURL("http://localhost:8080/war-with-web-xml-from-fragment/NewPackageServlet");
} finally {
this.container.stopWebApplication((WebApplicationHandle) result[1]);
((Bundle) result[0]).uninstall();
diff --git a/org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/loading/BundleEntry.java b/org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/loading/BundleEntry.java
index f0bda24..618c128 100644
--- a/org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/loading/BundleEntry.java
+++ b/org.eclipse.gemini.web.tomcat/src/main/java/org/eclipse/gemini/web/tomcat/internal/loading/BundleEntry.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2013 VMware Inc.
+ * Copyright (c) 2009, 2016 VMware Inc.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
diff --git a/test-bundles/fragment-provides-web-xml/build.xml b/test-bundles/fragment-provides-web-xml/build.xml
index 4a0b8f3..a5d08df 100755
--- a/test-bundles/fragment-provides-web-xml/build.xml
+++ b/test-bundles/fragment-provides-web-xml/build.xml
@@ -3,8 +3,8 @@
<property file="${basedir}/../../build.properties"/>
<property file="${basedir}/../../build.versions"/>
- <property name="jar.output.dir" value="${basedir}/../../org.eclipse.gemini.web.test/target/resources"/>
+ <property name="wab.output.dir" value="${basedir}/../../org.eclipse.gemini.web.test/target/resources"/>
<property name="disable.bundlor" value="true"/>
- <import file="${basedir}/../../virgo-build/standard/default.xml"/>
+ <import file="${basedir}/../../virgo-build/wab/default.xml"/>
</project>
diff --git a/test-bundles/fragment-provides-web-xml/ivy.xml b/test-bundles/fragment-provides-web-xml/ivy.xml
index f599a64..1f14d60 100755
--- a/test-bundles/fragment-provides-web-xml/ivy.xml
+++ b/test-bundles/fragment-provides-web-xml/ivy.xml
@@ -16,7 +16,9 @@
<artifact name="${ant.project.name}-sources" type="src" ext="jar"/>
</publications>
+
<dependencies>
+ <dependency org="javax.servlet" name="javax.servlet" rev="${javax.servlet}" conf="compile->runtime"/>
</dependencies>
</ivy-module>
diff --git a/test-bundles/fragment-provides-web-xml/src/main/java/.gitignore b/test-bundles/fragment-provides-web-xml/src/main/java/.gitignore
deleted file mode 100755
index e69de29..0000000
--- a/test-bundles/fragment-provides-web-xml/src/main/java/.gitignore
+++ /dev/null
diff --git a/test-bundles/fragment-provides-web-xml/src/main/java/test/NewPackageServlet.java b/test-bundles/fragment-provides-web-xml/src/main/java/test/NewPackageServlet.java
new file mode 100644
index 0000000..f1452c6
--- /dev/null
+++ b/test-bundles/fragment-provides-web-xml/src/main/java/test/NewPackageServlet.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Pivotal Software, Inc.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Apache License v2.0 which accompanies this distribution.
+ * The Eclipse Public License is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * and the Apache License v2.0 is available at
+ * http://www.opensource.org/licenses/apache2.0.php.
+ * You may elect to redistribute this code under either of these licenses.
+ *
+ * Contributors:
+ * Violeta Georgieva - initial contribution
+ *******************************************************************************/
+package test;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@WebServlet("/NewPackageServlet")
+public class NewPackageServlet extends HttpServlet {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+ response.getWriter().append("Served from a fragment.");
+ }
+
+}
diff --git a/test-bundles/fragment-provides-web-xml/src/main/resources/META-INF/MANIFEST.MF b/test-bundles/fragment-provides-web-xml/src/main/webapp/META-INF/MANIFEST.MF
similarity index 67%
rename from test-bundles/fragment-provides-web-xml/src/main/resources/META-INF/MANIFEST.MF
rename to test-bundles/fragment-provides-web-xml/src/main/webapp/META-INF/MANIFEST.MF
index 836ff38..39b0bc1 100755
--- a/test-bundles/fragment-provides-web-xml/src/main/resources/META-INF/MANIFEST.MF
+++ b/test-bundles/fragment-provides-web-xml/src/main/webapp/META-INF/MANIFEST.MF
@@ -1,6 +1,10 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: fragment-provides-web-xml
+Bundle-ClassPath: WEB-INF/classes/
+Import-Package: javax.servlet,
+ javax.servlet.annotation,
+ javax.servlet.http
Fragment-Host: war-with-web-xml-from-fragment;bundle-version=1.0.0
Bundle-Version: 1.0.0
Bundle-Description: Fragment that provides web.xml
diff --git a/test-bundles/fragment-provides-web-xml/src/main/resources/WEB-INF/web.xml b/test-bundles/fragment-provides-web-xml/src/main/webapp/WEB-INF/web.xml
similarity index 100%
rename from test-bundles/fragment-provides-web-xml/src/main/resources/WEB-INF/web.xml
rename to test-bundles/fragment-provides-web-xml/src/main/webapp/WEB-INF/web.xml