Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 329979 | Differences between
and this patch

Collapse All | Expand All

(-)a/build-web-container/build.xml (+2 lines)
Lines 29-34 Link Here
29
		<pathelement location="../test-bundles/war-with-jsp"/>
29
		<pathelement location="../test-bundles/war-with-jsp"/>
30
		<pathelement location="../test-bundles/war-with-servlet"/>
30
		<pathelement location="../test-bundles/war-with-servlet"/>
31
		<pathelement location="../test-bundles/war-with-tld"/>
31
		<pathelement location="../test-bundles/war-with-tld"/>
32
		<pathelement location="../test-bundles/fragment-provides-web-xml"/>
33
		<pathelement location="../test-bundles/war-with-web-xml-from-fragment"/>
32
	</path>
34
	</path>
33
35
34
	<target name="test" depends="build-test-apps, quality-multi-bundle.test" description="Rebuild all the test apps before running the test suites">
36
	<target name="test" depends="build-test-apps, quality-multi-bundle.test" description="Rebuild all the test apps before running the test suites">
(-)a/org.eclipse.gemini.web.test/src/test/java/org/eclipse/gemini/web/test/tomcat/TomcatServletContainerTests.java (+22 lines)
Lines 86-91 public class TomcatServletContainerTests { Link Here
86
    private static final String LOCATION_WAR_WITH_CONTEXT_XML_CROSS_CONTEXT = LOCATION_PREFIX
86
    private static final String LOCATION_WAR_WITH_CONTEXT_XML_CROSS_CONTEXT = LOCATION_PREFIX
87
        + "../org.eclipse.gemini.web.test/src/test/resources/war-with-context-xml-cross-context.war?Web-ContextPath=/war-with-context-xml-cross-context";
87
        + "../org.eclipse.gemini.web.test/src/test/resources/war-with-context-xml-cross-context.war?Web-ContextPath=/war-with-context-xml-cross-context";
88
88
89
    private static final String LOCATION_WAR_WITH_WEB_XML_FROM_FRAGMENT = "file:../org.eclipse.gemini.web.test/target/resources/war-with-web-xml-from-fragment.war";
90
91
    private static final String LOCATION_FRAGMENT_PROVIDES_WEB_XML = "file:../org.eclipse.gemini.web.test/target/resources/fragment-provides-web-xml.jar";
92
89
    private BundleContext bundleContext;
93
    private BundleContext bundleContext;
90
94
91
    private ServletContainer container;
95
    private ServletContainer container;
Lines 444-449 public class TomcatServletContainerTests { Link Here
444
        }
448
        }
445
    }
449
    }
446
450
451
    @Test
452
    public void testWarWithWebXmlFromFragment() throws Exception {
453
        Bundle bundle = this.bundleContext.installBundle(LOCATION_WAR_WITH_WEB_XML_FROM_FRAGMENT);
454
        Bundle fragment = this.bundleContext.installBundle(LOCATION_FRAGMENT_PROVIDES_WEB_XML);
455
456
        bundle.start();
457
458
        WebApplicationHandle handle = this.container.createWebApplication("/war-with-web-xml-from-fragment", bundle);
459
        this.container.startWebApplication(handle);
460
        try {
461
            validateURL("http://localhost:8080/war-with-web-xml-from-fragment");
462
        } finally {
463
            this.container.stopWebApplication(handle);
464
            bundle.uninstall();
465
            fragment.uninstall();
466
        }
467
    }
468
447
    private void createFileWithContent(File file, String content) throws Exception {
469
    private void createFileWithContent(File file, String content) throws Exception {
448
        file.getParentFile().mkdirs();
470
        file.getParentFile().mkdirs();
449
        FileWriter fWriter = null;
471
        FileWriter fWriter = null;
(-)a/test-bundles/fragment-provides-web-xml/build.xml (+9 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project name="fragment-provides-web-xml">
3
4
	<property file="${basedir}/../build.properties"/>
5
	<property file="${basedir}/../../build.versions"/>
6
	<property name="jar.output.dir" value="${basedir}/../../org.eclipse.gemini.web.test/target/resources"/>
7
	<import file="${basedir}/../../virgo-build/standard/default.xml"/>
8
9
</project>
(-)a/test-bundles/fragment-provides-web-xml/ivy.xml (+22 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?xml-stylesheet type="text/xsl" href="http://ivyrep.jayasoft.org/ivy-doc.xsl"?>
3
<ivy-module
4
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
        xsi:noNamespaceSchemaLocation="http://incubator.apache.org/ivy/schemas/ivy.xsd"
6
        version="1.3">
7
8
    <info organisation="org.eclipse.gemini.web" module="${ant.project.name}"/>
9
10
    <configurations>
11
        <include file="${virgo.build.dir}/common/default-ivy-configurations.xml"/>
12
    </configurations>
13
14
    <publications>
15
        <artifact name="${ant.project.name}"/>
16
        <artifact name="${ant.project.name}-sources" type="src" ext="jar"/>
17
    </publications>
18
19
    <dependencies>
20
    </dependencies>
21
22
</ivy-module>
(-)a/test-bundles/fragment-provides-web-xml/src/main/resources/META-INF/MANIFEST.MF (+8 lines)
Added Link Here
1
Manifest-Version: 1.0
2
Bundle-ManifestVersion: 2
3
Bundle-SymbolicName: fragment-provides-web-xml
4
Fragment-Host: war-with-web-xml-from-fragment;bundle-version=1.0.0
5
Bundle-Version: 1.0.0
6
Bundle-Description: Fragment that provides web.xml
7
8
(-)a/test-bundles/fragment-provides-web-xml/src/main/resources/WEB-INF/web.xml (+6 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
3
  <welcome-file-list>
4
    <welcome-file>welcome.jsp</welcome-file>
5
  </welcome-file-list>
6
</web-app>
(-)a/test-bundles/war-with-web-xml-from-fragment/build.xml (+9 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project name="war-with-web-xml-from-fragment">
3
4
	<property file="${basedir}/../build.properties"/>
5
	<property file="${basedir}/../../build.versions"/>
6
	<property name="war.output.dir" value="${basedir}/../../org.eclipse.gemini.web.test/target/resources"/>
7
	<import file="${basedir}/../../virgo-build/war/default.xml"/>
8
9
</project>
(-)a/test-bundles/war-with-web-xml-from-fragment/ivy.xml (+22 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?xml-stylesheet type="text/xsl" href="http://ivyrep.jayasoft.org/ivy-doc.xsl"?>
3
<ivy-module
4
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
        xsi:noNamespaceSchemaLocation="http://incubator.apache.org/ivy/schemas/ivy.xsd"
6
        version="1.3">
7
8
    <info organisation="org.eclipse.gemini.web" module="${ant.project.name}"/>
9
10
    <configurations>
11
        <include file="${virgo.build.dir}/common/default-ivy-configurations.xml"/>
12
    </configurations>
13
14
    <publications>
15
        <artifact name="${ant.project.name}" type="war" ext="war"/>
16
        <artifact name="${ant.project.name}-sources" type="src" ext="jar"/>
17
    </publications>
18
19
    <dependencies>
20
    </dependencies>
21
22
</ivy-module>
(-)a/test-bundles/war-with-web-xml-from-fragment/src/main/webapp/META-INF/MANIFEST.MF (+14 lines)
Added Link Here
1
Manifest-Version: 1.0
2
Bundle-ManifestVersion: 2
3
Bundle-SymbolicName: war-with-web-xml-from-fragment
4
Bundle-Version: 1.0.0
5
Web-ContextPath: /war-with-web-xml-from-fragment
6
Import-Packages: javax.servlet,
7
 javax.servlet.http,
8
 javax.servlet.jsp,
9
 javax.servlet.jsp.el,
10
 javax.servlet.jsp.tagext,
11
 javax.el
12
Bundle-Description: Web application without web.xml
13
14
(-)a/test-bundles/war-with-web-xml-from-fragment/src/main/webapp/welcome.jsp (+8 lines)
Added Link Here
1
<html>
2
	<head>
3
		<title>web.xml provided by a fragment</title>
4
	</head>
5
	<body>
6
		Hello World!
7
	</body>
8
</html>

Return to bug 329979