From b22ce9c044c3221d753f1d41dd4f53b612abce4b Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 29 Sep 2020 11:37:22 -0500 Subject: [PATCH] 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 --- .../demo-async-rest-jar/pom.xml | 2 +- .../demo-async-rest-server/pom.xml | 2 +- .../demo-async-rest-webapp/pom.xml | 2 +- demos/demo-async-rest/pom.xml | 2 +- demos/demo-jaas-webapp/pom.xml | 2 +- demos/demo-jetty-webapp/pom.xml | 41 +++++++- .../src/test/resources/test-realm.properties | 20 ++++ demos/demo-jndi-webapp/pom.xml | 2 +- .../src/main/config/modules/demo-jndi.mod | 2 +- demos/demo-mock-resources/pom.xml | 2 +- .../config/modules/demo-mock-resources.mod | 14 +++ demos/demo-proxy-webapp/pom.xml | 2 +- .../demo-container-initializer}/pom.xml | 11 ++- .../main/java/com/acme/initializer/Foo.java | 0 .../com/acme/initializer/FooInitializer.java | 2 +- .../javax.servlet.ServletContainerInitializer | 0 .../{ => demo-spec}/demo-spec-webapp/pom.xml | 11 ++- .../demo-spec-webapp/src/etc/realm.properties | 0 .../src/main/assembly/web-bundle.xml | 0 .../src/main/config/modules/demo-spec.mod | 1 + .../main/config/modules/demo.d/demo-spec.xml | 0 .../java/com/acme/test/AnnotatedListener.java | 0 .../java/com/acme/test/AnnotationTest.java | 0 .../com/acme/test/AsyncListenerServlet.java | 0 .../src/main/java/com/acme/test/Bar.java | 0 .../com/acme/test/ClassLoaderServlet.java | 0 .../java/com/acme/test/MultiPartTest.java | 0 .../com/acme/test/RoleAnnotationTest.java | 0 .../java/com/acme/test/SecuredServlet.java | 0 .../main/java/com/acme/test/TestListener.java | 0 .../templates/annotations-context-header.xml | 0 .../src/main/templates/env-definitions.xml | 0 .../main/templates/plugin-context-header.xml | 0 .../src/main/webapp/WEB-INF/jetty-env.xml | 0 .../src/main/webapp/WEB-INF/jetty-web.xml | 0 .../src/main/webapp/WEB-INF/web.xml | 0 .../src/main/webapp/authfail.html | 0 .../src/main/webapp/dynamic.jsp | 0 .../src/main/webapp/images/jetty_banner.gif | Bin .../main/webapp/images/small_powered_by.gif | Bin .../src/main/webapp/index.html | 0 .../src/main/webapp/login.html | 0 .../src/main/webapp/logout.jsp | 0 .../src/main/webapp/stylesheet.css | 0 .../src/test/jetty-plugin-env.xml | 0 .../demo-spec/demo-web-fragment}/pom.xml | 11 ++- .../com/acme/fragment/FragmentServlet.java | 0 .../META-INF/resources/fragmentA/index.html | 2 +- .../main/resources/META-INF/web-fragment.xml | 42 +++++++++ demos/demo-spec/pom.xml | 18 ++++ demos/embedded/pom.xml | 4 +- demos/pom.xml | 4 +- jetty-home/pom.xml | 8 ++ jetty-osgi/test-jetty-osgi/pom.xml | 8 +- .../TestJettyOSGiBootWithAnnotations.java | 4 +- tests/test-quickstart/pom.xml | 4 +- tests/test-webapps/pom.xml | 2 - .../test-webapps/test-mock-resources/pom.xml | 62 ------------ .../main/java/com/acme/MockDataSource.java | 88 ------------------ .../src/main/java/com/acme/MockTransport.java | 46 --------- .../java/com/acme/MockUserTransaction.java | 67 ------------- .../resources/META-INF/javaxmail.providers | 1 - tests/test-webapps/test-servlet-spec/pom.xml | 29 ------ .../main/resources/META-INF/web-fragment.xml | 38 -------- 64 files changed, 184 insertions(+), 372 deletions(-) create mode 100644 demos/demo-jetty-webapp/src/test/resources/test-realm.properties create mode 100644 demos/demo-mock-resources/src/main/config/modules/demo-mock-resources.mod rename {tests/test-webapps/test-servlet-spec/test-container-initializer => demos/demo-spec/demo-container-initializer}/pom.xml (83%) rename {tests/test-webapps/test-servlet-spec/test-container-initializer => demos/demo-spec/demo-container-initializer}/src/main/java/com/acme/initializer/Foo.java (100%) rename {tests/test-webapps/test-servlet-spec/test-container-initializer => demos/demo-spec/demo-container-initializer}/src/main/java/com/acme/initializer/FooInitializer.java (99%) rename {tests/test-webapps/test-servlet-spec/test-container-initializer => demos/demo-spec/demo-container-initializer}/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer (100%) rename demos/{ => demo-spec}/demo-spec-webapp/pom.xml (96%) rename demos/{ => demo-spec}/demo-spec-webapp/src/etc/realm.properties (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/assembly/web-bundle.xml (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/config/modules/demo-spec.mod (95%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/config/modules/demo.d/demo-spec.xml (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/java/com/acme/test/AnnotatedListener.java (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/java/com/acme/test/AnnotationTest.java (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/java/com/acme/test/AsyncListenerServlet.java (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/java/com/acme/test/Bar.java (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/java/com/acme/test/ClassLoaderServlet.java (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/java/com/acme/test/MultiPartTest.java (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/java/com/acme/test/RoleAnnotationTest.java (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/java/com/acme/test/SecuredServlet.java (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/java/com/acme/test/TestListener.java (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/templates/annotations-context-header.xml (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/templates/env-definitions.xml (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/templates/plugin-context-header.xml (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/webapp/WEB-INF/jetty-env.xml (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/webapp/WEB-INF/jetty-web.xml (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/webapp/WEB-INF/web.xml (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/webapp/authfail.html (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/webapp/dynamic.jsp (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/webapp/images/jetty_banner.gif (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/webapp/images/small_powered_by.gif (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/webapp/index.html (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/webapp/login.html (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/webapp/logout.jsp (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/main/webapp/stylesheet.css (100%) rename demos/{ => demo-spec}/demo-spec-webapp/src/test/jetty-plugin-env.xml (100%) rename {tests/test-webapps/test-servlet-spec/test-web-fragment => demos/demo-spec/demo-web-fragment}/pom.xml (63%) rename {tests/test-webapps/test-servlet-spec/test-web-fragment => demos/demo-spec/demo-web-fragment}/src/main/java/com/acme/fragment/FragmentServlet.java (100%) rename {tests/test-webapps/test-servlet-spec/test-web-fragment => demos/demo-spec/demo-web-fragment}/src/main/resources/META-INF/resources/fragmentA/index.html (56%) create mode 100644 demos/demo-spec/demo-web-fragment/src/main/resources/META-INF/web-fragment.xml create mode 100644 demos/demo-spec/pom.xml delete mode 100644 tests/test-webapps/test-mock-resources/pom.xml delete mode 100644 tests/test-webapps/test-mock-resources/src/main/java/com/acme/MockDataSource.java delete mode 100644 tests/test-webapps/test-mock-resources/src/main/java/com/acme/MockTransport.java delete mode 100644 tests/test-webapps/test-mock-resources/src/main/java/com/acme/MockUserTransaction.java delete mode 100644 tests/test-webapps/test-mock-resources/src/main/resources/META-INF/javaxmail.providers delete mode 100644 tests/test-webapps/test-servlet-spec/pom.xml delete mode 100644 tests/test-webapps/test-servlet-spec/test-web-fragment/src/main/resources/META-INF/web-fragment.xml diff --git a/demos/demo-async-rest/demo-async-rest-jar/pom.xml b/demos/demo-async-rest/demo-async-rest-jar/pom.xml index 899807f45221..33b4e7a68f2b 100644 --- a/demos/demo-async-rest/demo-async-rest-jar/pom.xml +++ b/demos/demo-async-rest/demo-async-rest-jar/pom.xml @@ -8,7 +8,7 @@ 4.0.0 demo-async-rest-jar jar - Demo Async Rest :: Jar + Demo :: Async Rest :: Jar ${project.parent.groupId}.async.rest diff --git a/demos/demo-async-rest/demo-async-rest-server/pom.xml b/demos/demo-async-rest/demo-async-rest-server/pom.xml index aecc1c1430c9..735c7169ea83 100644 --- a/demos/demo-async-rest/demo-async-rest-server/pom.xml +++ b/demos/demo-async-rest/demo-async-rest-server/pom.xml @@ -8,7 +8,7 @@ 4.0.0 demo-async-rest-server jar - Demo Async Rest :: Server + Demo :: Async Rest :: Server ${project.parent.groupId}.async.rest.server diff --git a/demos/demo-async-rest/demo-async-rest-webapp/pom.xml b/demos/demo-async-rest/demo-async-rest-webapp/pom.xml index 6ee088662663..3e10a8f65e90 100644 --- a/demos/demo-async-rest/demo-async-rest-webapp/pom.xml +++ b/demos/demo-async-rest/demo-async-rest-webapp/pom.xml @@ -8,7 +8,7 @@ 4.0.0 demo-async-rest-webapp war - Demo Async Rest :: Webapp + Demo :: Async Rest :: WebApp diff --git a/demos/demo-async-rest/pom.xml b/demos/demo-async-rest/pom.xml index e0d72cadfb27..4827f75d19f2 100644 --- a/demos/demo-async-rest/pom.xml +++ b/demos/demo-async-rest/pom.xml @@ -8,7 +8,7 @@ 4.0.0 demo-async-rest-parent pom - Demo Async Rest + Demo :: Async Rest demo-async-rest-jar diff --git a/demos/demo-jaas-webapp/pom.xml b/demos/demo-jaas-webapp/pom.xml index 22ac92cd1313..dbd5ad8c812f 100644 --- a/demos/demo-jaas-webapp/pom.xml +++ b/demos/demo-jaas-webapp/pom.xml @@ -7,7 +7,7 @@ 10.0.0-SNAPSHOT demo-jaas-webapp - Jetty Tests :: WebApp :: JAAS + Demo :: JAAS :: WebApp war ${project.groupId}.jaas diff --git a/demos/demo-jetty-webapp/pom.xml b/demos/demo-jetty-webapp/pom.xml index 3c72d7c2251d..785869edf371 100644 --- a/demos/demo-jetty-webapp/pom.xml +++ b/demos/demo-jetty-webapp/pom.xml @@ -8,7 +8,7 @@ 4.0.0 demo-jetty-webapp - Demo :: Jetty Test Webapp + Demo :: Jetty :: WebApp war ${project.groupId}.webapp @@ -85,6 +85,45 @@ + + + + org.eclipse.jetty + jetty-maven-plugin + ${project.version} + + + org.eclipse.jetty + jetty-client + ${project.version} + + + org.eclipse.jetty + jetty-servlets + ${project.version} + + + + 8087 + foo + 1 + + 222 + + + /test + ${project.build.directory}/work + + + + Test Realm + src/test/resources/test-realm.properties + + + + + + diff --git a/demos/demo-jetty-webapp/src/test/resources/test-realm.properties b/demos/demo-jetty-webapp/src/test/resources/test-realm.properties new file mode 100644 index 000000000000..9d9bc3684935 --- /dev/null +++ b/demos/demo-jetty-webapp/src/test/resources/test-realm.properties @@ -0,0 +1,20 @@ +# +# This file defines users passwords and roles for a HashUserRealm +# +# The format is +# : [, ...] +# +# 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 diff --git a/demos/demo-jndi-webapp/pom.xml b/demos/demo-jndi-webapp/pom.xml index c5131e7f3316..f267041752bf 100644 --- a/demos/demo-jndi-webapp/pom.xml +++ b/demos/demo-jndi-webapp/pom.xml @@ -7,7 +7,7 @@ 10.0.0-SNAPSHOT demo-jndi-webapp - Demo :: WebApp :: JNDI + Demo :: JNDI :: WebApp war ${project.groupId}.jndi diff --git a/demos/demo-jndi-webapp/src/main/config/modules/demo-jndi.mod b/demos/demo-jndi-webapp/src/main/config/modules/demo-jndi.mod index 1b355ccce5da..08e90ec58aed 100644 --- a/demos/demo-jndi-webapp/src/main/config/modules/demo-jndi.mod +++ b/demos/demo-jndi-webapp/src/main/config/modules/demo-jndi.mod @@ -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 diff --git a/demos/demo-mock-resources/pom.xml b/demos/demo-mock-resources/pom.xml index 78afd0600740..97e8de9cbb16 100644 --- a/demos/demo-mock-resources/pom.xml +++ b/demos/demo-mock-resources/pom.xml @@ -5,7 +5,7 @@ demos-parent 10.0.0-SNAPSHOT - Demos :: WebApp :: Mock Resources + Demo :: Mock Resources demo-mock-resources jar diff --git a/demos/demo-mock-resources/src/main/config/modules/demo-mock-resources.mod b/demos/demo-mock-resources/src/main/config/modules/demo-mock-resources.mod new file mode 100644 index 000000000000..dd8faf6d661f --- /dev/null +++ b/demos/demo-mock-resources/src/main/config/modules/demo-mock-resources.mod @@ -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 diff --git a/demos/demo-proxy-webapp/pom.xml b/demos/demo-proxy-webapp/pom.xml index e94dac1b037c..4ab6368e4d6e 100644 --- a/demos/demo-proxy-webapp/pom.xml +++ b/demos/demo-proxy-webapp/pom.xml @@ -7,7 +7,7 @@ 4.0.0 demo-proxy-webapp - Demo :: Jetty Proxy Webapp + Demo :: Proxy :: Webapp war ${project.groupId}.proxy diff --git a/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml b/demos/demo-spec/demo-container-initializer/pom.xml similarity index 83% rename from tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml rename to demos/demo-spec/demo-container-initializer/pom.xml index 8beeaf3a4686..2fe9d1b59f27 100644 --- a/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml +++ b/demos/demo-spec/demo-container-initializer/pom.xml @@ -1,13 +1,14 @@ 4.0.0 - org.eclipse.jetty.tests - test-servlet-spec-parent + org.eclipse.jetty.demos + demos-parent 10.0.0-SNAPSHOT + ../../pom.xml - test-container-initializer + demo-container-initializer jar - Jetty Tests :: WebApp :: Servlet Spec :: ServletContainerInitializer Test Jar + Demo :: Servlet Spec :: ServletContainerInitializer Jar ${project.groupId}.sci @@ -19,7 +20,7 @@ true - org.eclipse.jetty.tests.test-servlet-container-initializer;singleton:=true + org.eclipse.jetty.demos.demo-servlet-container-initializer;singleton:=true A bundle containing a ServletContainerInitializer for testing osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" osgi.serviceloader; osgi.serviceloader=javax.servlet.ServletContainerInitializer diff --git a/tests/test-webapps/test-servlet-spec/test-container-initializer/src/main/java/com/acme/initializer/Foo.java b/demos/demo-spec/demo-container-initializer/src/main/java/com/acme/initializer/Foo.java similarity index 100% rename from tests/test-webapps/test-servlet-spec/test-container-initializer/src/main/java/com/acme/initializer/Foo.java rename to demos/demo-spec/demo-container-initializer/src/main/java/com/acme/initializer/Foo.java diff --git a/tests/test-webapps/test-servlet-spec/test-container-initializer/src/main/java/com/acme/initializer/FooInitializer.java b/demos/demo-spec/demo-container-initializer/src/main/java/com/acme/initializer/FooInitializer.java similarity index 99% rename from tests/test-webapps/test-servlet-spec/test-container-initializer/src/main/java/com/acme/initializer/FooInitializer.java rename to demos/demo-spec/demo-container-initializer/src/main/java/com/acme/initializer/FooInitializer.java index ca1751ad1089..737936463e19 100644 --- a/tests/test-webapps/test-servlet-spec/test-container-initializer/src/main/java/com/acme/initializer/FooInitializer.java +++ b/demos/demo-spec/demo-container-initializer/src/main/java/com/acme/initializer/FooInitializer.java @@ -91,7 +91,7 @@ public void onStartup(Set> classes, ServletContext context) 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)); diff --git a/tests/test-webapps/test-servlet-spec/test-container-initializer/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer b/demos/demo-spec/demo-container-initializer/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer similarity index 100% rename from tests/test-webapps/test-servlet-spec/test-container-initializer/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer rename to demos/demo-spec/demo-container-initializer/src/main/resources/META-INF/services/javax.servlet.ServletContainerInitializer diff --git a/demos/demo-spec-webapp/pom.xml b/demos/demo-spec/demo-spec-webapp/pom.xml similarity index 96% rename from demos/demo-spec-webapp/pom.xml rename to demos/demo-spec/demo-spec-webapp/pom.xml index 7b52df49efc3..9f035ffabb93 100644 --- a/demos/demo-spec-webapp/pom.xml +++ b/demos/demo-spec/demo-spec-webapp/pom.xml @@ -5,8 +5,9 @@ org.eclipse.jetty.demos demos-parent 10.0.0-SNAPSHOT + ../../pom.xml - Demo :: Spec Webapp + Demo :: Servlet Spec :: Webapp demo-spec-webapp war @@ -199,13 +200,13 @@ provided - org.eclipse.jetty.tests - test-web-fragment + org.eclipse.jetty.demos + demo-web-fragment ${project.version} - org.eclipse.jetty.tests - test-container-initializer + org.eclipse.jetty.demos + demo-container-initializer ${project.version} diff --git a/demos/demo-spec-webapp/src/etc/realm.properties b/demos/demo-spec/demo-spec-webapp/src/etc/realm.properties similarity index 100% rename from demos/demo-spec-webapp/src/etc/realm.properties rename to demos/demo-spec/demo-spec-webapp/src/etc/realm.properties diff --git a/demos/demo-spec-webapp/src/main/assembly/web-bundle.xml b/demos/demo-spec/demo-spec-webapp/src/main/assembly/web-bundle.xml similarity index 100% rename from demos/demo-spec-webapp/src/main/assembly/web-bundle.xml rename to demos/demo-spec/demo-spec-webapp/src/main/assembly/web-bundle.xml diff --git a/demos/demo-spec-webapp/src/main/config/modules/demo-spec.mod b/demos/demo-spec/demo-spec-webapp/src/main/config/modules/demo-spec.mod similarity index 95% rename from demos/demo-spec-webapp/src/main/config/modules/demo-spec.mod rename to demos/demo-spec/demo-spec-webapp/src/main/config/modules/demo-spec.mod index 9f3de374b769..7ffb9d23f8d1 100644 --- a/demos/demo-spec-webapp/src/main/config/modules/demo-spec.mod +++ b/demos/demo-spec/demo-spec-webapp/src/main/config/modules/demo-spec.mod @@ -14,6 +14,7 @@ jsp annotations ext demo-realm +demo-mock-resources [files] basehome:modules/demo.d/demo-spec.xml|webapps/demo-spec.xml diff --git a/demos/demo-spec-webapp/src/main/config/modules/demo.d/demo-spec.xml b/demos/demo-spec/demo-spec-webapp/src/main/config/modules/demo.d/demo-spec.xml similarity index 100% rename from demos/demo-spec-webapp/src/main/config/modules/demo.d/demo-spec.xml rename to demos/demo-spec/demo-spec-webapp/src/main/config/modules/demo.d/demo-spec.xml diff --git a/demos/demo-spec-webapp/src/main/java/com/acme/test/AnnotatedListener.java b/demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/AnnotatedListener.java similarity index 100% rename from demos/demo-spec-webapp/src/main/java/com/acme/test/AnnotatedListener.java rename to demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/AnnotatedListener.java diff --git a/demos/demo-spec-webapp/src/main/java/com/acme/test/AnnotationTest.java b/demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/AnnotationTest.java similarity index 100% rename from demos/demo-spec-webapp/src/main/java/com/acme/test/AnnotationTest.java rename to demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/AnnotationTest.java diff --git a/demos/demo-spec-webapp/src/main/java/com/acme/test/AsyncListenerServlet.java b/demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/AsyncListenerServlet.java similarity index 100% rename from demos/demo-spec-webapp/src/main/java/com/acme/test/AsyncListenerServlet.java rename to demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/AsyncListenerServlet.java diff --git a/demos/demo-spec-webapp/src/main/java/com/acme/test/Bar.java b/demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/Bar.java similarity index 100% rename from demos/demo-spec-webapp/src/main/java/com/acme/test/Bar.java rename to demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/Bar.java diff --git a/demos/demo-spec-webapp/src/main/java/com/acme/test/ClassLoaderServlet.java b/demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/ClassLoaderServlet.java similarity index 100% rename from demos/demo-spec-webapp/src/main/java/com/acme/test/ClassLoaderServlet.java rename to demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/ClassLoaderServlet.java diff --git a/demos/demo-spec-webapp/src/main/java/com/acme/test/MultiPartTest.java b/demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/MultiPartTest.java similarity index 100% rename from demos/demo-spec-webapp/src/main/java/com/acme/test/MultiPartTest.java rename to demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/MultiPartTest.java diff --git a/demos/demo-spec-webapp/src/main/java/com/acme/test/RoleAnnotationTest.java b/demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/RoleAnnotationTest.java similarity index 100% rename from demos/demo-spec-webapp/src/main/java/com/acme/test/RoleAnnotationTest.java rename to demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/RoleAnnotationTest.java diff --git a/demos/demo-spec-webapp/src/main/java/com/acme/test/SecuredServlet.java b/demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/SecuredServlet.java similarity index 100% rename from demos/demo-spec-webapp/src/main/java/com/acme/test/SecuredServlet.java rename to demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/SecuredServlet.java diff --git a/demos/demo-spec-webapp/src/main/java/com/acme/test/TestListener.java b/demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/TestListener.java similarity index 100% rename from demos/demo-spec-webapp/src/main/java/com/acme/test/TestListener.java rename to demos/demo-spec/demo-spec-webapp/src/main/java/com/acme/test/TestListener.java diff --git a/demos/demo-spec-webapp/src/main/templates/annotations-context-header.xml b/demos/demo-spec/demo-spec-webapp/src/main/templates/annotations-context-header.xml similarity index 100% rename from demos/demo-spec-webapp/src/main/templates/annotations-context-header.xml rename to demos/demo-spec/demo-spec-webapp/src/main/templates/annotations-context-header.xml diff --git a/demos/demo-spec-webapp/src/main/templates/env-definitions.xml b/demos/demo-spec/demo-spec-webapp/src/main/templates/env-definitions.xml similarity index 100% rename from demos/demo-spec-webapp/src/main/templates/env-definitions.xml rename to demos/demo-spec/demo-spec-webapp/src/main/templates/env-definitions.xml diff --git a/demos/demo-spec-webapp/src/main/templates/plugin-context-header.xml b/demos/demo-spec/demo-spec-webapp/src/main/templates/plugin-context-header.xml similarity index 100% rename from demos/demo-spec-webapp/src/main/templates/plugin-context-header.xml rename to demos/demo-spec/demo-spec-webapp/src/main/templates/plugin-context-header.xml diff --git a/demos/demo-spec-webapp/src/main/webapp/WEB-INF/jetty-env.xml b/demos/demo-spec/demo-spec-webapp/src/main/webapp/WEB-INF/jetty-env.xml similarity index 100% rename from demos/demo-spec-webapp/src/main/webapp/WEB-INF/jetty-env.xml rename to demos/demo-spec/demo-spec-webapp/src/main/webapp/WEB-INF/jetty-env.xml diff --git a/demos/demo-spec-webapp/src/main/webapp/WEB-INF/jetty-web.xml b/demos/demo-spec/demo-spec-webapp/src/main/webapp/WEB-INF/jetty-web.xml similarity index 100% rename from demos/demo-spec-webapp/src/main/webapp/WEB-INF/jetty-web.xml rename to demos/demo-spec/demo-spec-webapp/src/main/webapp/WEB-INF/jetty-web.xml diff --git a/demos/demo-spec-webapp/src/main/webapp/WEB-INF/web.xml b/demos/demo-spec/demo-spec-webapp/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from demos/demo-spec-webapp/src/main/webapp/WEB-INF/web.xml rename to demos/demo-spec/demo-spec-webapp/src/main/webapp/WEB-INF/web.xml diff --git a/demos/demo-spec-webapp/src/main/webapp/authfail.html b/demos/demo-spec/demo-spec-webapp/src/main/webapp/authfail.html similarity index 100% rename from demos/demo-spec-webapp/src/main/webapp/authfail.html rename to demos/demo-spec/demo-spec-webapp/src/main/webapp/authfail.html diff --git a/demos/demo-spec-webapp/src/main/webapp/dynamic.jsp b/demos/demo-spec/demo-spec-webapp/src/main/webapp/dynamic.jsp similarity index 100% rename from demos/demo-spec-webapp/src/main/webapp/dynamic.jsp rename to demos/demo-spec/demo-spec-webapp/src/main/webapp/dynamic.jsp diff --git a/demos/demo-spec-webapp/src/main/webapp/images/jetty_banner.gif b/demos/demo-spec/demo-spec-webapp/src/main/webapp/images/jetty_banner.gif similarity index 100% rename from demos/demo-spec-webapp/src/main/webapp/images/jetty_banner.gif rename to demos/demo-spec/demo-spec-webapp/src/main/webapp/images/jetty_banner.gif diff --git a/demos/demo-spec-webapp/src/main/webapp/images/small_powered_by.gif b/demos/demo-spec/demo-spec-webapp/src/main/webapp/images/small_powered_by.gif similarity index 100% rename from demos/demo-spec-webapp/src/main/webapp/images/small_powered_by.gif rename to demos/demo-spec/demo-spec-webapp/src/main/webapp/images/small_powered_by.gif diff --git a/demos/demo-spec-webapp/src/main/webapp/index.html b/demos/demo-spec/demo-spec-webapp/src/main/webapp/index.html similarity index 100% rename from demos/demo-spec-webapp/src/main/webapp/index.html rename to demos/demo-spec/demo-spec-webapp/src/main/webapp/index.html diff --git a/demos/demo-spec-webapp/src/main/webapp/login.html b/demos/demo-spec/demo-spec-webapp/src/main/webapp/login.html similarity index 100% rename from demos/demo-spec-webapp/src/main/webapp/login.html rename to demos/demo-spec/demo-spec-webapp/src/main/webapp/login.html diff --git a/demos/demo-spec-webapp/src/main/webapp/logout.jsp b/demos/demo-spec/demo-spec-webapp/src/main/webapp/logout.jsp similarity index 100% rename from demos/demo-spec-webapp/src/main/webapp/logout.jsp rename to demos/demo-spec/demo-spec-webapp/src/main/webapp/logout.jsp diff --git a/demos/demo-spec-webapp/src/main/webapp/stylesheet.css b/demos/demo-spec/demo-spec-webapp/src/main/webapp/stylesheet.css similarity index 100% rename from demos/demo-spec-webapp/src/main/webapp/stylesheet.css rename to demos/demo-spec/demo-spec-webapp/src/main/webapp/stylesheet.css diff --git a/demos/demo-spec-webapp/src/test/jetty-plugin-env.xml b/demos/demo-spec/demo-spec-webapp/src/test/jetty-plugin-env.xml similarity index 100% rename from demos/demo-spec-webapp/src/test/jetty-plugin-env.xml rename to demos/demo-spec/demo-spec-webapp/src/test/jetty-plugin-env.xml diff --git a/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml b/demos/demo-spec/demo-web-fragment/pom.xml similarity index 63% rename from tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml rename to demos/demo-spec/demo-web-fragment/pom.xml index 8a0fed27d72a..994e5e6f209e 100644 --- a/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml +++ b/demos/demo-spec/demo-web-fragment/pom.xml @@ -1,17 +1,18 @@ 4.0.0 - org.eclipse.jetty.tests - test-servlet-spec-parent + org.eclipse.jetty.demos + demos-parent 10.0.0-SNAPSHOT + ../../pom.xml - Jetty Tests :: WebApp :: Servlet Spec :: Fragment Jar - test-web-fragment + Demo :: Servlet Spec :: Fragment Jar + demo-web-fragment jar - ${project.groupId}.fragment + ${project.groupId}.spec.fragment diff --git a/tests/test-webapps/test-servlet-spec/test-web-fragment/src/main/java/com/acme/fragment/FragmentServlet.java b/demos/demo-spec/demo-web-fragment/src/main/java/com/acme/fragment/FragmentServlet.java similarity index 100% rename from tests/test-webapps/test-servlet-spec/test-web-fragment/src/main/java/com/acme/fragment/FragmentServlet.java rename to demos/demo-spec/demo-web-fragment/src/main/java/com/acme/fragment/FragmentServlet.java diff --git a/tests/test-webapps/test-servlet-spec/test-web-fragment/src/main/resources/META-INF/resources/fragmentA/index.html b/demos/demo-spec/demo-web-fragment/src/main/resources/META-INF/resources/fragmentA/index.html similarity index 56% rename from tests/test-webapps/test-servlet-spec/test-web-fragment/src/main/resources/META-INF/resources/fragmentA/index.html rename to demos/demo-spec/demo-web-fragment/src/main/resources/META-INF/resources/fragmentA/index.html index 0b686ef92763..02303e909ae6 100644 --- a/tests/test-webapps/test-servlet-spec/test-web-fragment/src/main/resources/META-INF/resources/fragmentA/index.html +++ b/demos/demo-spec/demo-web-fragment/src/main/resources/META-INF/resources/fragmentA/index.html @@ -1,7 +1,7 @@

Welcome to a Fragment

-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.

Now hit a servlet added by a fragment diff --git a/demos/demo-spec/demo-web-fragment/src/main/resources/META-INF/web-fragment.xml b/demos/demo-spec/demo-web-fragment/src/main/resources/META-INF/web-fragment.xml new file mode 100644 index 000000000000..dd5f712bcfcb --- /dev/null +++ b/demos/demo-spec/demo-web-fragment/src/main/resources/META-INF/web-fragment.xml @@ -0,0 +1,42 @@ + + + + + FragmentA + + + + + + + + + AnnotationTest + com.acme.test.AnnotationTest + + extra1 + 123 + + + extra2 + 345 + + + + + Fragment + com.acme.fragment.FragmentServlet + + + + Fragment + /fragment/* + + + + + diff --git a/demos/demo-spec/pom.xml b/demos/demo-spec/pom.xml new file mode 100644 index 000000000000..d352b423aed3 --- /dev/null +++ b/demos/demo-spec/pom.xml @@ -0,0 +1,18 @@ + + + 4.0.0 + + org.eclipse.jetty.demos + demos-parent + 10.0.0-SNAPSHOT + + Demo :: Servlet Spec + demo-spec + pom + + + demo-spec-webapp + demo-container-initializer + demo-web-fragment + + diff --git a/demos/embedded/pom.xml b/demos/embedded/pom.xml index 44db698bdbb2..1a0cde082d09 100644 --- a/demos/embedded/pom.xml +++ b/demos/embedded/pom.xml @@ -6,8 +6,8 @@ 4.0.0 demos-jetty-embedded - Demos :: Jetty Embedded - Jetty Embedded Demos + Demo :: Embedded Jetty + Embedded Jetty Demos ${project.groupId}.embedded diff --git a/demos/pom.xml b/demos/pom.xml index c3bfa5329e68..c947037e5d3b 100644 --- a/demos/pom.xml +++ b/demos/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.eclipse.jetty.demos demos-parent - Jetty Demos :: Parent + Demos :: Parent pom @@ -22,8 +22,8 @@ demo-jndi-webapp demo-jetty-webapp demo-proxy-webapp - demo-spec-webapp demo-mock-resources + demo-spec embedded
diff --git a/jetty-home/pom.xml b/jetty-home/pom.xml index 825fccc6f5ce..4d1453bd1fbd 100644 --- a/jetty-home/pom.xml +++ b/jetty-home/pom.xml @@ -810,6 +810,14 @@ true
+ + org.eclipse.jetty.demos + demo-mock-resources + ${project.version} + config + jar + true + org.eclipse.jetty.demos demo-jetty-webapp diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml index e19a24ef7b04..fafb41f6b152 100644 --- a/jetty-osgi/test-jetty-osgi/pom.xml +++ b/jetty-osgi/test-jetty-osgi/pom.xml @@ -382,8 +382,8 @@ test - org.eclipse.jetty.tests - test-container-initializer + org.eclipse.jetty.demos + demo-container-initializer ${project.version} test @@ -407,8 +407,8 @@ test - org.eclipse.jetty.tests - test-mock-resources + org.eclipse.jetty.demos + demo-mock-resources ${project.version} diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java index a1760c48afee..05fd6da87132 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootWithAnnotations.java @@ -86,8 +86,8 @@ public static List - org.eclipse.jetty.tests - test-mock-resources + org.eclipse.jetty.demos + demo-mock-resources ${project.version} test diff --git a/tests/test-webapps/pom.xml b/tests/test-webapps/pom.xml index f28273005676..69117f7b1c41 100644 --- a/tests/test-webapps/pom.xml +++ b/tests/test-webapps/pom.xml @@ -31,8 +31,6 @@ test-webapp-rfc2616 - test-mock-resources - test-servlet-spec test-http2-webapp test-simple-webapp test-felix-webapp diff --git a/tests/test-webapps/test-mock-resources/pom.xml b/tests/test-webapps/test-mock-resources/pom.xml deleted file mode 100644 index aa30708c191a..000000000000 --- a/tests/test-webapps/test-mock-resources/pom.xml +++ /dev/null @@ -1,62 +0,0 @@ - - 4.0.0 - - org.eclipse.jetty.tests - test-webapps-parent - 10.0.0-SNAPSHOT - - Jetty Tests :: WebApp :: Mock Resources - test-mock-resources - jar - - ${project.groupId}.mocks - - - - - org.apache.felix - maven-bundle-plugin - true - - - - manifest - - - - org.eclipse.jetty.tests.test-mock-resources - Mock resources used for testing - - com.acme;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}" - - - javax.sql, javax.transaction;version="1.1", javax.mail;version="1.4.1" - - <_nouses>true - - - - - - - - - - jakarta.transaction - jakarta.transaction-api - provided - - - org.eclipse.jetty.toolchain - jetty-servlet-api - provided - - - org.eclipse.jetty.orbit - javax.mail.glassfish - 1.4.1.v201005082020 - provided - - - - diff --git a/tests/test-webapps/test-mock-resources/src/main/java/com/acme/MockDataSource.java b/tests/test-webapps/test-mock-resources/src/main/java/com/acme/MockDataSource.java deleted file mode 100644 index 7d16f9bce5f4..000000000000 --- a/tests/test-webapps/test-mock-resources/src/main/java/com/acme/MockDataSource.java +++ /dev/null @@ -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 unwrap(Class iface) throws SQLException - { - return null; - } -} diff --git a/tests/test-webapps/test-mock-resources/src/main/java/com/acme/MockTransport.java b/tests/test-webapps/test-mock-resources/src/main/java/com/acme/MockTransport.java deleted file mode 100644 index 0b9fd2937d11..000000000000 --- a/tests/test-webapps/test-mock-resources/src/main/java/com/acme/MockTransport.java +++ /dev/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"); - } -} diff --git a/tests/test-webapps/test-mock-resources/src/main/java/com/acme/MockUserTransaction.java b/tests/test-webapps/test-mock-resources/src/main/java/com/acme/MockUserTransaction.java deleted file mode 100644 index edffcaf2957a..000000000000 --- a/tests/test-webapps/test-mock-resources/src/main/java/com/acme/MockUserTransaction.java +++ /dev/null @@ -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 - { - } -} diff --git a/tests/test-webapps/test-mock-resources/src/main/resources/META-INF/javaxmail.providers b/tests/test-webapps/test-mock-resources/src/main/resources/META-INF/javaxmail.providers deleted file mode 100644 index 5ab3340c05a3..000000000000 --- a/tests/test-webapps/test-mock-resources/src/main/resources/META-INF/javaxmail.providers +++ /dev/null @@ -1 +0,0 @@ - protocol=smtp; type=transport; class=com.acme.MockTransport; vendor=Acme Tests; diff --git a/tests/test-webapps/test-servlet-spec/pom.xml b/tests/test-webapps/test-servlet-spec/pom.xml deleted file mode 100644 index cadd7cb360f9..000000000000 --- a/tests/test-webapps/test-servlet-spec/pom.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - 4.0.0 - - org.eclipse.jetty.tests - test-webapps-parent - 10.0.0-SNAPSHOT - - test-servlet-spec-parent - Jetty Tests :: Spec Test WebApp :: Parent - pom - - - - org.apache.maven.plugins - maven-deploy-plugin - - - true - - - - - - test-web-fragment - test-container-initializer - - - diff --git a/tests/test-webapps/test-servlet-spec/test-web-fragment/src/main/resources/META-INF/web-fragment.xml b/tests/test-webapps/test-servlet-spec/test-web-fragment/src/main/resources/META-INF/web-fragment.xml deleted file mode 100644 index ae015f2712c5..000000000000 --- a/tests/test-webapps/test-servlet-spec/test-web-fragment/src/main/resources/META-INF/web-fragment.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - FragmentA - - - - - - - AnnotationTest - com.acme.test.AnnotationTest - - extra1123 - - - extra2345 - - - - - Fragment - com.acme.fragment.FragmentServlet - - - - Fragment - /fragment/* - - - - -