Reorg of /demos/ with focus on demo-spec downstream dependencies. (#5367)
* Reorg of /demos/ with focus on spec modules * Reworking demo-mock-resources into /demos/ proper * Removing old /tests/ modules that no longer have a reason for existing. * Making demo-mock-resources a formal module * demo-jndi and demo-spec now depend on it * Restoring jetty-maven-plugin config lost in demo-jetty-webapp * Fixing jetty-maven-plugin realm usage to be local Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
parent
ad2446dd6c
commit
b22ce9c044
|
@ -8,7 +8,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>demo-async-rest-jar</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Demo Async Rest :: Jar</name>
|
||||
<name>Demo :: Async Rest :: Jar</name>
|
||||
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.parent.groupId}.async.rest</bundle-symbolic-name>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>demo-async-rest-server</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Demo Async Rest :: Server</name>
|
||||
<name>Demo :: Async Rest :: Server</name>
|
||||
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.parent.groupId}.async.rest.server</bundle-symbolic-name>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>demo-async-rest-webapp</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>Demo Async Rest :: Webapp</name>
|
||||
<name>Demo :: Async Rest :: WebApp</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>demo-async-rest-parent</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Demo Async Rest</name>
|
||||
<name>Demo :: Async Rest</name>
|
||||
|
||||
<modules>
|
||||
<module>demo-async-rest-jar</module>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<version>10.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>demo-jaas-webapp</artifactId>
|
||||
<name>Jetty Tests :: WebApp :: JAAS</name>
|
||||
<name>Demo :: JAAS :: WebApp</name>
|
||||
<packaging>war</packaging>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.jaas</bundle-symbolic-name>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>demo-jetty-webapp</artifactId>
|
||||
<name>Demo :: Jetty Test Webapp</name>
|
||||
<name>Demo :: Jetty :: WebApp</name>
|
||||
<packaging>war</packaging>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.webapp</bundle-symbolic-name>
|
||||
|
@ -85,6 +85,45 @@
|
|||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-client</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlets</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<configuration>
|
||||
<stopPort>8087</stopPort>
|
||||
<stopKey>foo</stopKey>
|
||||
<scan>1</scan>
|
||||
<systemProperties>
|
||||
<fooprop>222</fooprop>
|
||||
</systemProperties>
|
||||
<webApp>
|
||||
<contextPath>/test</contextPath>
|
||||
<tempDirectory>${project.build.directory}/work</tempDirectory>
|
||||
</webApp>
|
||||
<loginServices>
|
||||
<loginService implementation="org.eclipse.jetty.security.HashLoginService">
|
||||
<name>Test Realm</name>
|
||||
<config>src/test/resources/test-realm.properties</config>
|
||||
</loginService>
|
||||
</loginServices>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
#
|
||||
# This file defines users passwords and roles for a HashUserRealm
|
||||
#
|
||||
# The format is
|
||||
# <username>: <password>[,<rolename> ...]
|
||||
#
|
||||
# Passwords may be clear text, obfuscated or checksummed. The class
|
||||
# org.eclipse.util.Password should be used to generate obfuscated
|
||||
# passwords or password checksums
|
||||
#
|
||||
# If DIGEST Authentication is used, the password must be in a recoverable
|
||||
# format, either plain text or OBF:.
|
||||
#
|
||||
jetty:MD5:164c88b302622e17050af52c89945d44,user
|
||||
admin:CRYPT:adpexzg3FUZAk,server-administrator,content-administrator,admin,user
|
||||
other:OBF:1xmk1w261u9r1w1c1xmq,user
|
||||
plain:plain,user
|
||||
user:password,user
|
||||
# This entry is for digest auth. The credential is a MD5 hash of username:realmname:password
|
||||
digest:MD5:6e120743ad67abfbc385bc2bb754e297,user
|
|
@ -7,7 +7,7 @@
|
|||
<version>10.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>demo-jndi-webapp</artifactId>
|
||||
<name>Demo :: WebApp :: JNDI</name>
|
||||
<name>Demo :: JNDI :: WebApp</name>
|
||||
<packaging>war</packaging>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.jndi</bundle-symbolic-name>
|
||||
|
|
|
@ -12,10 +12,10 @@ deploy
|
|||
ext
|
||||
jdbc
|
||||
plus
|
||||
demo-mock-resources
|
||||
|
||||
[files]
|
||||
basehome:modules/demo.d/demo-jndi.xml|webapps/demo-jndi.xml
|
||||
maven://org.eclipse.jetty.demos/demo-jndi-webapp/${jetty.version}/war|webapps/demo-jndi.war
|
||||
maven://org.eclipse.jetty.demos/demo-mock-resources/${jetty.version}/jar|lib/ext/demo-mock-resources-${jetty.version}.jar
|
||||
maven://org.eclipse.jetty.orbit/javax.mail.glassfish/1.4.1.v201005082020/jar|lib/ext/javax.mail.glassfish-1.4.1.v201005082020.jar
|
||||
maven://jakarta.transaction/jakarta.transaction-api/1.3.2/jar|lib/ext/jakarta.transaction-api-1.3.2.jar
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<artifactId>demos-parent</artifactId>
|
||||
<version>10.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<name>Demos :: WebApp :: Mock Resources</name>
|
||||
<name>Demo :: Mock Resources</name>
|
||||
<artifactId>demo-mock-resources</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
|
||||
|
||||
[description]
|
||||
Download and install some Demo Mock Resources
|
||||
|
||||
[tags]
|
||||
demo
|
||||
|
||||
[depends]
|
||||
jdbc
|
||||
annotations
|
||||
|
||||
[files]
|
||||
maven://org.eclipse.jetty.demos/demo-mock-resources/${jetty.version}/jar|lib/ext/demo-mock-resources-${jetty.version}.jar
|
|
@ -7,7 +7,7 @@
|
|||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>demo-proxy-webapp</artifactId>
|
||||
<name>Demo :: Jetty Proxy Webapp</name>
|
||||
<name>Demo :: Proxy :: Webapp</name>
|
||||
<packaging>war</packaging>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.proxy</bundle-symbolic-name>
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>test-servlet-spec-parent</artifactId>
|
||||
<groupId>org.eclipse.jetty.demos</groupId>
|
||||
<artifactId>demos-parent</artifactId>
|
||||
<version>10.0.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<artifactId>test-container-initializer</artifactId>
|
||||
<artifactId>demo-container-initializer</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Jetty Tests :: WebApp :: Servlet Spec :: ServletContainerInitializer Test Jar</name>
|
||||
<name>Demo :: Servlet Spec :: ServletContainerInitializer Jar</name>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.sci</bundle-symbolic-name>
|
||||
</properties>
|
||||
|
@ -19,7 +20,7 @@
|
|||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-SymbolicName>org.eclipse.jetty.tests.test-servlet-container-initializer;singleton:=true</Bundle-SymbolicName>
|
||||
<Bundle-SymbolicName>org.eclipse.jetty.demos.demo-servlet-container-initializer;singleton:=true</Bundle-SymbolicName>
|
||||
<Bundle-Description>A bundle containing a ServletContainerInitializer for testing</Bundle-Description>
|
||||
<Require-Capability>osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)"</Require-Capability>
|
||||
<Provide-Capability>osgi.serviceloader; osgi.serviceloader=javax.servlet.ServletContainerInitializer</Provide-Capability>
|
|
@ -91,7 +91,7 @@ public class FooInitializer implements ServletContainerInitializer
|
|||
ServletRegistration.Dynamic reg = context.addServlet("AnnotationTest", "com.acme.AnnotationTest");
|
||||
context.setAttribute("com.acme.AnnotationTest.complete", (reg == null));
|
||||
context.addListener(new FooListener());
|
||||
|
||||
|
||||
//test adding jsp file dynamically
|
||||
ServletRegistration.Dynamic jspFile = context.addJspFile("dynamic.jsp", "/dynamic.jsp");
|
||||
context.setAttribute("com.acme.jsp.file", (jspFile != null));
|
|
@ -5,8 +5,9 @@
|
|||
<groupId>org.eclipse.jetty.demos</groupId>
|
||||
<artifactId>demos-parent</artifactId>
|
||||
<version>10.0.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<name>Demo :: Spec Webapp</name>
|
||||
<name>Demo :: Servlet Spec :: Webapp</name>
|
||||
<artifactId>demo-spec-webapp</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<properties>
|
||||
|
@ -199,13 +200,13 @@
|
|||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>test-web-fragment</artifactId>
|
||||
<groupId>org.eclipse.jetty.demos</groupId>
|
||||
<artifactId>demo-web-fragment</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>test-container-initializer</artifactId>
|
||||
<groupId>org.eclipse.jetty.demos</groupId>
|
||||
<artifactId>demo-container-initializer</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
|
@ -14,6 +14,7 @@ jsp
|
|||
annotations
|
||||
ext
|
||||
demo-realm
|
||||
demo-mock-resources
|
||||
|
||||
[files]
|
||||
basehome:modules/demo.d/demo-spec.xml|webapps/demo-spec.xml
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
|
@ -1,17 +1,18 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>test-servlet-spec-parent</artifactId>
|
||||
<groupId>org.eclipse.jetty.demos</groupId>
|
||||
<artifactId>demos-parent</artifactId>
|
||||
<version>10.0.0-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<name>Jetty Tests :: WebApp :: Servlet Spec :: Fragment Jar</name>
|
||||
<artifactId>test-web-fragment</artifactId>
|
||||
<name>Demo :: Servlet Spec :: Fragment Jar</name>
|
||||
<artifactId>demo-web-fragment</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.fragment</bundle-symbolic-name>
|
||||
<bundle-symbolic-name>${project.groupId}.spec.fragment</bundle-symbolic-name>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
|
@ -1,7 +1,7 @@
|
|||
<h1>Welcome to a Fragment</h1>
|
||||
|
||||
<p>
|
||||
This index.html file was included in a fragment's META-INF/resources directory.
|
||||
This index.html file was included in a fragment's META-INF/resources directory.
|
||||
</p>
|
||||
|
||||
<a href="../fragment/">Now hit a servlet added by a fragment</a>
|
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<web-fragment
|
||||
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd"
|
||||
version="3.1">
|
||||
|
||||
<name>FragmentA</name>
|
||||
|
||||
<ordering>
|
||||
<after>
|
||||
<others />
|
||||
</after>
|
||||
</ordering>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>AnnotationTest</servlet-name>
|
||||
<servlet-class>com.acme.test.AnnotationTest</servlet-class>
|
||||
<init-param>
|
||||
<param-name>extra1</param-name>
|
||||
<param-value>123</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>extra2</param-name>
|
||||
<param-value>345</param-value>
|
||||
</init-param>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>Fragment</servlet-name>
|
||||
<servlet-class>com.acme.fragment.FragmentServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>Fragment</servlet-name>
|
||||
<url-pattern>/fragment/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
</web-fragment>
|
||||
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty.demos</groupId>
|
||||
<artifactId>demos-parent</artifactId>
|
||||
<version>10.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<name>Demo :: Servlet Spec</name>
|
||||
<artifactId>demo-spec</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>demo-spec-webapp</module>
|
||||
<module>demo-container-initializer</module>
|
||||
<module>demo-web-fragment</module>
|
||||
</modules>
|
||||
</project>
|
|
@ -6,8 +6,8 @@
|
|||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>demos-jetty-embedded</artifactId>
|
||||
<name>Demos :: Jetty Embedded</name>
|
||||
<description>Jetty Embedded Demos</description>
|
||||
<name>Demo :: Embedded Jetty</name>
|
||||
<description>Embedded Jetty Demos</description>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.embedded</bundle-symbolic-name>
|
||||
</properties>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.eclipse.jetty.demos</groupId>
|
||||
<artifactId>demos-parent</artifactId>
|
||||
<name>Jetty Demos :: Parent</name>
|
||||
<name>Demos :: Parent</name>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
|
@ -22,8 +22,8 @@
|
|||
<module>demo-jndi-webapp</module>
|
||||
<module>demo-jetty-webapp</module>
|
||||
<module>demo-proxy-webapp</module>
|
||||
<module>demo-spec-webapp</module>
|
||||
<module>demo-mock-resources</module>
|
||||
<module>demo-spec</module>
|
||||
<module>embedded</module>
|
||||
</modules>
|
||||
</project>
|
||||
|
|
|
@ -810,6 +810,14 @@
|
|||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!-- Demo Apps -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.demos</groupId>
|
||||
<artifactId>demo-mock-resources</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>config</classifier>
|
||||
<type>jar</type>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.demos</groupId>
|
||||
<artifactId>demo-jetty-webapp</artifactId>
|
||||
|
|
|
@ -382,8 +382,8 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>test-container-initializer</artifactId>
|
||||
<groupId>org.eclipse.jetty.demos</groupId>
|
||||
<artifactId>demo-container-initializer</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
@ -407,8 +407,8 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>test-mock-resources</artifactId>
|
||||
<groupId>org.eclipse.jetty.demos</groupId>
|
||||
<artifactId>demo-mock-resources</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -86,8 +86,8 @@ public class TestJettyOSGiBootWithAnnotations
|
|||
List<Option> res = new ArrayList<>();
|
||||
res.add(mavenBundle().groupId("com.sun.activation").artifactId("javax.activation").version("1.2.0").noStart());
|
||||
res.add(mavenBundle().groupId("org.eclipse.jetty.orbit").artifactId("javax.mail.glassfish").version("1.4.1.v201005082020").noStart());
|
||||
res.add(mavenBundle().groupId("org.eclipse.jetty.tests").artifactId("test-container-initializer").versionAsInProject());
|
||||
res.add(mavenBundle().groupId("org.eclipse.jetty.tests").artifactId("test-mock-resources").versionAsInProject());
|
||||
res.add(mavenBundle().groupId("org.eclipse.jetty.demos").artifactId("demo-container-initializer").versionAsInProject());
|
||||
res.add(mavenBundle().groupId("org.eclipse.jetty.demos").artifactId("demo-mock-resources").versionAsInProject());
|
||||
//test webapp bundle
|
||||
res.add(mavenBundle().groupId("org.eclipse.jetty.demos").artifactId("demo-spec-webapp").classifier("webbundle").versionAsInProject());
|
||||
return res;
|
||||
|
|
|
@ -51,8 +51,8 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>test-mock-resources</artifactId>
|
||||
<groupId>org.eclipse.jetty.demos</groupId>
|
||||
<artifactId>demo-mock-resources</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
</build>
|
||||
<modules>
|
||||
<module>test-webapp-rfc2616</module>
|
||||
<module>test-mock-resources</module>
|
||||
<module>test-servlet-spec</module>
|
||||
<module>test-http2-webapp</module>
|
||||
<module>test-simple-webapp</module>
|
||||
<module>test-felix-webapp</module>
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>test-webapps-parent</artifactId>
|
||||
<version>10.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<name>Jetty Tests :: WebApp :: Mock Resources</name>
|
||||
<artifactId>test-mock-resources</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<bundle-symbolic-name>${project.groupId}.mocks</bundle-symbolic-name>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Bundle-SymbolicName>org.eclipse.jetty.tests.test-mock-resources</Bundle-SymbolicName>
|
||||
<Bundle-Description>Mock resources used for testing</Bundle-Description>
|
||||
<Export-Package>
|
||||
com.acme;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"
|
||||
</Export-Package>
|
||||
<Import-Package>
|
||||
javax.sql, javax.transaction;version="1.1", javax.mail;version="1.4.1"
|
||||
</Import-Package>
|
||||
<_nouses>true</_nouses>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>jakarta.transaction</groupId>
|
||||
<artifactId>jakarta.transaction-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.toolchain</groupId>
|
||||
<artifactId>jetty-servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
<artifactId>javax.mail.glassfish</artifactId>
|
||||
<version>1.4.1.v201005082020</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,88 +0,0 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under
|
||||
// the terms of the Eclipse Public License 2.0 which is available at
|
||||
// https://www.eclipse.org/legal/epl-2.0
|
||||
//
|
||||
// This Source Code may also be made available under the following
|
||||
// Secondary Licenses when the conditions for such availability set
|
||||
// forth in the Eclipse Public License, v. 2.0 are satisfied:
|
||||
// the Apache License v2.0 which is available at
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package com.acme;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.logging.Logger;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
/**
|
||||
* MockDataSource
|
||||
*/
|
||||
public class MockDataSource implements DataSource
|
||||
{
|
||||
|
||||
/**
|
||||
* NOTE: JDK7+ new feature
|
||||
*/
|
||||
@Override
|
||||
public Logger getParentLogger()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Connection getConnection() throws SQLException
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Connection getConnection(String username, String password)
|
||||
throws SQLException
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrintWriter getLogWriter() throws SQLException
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLoginTimeout() throws SQLException
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLogWriter(PrintWriter out) throws SQLException
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLoginTimeout(int seconds) throws SQLException
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWrapperFor(Class<?> iface) throws SQLException
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T unwrap(Class<T> iface) throws SQLException
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under
|
||||
// the terms of the Eclipse Public License 2.0 which is available at
|
||||
// https://www.eclipse.org/legal/epl-2.0
|
||||
//
|
||||
// This Source Code may also be made available under the following
|
||||
// Secondary Licenses when the conditions for such availability set
|
||||
// forth in the Eclipse Public License, v. 2.0 are satisfied:
|
||||
// the Apache License v2.0 which is available at
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package com.acme;
|
||||
|
||||
import javax.mail.Address;
|
||||
import javax.mail.Message;
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.Session;
|
||||
import javax.mail.Transport;
|
||||
import javax.mail.URLName;
|
||||
|
||||
/**
|
||||
* MockTransport
|
||||
*/
|
||||
public class MockTransport extends Transport
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public MockTransport(Session session, URLName urlname)
|
||||
{
|
||||
super(session, urlname);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(Message arg0, Address[] arg1) throws MessagingException
|
||||
{
|
||||
System.err.println("Sending message");
|
||||
}
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
//
|
||||
// ========================================================================
|
||||
// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
|
||||
//
|
||||
// This program and the accompanying materials are made available under
|
||||
// the terms of the Eclipse Public License 2.0 which is available at
|
||||
// https://www.eclipse.org/legal/epl-2.0
|
||||
//
|
||||
// This Source Code may also be made available under the following
|
||||
// Secondary Licenses when the conditions for such availability set
|
||||
// forth in the Eclipse Public License, v. 2.0 are satisfied:
|
||||
// the Apache License v2.0 which is available at
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
|
||||
// ========================================================================
|
||||
//
|
||||
|
||||
package com.acme;
|
||||
|
||||
import javax.transaction.HeuristicMixedException;
|
||||
import javax.transaction.HeuristicRollbackException;
|
||||
import javax.transaction.NotSupportedException;
|
||||
import javax.transaction.RollbackException;
|
||||
import javax.transaction.SystemException;
|
||||
import javax.transaction.UserTransaction;
|
||||
|
||||
/**
|
||||
* MockUserTransaction
|
||||
*/
|
||||
public class MockUserTransaction implements UserTransaction
|
||||
{
|
||||
|
||||
@Override
|
||||
public void begin() throws NotSupportedException, SystemException
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void commit() throws HeuristicMixedException,
|
||||
HeuristicRollbackException, IllegalStateException,
|
||||
RollbackException, SecurityException, SystemException
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStatus() throws SystemException
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rollback() throws IllegalStateException, SecurityException,
|
||||
SystemException
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRollbackOnly() throws IllegalStateException, SystemException
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTransactionTimeout(int arg0) throws SystemException
|
||||
{
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
protocol=smtp; type=transport; class=com.acme.MockTransport; vendor=Acme Tests;
|
|
@ -1,29 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.eclipse.jetty.tests</groupId>
|
||||
<artifactId>test-webapps-parent</artifactId>
|
||||
<version>10.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>test-servlet-spec-parent</artifactId>
|
||||
<name>Jetty Tests :: Spec Test WebApp :: Parent</name>
|
||||
<packaging>pom</packaging>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- DO NOT DEPLOY (or Release) -->
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<modules>
|
||||
<module>test-web-fragment</module>
|
||||
<module>test-container-initializer</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
|
@ -1,38 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<web-fragment
|
||||
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-fragment_3_1.xsd"
|
||||
version="3.1">
|
||||
|
||||
<name>FragmentA</name>
|
||||
|
||||
<ordering>
|
||||
<after><others/></after>
|
||||
</ordering>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>AnnotationTest</servlet-name>
|
||||
<servlet-class>com.acme.test.AnnotationTest</servlet-class>
|
||||
<init-param>
|
||||
<param-name>extra1</param-name><param-value>123</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>extra2</param-name><param-value>345</param-value>
|
||||
</init-param>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>Fragment</servlet-name>
|
||||
<servlet-class>com.acme.fragment.FragmentServlet</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>Fragment</servlet-name>
|
||||
<url-pattern>/fragment/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
</web-fragment>
|
||||
|
||||
|
Loading…
Reference in New Issue