You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jg...@apache.org on 2019/11/15 12:26:08 UTC

[tomee] branch master updated (06dac01 -> 4ec07ef)

This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git.


    from 06dac01  Merge pull request #605 from Daniel-Dos/TOMEE-2733
     add f70e95a  TOMEE-2708-translate to portuguese dynamic-dao.
     add df748ba  fix word in doc.
     new a334af3  Merge branch 'TOMEE-2708' of github.com:Daniel-Dos/tomee
     add bc09ef1  TOMEE-2720-Translate dynamic-datasource-routing
     add 9061957  fix in doc.
     new 8d483e7  Merge branch 'TOMEE-2720' of github.com:Daniel-Dos/tomee
     add e70502b  feat: create new example about dynamic injection
     add 4e4c75c  feat: created Portuguese documentation
     add 931c1c7  feat: created english documentation
     new dc416c1  Merge branch 'master' of github.com:cassunde/tomee
     add b8f9176  Allow exp claim to be optional
     add a083fc6  TOMEE-2730 add mp.jwt.tomee.allow.no-exp option
     new e313484  Merge branch 'jwt-work'
     new 522959c  TOMEE-2736 - Explicitly override cached system properties in RemoteServer for Maven TomEE Plugin
     new a4a89dd  Merge branch 'TOMEE-2736' of github.com:rzo1/tomee
     new a118295  TOMEE-2739 use webcontext and the path to evaluate which context to apply the filter to
     new abe466d  Headers
     new 4e01ac7  Merge branch 'TOMEE-2739'
     new a1b6c42  Fix compile error
     new 4ec07ef  Checkstyle

The 11 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../arquillian/tests/jaxrs}/ear/EarTest.java       |  29 ++--
 .../App.java => ear/HelloApplication.java}         |   6 +-
 .../arquillian/tests/jaxrs/ear/HelloEndpoint.java  |  15 +-
 .../SimpleServlet.java => ear/HelloServlet.java}   |  12 +-
 examples/cdi-dynamic-inject/README.adoc            | 114 +++++++++++++
 examples/cdi-dynamic-inject/README_pt.adoc         | 115 +++++++++++++
 examples/{cdi-basic => cdi-dynamic-inject}/pom.xml |   4 +-
 .../cdi/inject/dynamic/FinalizePayment.java        |  48 ++++++
 .../cdi/inject/dynamic/PayByQualifier.java         |  34 ++++
 .../main/java/org/superbiz/cdi/qualifier/Cash.java |   8 +
 .../org/superbiz/cdi/qualifier/CreditCard.java     |   8 +
 .../java/org/superbiz/cdi/qualifier/Payment.java   |   0
 .../superbiz/cdi/qualifier/PaymentQualifier.java   |   0
 .../org/superbiz/cdi/qualifier/PaymentType.java    |   0
 .../src/main/resources/META-INF/beans.xml          |   0
 .../dynamic/FinalizePaymentQualifierTest.java}     |  24 ++-
 .../cdi/inject/dynamic/FinalizePaymentTest.java}   |  23 ++-
 .../org/superbiz/cdi/qualifier/PaymentTest.java    |   0
 examples/dynamic-dao-implementation/README.adoc    |   8 +-
 .../{README.adoc => README_pt.adoc}                |  55 ++++---
 .../{README.adoc => README_pt.adoc}                | 153 +++++++++---------
 .../rest/MoviesMPJWTConfigurationProvider.java     |   2 +-
 .../openejb/maven/plugin/AbstractTomEEMojo.java    |  16 +-
 .../microprofile/jwt/JsonWebTokenValidator.java    |  17 +-
 .../apache/tomee/microprofile/jwt/MPJWTFilter.java |   4 +-
 .../jwt/config/JWTAuthConfiguration.java           |  23 ++-
 .../jwt/config/JWTAuthConfigurationProperties.java |   3 +-
 .../jwt/principal/JWTCallerPrincipal.java          |   3 -
 .../tck/jwt/JWTAuthContextInfoProvider.java        |   2 +-
 .../jwt/MicroProfileJWTTCKArchiveProcessor.java    |  15 +-
 .../ExpClaimAllowMissingExpValidationTest.java     | 179 +++++++++++++++++++++
 .../tck/jwt/validation/ExpClaimValidationTest.java | 167 +++++++++++++++++++
 .../jwt/src/test/resources/Token1NoExp.json        |  62 +++++++
 .../jwt/src/test/resources/dev.xml                 |   2 +
 .../apache/tomee/webservices/TomcatRsRegistry.java |  29 ++--
 35 files changed, 974 insertions(+), 206 deletions(-)
 copy arquillian/arquillian-tomee-tests/{arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests => arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs}/ear/EarTest.java (55%)
 copy arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/{notfound/App.java => ear/HelloApplication.java} (87%)
 copy examples/rest-example-with-application/src/main/java/org/superbiz/rest/application/SimpleRESTEJB.java => arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloEndpoint.java (79%)
 copy arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/{staticresources/SimpleServlet.java => ear/HelloServlet.java} (76%)
 create mode 100644 examples/cdi-dynamic-inject/README.adoc
 create mode 100644 examples/cdi-dynamic-inject/README_pt.adoc
 copy examples/{cdi-basic => cdi-dynamic-inject}/pom.xml (96%)
 create mode 100644 examples/cdi-dynamic-inject/src/main/java/org/superbiz/cdi/inject/dynamic/FinalizePayment.java
 create mode 100644 examples/cdi-dynamic-inject/src/main/java/org/superbiz/cdi/inject/dynamic/PayByQualifier.java
 copy examples/{cdi-qualifier => cdi-dynamic-inject}/src/main/java/org/superbiz/cdi/qualifier/Cash.java (90%)
 copy examples/{cdi-qualifier => cdi-dynamic-inject}/src/main/java/org/superbiz/cdi/qualifier/CreditCard.java (90%)
 copy examples/{cdi-qualifier => cdi-dynamic-inject}/src/main/java/org/superbiz/cdi/qualifier/Payment.java (100%)
 copy examples/{cdi-qualifier => cdi-dynamic-inject}/src/main/java/org/superbiz/cdi/qualifier/PaymentQualifier.java (100%)
 copy examples/{cdi-qualifier => cdi-dynamic-inject}/src/main/java/org/superbiz/cdi/qualifier/PaymentType.java (100%)
 copy examples/{groovy-spock => cdi-dynamic-inject}/src/main/resources/META-INF/beans.xml (100%)
 copy examples/{cdi-qualifier/src/test/java/org/superbiz/cdi/qualifier/PaymentTest.java => cdi-dynamic-inject/src/test/java/org/superbiz/cdi/inject/dynamic/FinalizePaymentQualifierTest.java} (74%)
 copy examples/{cdi-qualifier/src/test/java/org/superbiz/cdi/qualifier/PaymentTest.java => cdi-dynamic-inject/src/test/java/org/superbiz/cdi/inject/dynamic/FinalizePaymentTest.java} (76%)
 copy examples/{cdi-qualifier => cdi-dynamic-inject}/src/test/java/org/superbiz/cdi/qualifier/PaymentTest.java (100%)
 copy examples/dynamic-dao-implementation/{README.adoc => README_pt.adoc} (89%)
 copy examples/dynamic-datasource-routing/{README.adoc => README_pt.adoc} (73%)
 create mode 100644 tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/validation/ExpClaimAllowMissingExpValidationTest.java
 create mode 100644 tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/validation/ExpClaimValidationTest.java
 create mode 100644 tck/microprofile-tck/jwt/src/test/resources/Token1NoExp.json


[tomee] 09/11: Merge branch 'TOMEE-2739'

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 4e01ac703a8425833e100eacd7c81ae71344a0d1
Merge: a4a89dd abe466d
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Thu Nov 14 20:29:19 2019 +0000

    Merge branch 'TOMEE-2739'

 .../arquillian/tests/jaxrs/ear/EarTest.java        | 70 ++++++++++++++++++++++
 .../tests/jaxrs/ear/HelloApplication.java          | 24 ++++++++
 .../arquillian/tests/jaxrs/ear/HelloEndpoint.java  | 38 ++++++++++++
 .../arquillian/tests/jaxrs/ear/HelloServlet.java   | 34 +++++++++++
 .../apache/tomee/webservices/TomcatRsRegistry.java | 27 ++++-----
 5 files changed, 179 insertions(+), 14 deletions(-)


[tomee] 01/11: TOMEE-2736 - Explicitly override cached system properties in RemoteServer for Maven TomEE Plugin

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 522959cf1a23a959238eb51311756b0145b0de6e
Author: Richard Zowalla <ri...@zowalla.com>
AuthorDate: Wed Nov 13 11:15:17 2019 +0100

    TOMEE-2736 - Explicitly override cached system properties in RemoteServer for Maven TomEE Plugin
---
 .../apache/openejb/maven/plugin/AbstractTomEEMojo.java   | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/maven/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/AbstractTomEEMojo.java b/maven/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/AbstractTomEEMojo.java
index 7a6741d..c04c261 100644
--- a/maven/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/AbstractTomEEMojo.java
+++ b/maven/tomee-maven-plugin/src/main/java/org/apache/openejb/maven/plugin/AbstractTomEEMojo.java
@@ -82,6 +82,7 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.NoSuchElementException;
+import java.util.Properties;
 import java.util.Scanner;
 import java.util.concurrent.CountDownLatch;
 import java.util.logging.SimpleFormatter;
@@ -1296,7 +1297,18 @@ public abstract class AbstractTomEEMojo extends AbstractAddressMojo {
         System.setProperty("server.shutdown.port", String.valueOf(tomeeShutdownPort));
         System.setProperty("server.shutdown.command", tomeeShutdownCommand);
 
-        server = new RemoteServer(getConnectAttempts(), debug);
+        // We might need to override static cached env vars in RemoteServer
+        // Reason: Multiple execution in same JVM, i.e. in Maven Integration Tests
+        Properties override = new Properties();
+        override.setProperty("openejb.home", System.getProperty("openejb.home"));
+        if (debug) {
+            override.setProperty("openejb.server.debug", System.getProperty("openejb.server.debug"));
+            override.setProperty("server.debug.port", System.getProperty("server.debug.port"));
+        }
+        override.setProperty("server.shutdown.port", System.getProperty("server.shutdown.port"));
+        override.setProperty("server.shutdown.command", System.getProperty("server.shutdown.command"));
+
+        server = new RemoteServer(override, getConnectAttempts(), debug);
         server.setAdditionalClasspath(getAdditionalClasspath());
 
         addShutdownHooks(server); // some shutdown hooks are always added (see UpdatableTomEEMojo)
@@ -1315,7 +1327,7 @@ public abstract class AbstractTomEEMojo extends AbstractAddressMojo {
             getLog().info("Running '" + getClass().getSimpleName().replace("TomEEMojo", "").toLowerCase(Locale.ENGLISH));
         }
 
-        final InputStream originalIn = System.in; // piped when starting resmote server so saving it
+        final InputStream originalIn = System.in; // piped when starting remote server so saving it
 
         serverCmd(server, strings);
 


[tomee] 07/11: Merge branch 'jwt-work'

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit e313484cebd85e406b367b4b9b22ddb975192ff1
Merge: dc416c1 a083fc6
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Thu Nov 14 20:28:15 2019 +0000

    Merge branch 'jwt-work'

 .../microprofile/jwt/JsonWebTokenValidator.java    |  17 +-
 .../apache/tomee/microprofile/jwt/MPJWTFilter.java |   4 +-
 .../jwt/config/JWTAuthConfiguration.java           |  23 ++-
 .../jwt/config/JWTAuthConfigurationProperties.java |   3 +-
 .../jwt/principal/JWTCallerPrincipal.java          |   3 -
 .../tck/jwt/JWTAuthContextInfoProvider.java        |   2 +-
 .../jwt/MicroProfileJWTTCKArchiveProcessor.java    |  15 +-
 .../ExpClaimAllowMissingExpValidationTest.java     | 179 +++++++++++++++++++++
 .../tck/jwt/validation/ExpClaimValidationTest.java | 167 +++++++++++++++++++
 .../jwt/src/test/resources/Token1NoExp.json        |  62 +++++++
 .../jwt/src/test/resources/dev.xml                 |   2 +
 11 files changed, 451 insertions(+), 26 deletions(-)


[tomee] 03/11: Headers

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit abe466da12c41051e4072c510587c8b716561ad4
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Wed Nov 13 17:44:32 2019 +0000

    Headers
---
 .../arquillian/tests/jaxrs/ear/HelloApplication.java     | 16 ++++++++++++++++
 .../arquillian/tests/jaxrs/ear/HelloEndpoint.java        | 16 ++++++++++++++++
 .../openejb/arquillian/tests/jaxrs/ear/HelloServlet.java | 16 ++++++++++++++++
 3 files changed, 48 insertions(+)

diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloApplication.java b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloApplication.java
index ac16adb..32ee89f 100644
--- a/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloApplication.java
+++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloApplication.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
 package org.apache.openejb.arquillian.tests.jaxrs.ear;
 
 import javax.ws.rs.ApplicationPath;
diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloEndpoint.java b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloEndpoint.java
index fea4246..5851cd8 100644
--- a/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloEndpoint.java
+++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloEndpoint.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
 package org.apache.openejb.arquillian.tests.jaxrs.ear;
 
 import javax.ejb.Lock;
diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloServlet.java b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloServlet.java
index 1740d61..85b7a07 100644
--- a/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloServlet.java
+++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloServlet.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
 package org.apache.openejb.arquillian.tests.jaxrs.ear;
 
 import javax.servlet.ServletException;


[tomee] 05/11: Merge branch 'TOMEE-2720' of github.com:Daniel-Dos/tomee

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 8d483e796ec83a37838cd5120a624a2b1233b5c2
Merge: a334af3 9061957
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Thu Nov 14 20:26:44 2019 +0000

    Merge branch 'TOMEE-2720' of github.com:Daniel-Dos/tomee

 examples/dynamic-datasource-routing/README_pt.adoc | 426 +++++++++++++++++++++
 1 file changed, 426 insertions(+)


[tomee] 10/11: Fix compile error

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit a1b6c4258d4833ae70e4e6f57140614878778954
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Thu Nov 14 21:20:08 2019 +0000

    Fix compile error
---
 .../org/superbiz/moviefun/rest/MoviesMPJWTConfigurationProvider.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/mp-rest-jwt/src/main/java/org/superbiz/moviefun/rest/MoviesMPJWTConfigurationProvider.java b/examples/mp-rest-jwt/src/main/java/org/superbiz/moviefun/rest/MoviesMPJWTConfigurationProvider.java
index afd3bd7..90de831 100644
--- a/examples/mp-rest-jwt/src/main/java/org/superbiz/moviefun/rest/MoviesMPJWTConfigurationProvider.java
+++ b/examples/mp-rest-jwt/src/main/java/org/superbiz/moviefun/rest/MoviesMPJWTConfigurationProvider.java
@@ -46,7 +46,7 @@ public class MoviesMPJWTConfigurationProvider {
         final KeyFactory kf = KeyFactory.getInstance("RSA");
         final RSAPublicKey pk = (RSAPublicKey) kf.generatePublic(spec);
 
-        return Optional.of(JWTAuthConfiguration.authConfiguration(pk, "https://server.example.com"));
+        return Optional.of(JWTAuthConfiguration.authConfiguration(pk, "https://server.example.com", false));
     }
 
     @Produces


[tomee] 02/11: TOMEE-2739 use webcontext and the path to evaluate which context to apply the filter to

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit a11829520f6c1798de3b1e6074a7369e8e9293d3
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Wed Nov 13 17:42:50 2019 +0000

    TOMEE-2739 use webcontext and the path to evaluate which context to apply the filter to
---
 .../arquillian/tests/jaxrs/ear/EarTest.java        | 70 ++++++++++++++++++++++
 .../tests/jaxrs/ear/HelloApplication.java          |  8 +++
 .../arquillian/tests/jaxrs/ear/HelloEndpoint.java  | 22 +++++++
 .../arquillian/tests/jaxrs/ear/HelloServlet.java   | 18 ++++++
 .../apache/tomee/webservices/TomcatRsRegistry.java | 27 ++++-----
 5 files changed, 131 insertions(+), 14 deletions(-)

diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/EarTest.java b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/EarTest.java
new file mode 100644
index 0000000..cb21aa5
--- /dev/null
+++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/EarTest.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.openejb.arquillian.tests.jaxrs.ear;
+
+import org.apache.ziplock.IO;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.descriptor.api.Descriptors;
+import org.jboss.shrinkwrap.descriptor.api.application6.ApplicationDescriptor;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.net.URL;
+
+/**
+ * @version $Rev$ $Date$
+ */
+@RunWith(Arquillian.class)
+public class EarTest {
+
+    @ArquillianResource
+    private URL url;
+
+    @Deployment(testable = false)
+    public static EnterpriseArchive createDeployment() {
+
+        final WebArchive servletWar = ShrinkWrap.create(WebArchive.class, "servlet.war").addClass(HelloServlet.class);
+        final WebArchive jaxRSWar = ShrinkWrap.create(WebArchive.class, "rest.war").addClasses(HelloApplication.class, HelloEndpoint.class);
+
+        final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "test.ear")
+                .addAsModule(servletWar)
+                .addAsModule(jaxRSWar);
+
+
+        final ApplicationDescriptor descriptor = Descriptors.create(ApplicationDescriptor.class);
+        descriptor.id("TestApplication").description("My Test Application")
+                .createModule().getOrCreateWeb().webUri("servlet.war").contextRoot("TestApplication").up().up()
+                .createModule().getOrCreateWeb().webUri("rest.war").contextRoot("TestApplication-REST").up().up();
+
+        ear.setApplicationXML(new StringAsset(descriptor.exportAsString()));
+
+        return ear;
+    }
+
+    @Test
+    public void test() throws Exception {
+        Assert.assertEquals("Hello rest!", IO.slurp(new URL(url, "/TestApplication-REST/api/")));
+        Assert.assertEquals("Hello servlets!", IO.slurp(new URL(url, "/TestApplication/")));
+    }
+}
diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloApplication.java b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloApplication.java
new file mode 100644
index 0000000..ac16adb
--- /dev/null
+++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloApplication.java
@@ -0,0 +1,8 @@
+package org.apache.openejb.arquillian.tests.jaxrs.ear;
+
+import javax.ws.rs.ApplicationPath;
+import javax.ws.rs.core.Application;
+
+@ApplicationPath("")
+public class HelloApplication extends Application {
+}
diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloEndpoint.java b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloEndpoint.java
new file mode 100644
index 0000000..fea4246
--- /dev/null
+++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloEndpoint.java
@@ -0,0 +1,22 @@
+package org.apache.openejb.arquillian.tests.jaxrs.ear;
+
+import javax.ejb.Lock;
+import javax.ejb.LockType;
+import javax.ejb.Singleton;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+@Singleton
+@Lock(LockType.READ)
+@Path("api")
+public class HelloEndpoint {
+
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public String greet() {
+        return "Hello rest!";
+    }
+
+}
diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloServlet.java b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloServlet.java
new file mode 100644
index 0000000..1740d61
--- /dev/null
+++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/ear/HelloServlet.java
@@ -0,0 +1,18 @@
+package org.apache.openejb.arquillian.tests.jaxrs.ear;
+
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+@WebServlet(urlPatterns = "/*")
+public class HelloServlet extends HttpServlet {
+
+    @Override
+    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+        resp.getWriter().print("Hello servlets!");
+        resp.getWriter().flush();
+    }
+}
diff --git a/tomee/tomee-jaxrs/src/main/java/org/apache/tomee/webservices/TomcatRsRegistry.java b/tomee/tomee-jaxrs/src/main/java/org/apache/tomee/webservices/TomcatRsRegistry.java
index 4203215..86d4bd1 100644
--- a/tomee/tomee-jaxrs/src/main/java/org/apache/tomee/webservices/TomcatRsRegistry.java
+++ b/tomee/tomee-jaxrs/src/main/java/org/apache/tomee/webservices/TomcatRsRegistry.java
@@ -82,7 +82,7 @@ public class TomcatRsRegistry implements RsRegistry {
 
         if (host == null) {
             for (final Host h : hosts) {
-                context = findContext(h, appId, webContext);
+                context = findContext(h, webContext);
                 if (context != null) {
                     host = h;
                     if (classLoader != null && classLoader.equals(context.getLoader().getClassLoader())) {
@@ -95,7 +95,7 @@ public class TomcatRsRegistry implements RsRegistry {
                 throw new IllegalArgumentException("Invalid virtual host '" + virtualHost + "'.  Do you have a matching Host entry in the server.xml?");
             }
         } else {
-            context = findContext(host, appId, webContext);
+            context = findContext(host, webContext);
         }
 
         if (context == null) {
@@ -155,21 +155,20 @@ public class TomcatRsRegistry implements RsRegistry {
         return completePath.substring((webContext.length() > 0 && !webContext.startsWith("/") ? 1 : 0) + webContext.length());
     }
 
-    private static Context findContext(final Container host, final String appId, final String webContext) {
-        if (appId != null) { // when using versioning appId is like context#1235 but not the context itself so ensure to test appId first
-            final Context ctx = Context.class.cast(host.findChild('/' + appId));
-            if (ctx != null) {
-                return ctx;
+    private static Context findContext(final Container host, final String webContext) {
+        final Container[] children = host.findChildren();
+
+        for (final Container child : children) {
+            if (! Context.class.isInstance(child)) continue;
+
+            final Context context = (Context) child;
+
+            if (context.getPath().equals(webContext)) {
+                return context;
             }
         }
 
-        Context webapp = Context.class.cast(host.findChild(webContext));
-        if (webapp == null && "/".equals(webContext)) { // ROOT
-            webapp = Context.class.cast(host.findChild(""));
-        } else if (webapp == null && webContext.length() > 0 && !webContext.startsWith("/")) {
-            webapp = Context.class.cast(host.findChild("/" + webContext));
-        }
-        return webapp;
+        return null;
     }
 
     private static String address(final Collection<Connector> connectors, final String host, final String path) {


[tomee] 04/11: Merge branch 'TOMEE-2708' of github.com:Daniel-Dos/tomee

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit a334af323aadbaaffde55a13f53f0841dc6ba2ad
Merge: 06dac01 df748ba
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Thu Nov 14 20:25:50 2019 +0000

    Merge branch 'TOMEE-2708' of github.com:Daniel-Dos/tomee

 examples/dynamic-dao-implementation/README.adoc    |  8 ++--
 .../{README.adoc => README_pt.adoc}                | 55 +++++++++++-----------
 2 files changed, 31 insertions(+), 32 deletions(-)


[tomee] 06/11: Merge branch 'master' of github.com:cassunde/tomee

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit dc416c1313ff6705a39ee5bab58d376d7e00d735
Merge: 8d483e7 931c1c7
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Thu Nov 14 20:27:53 2019 +0000

    Merge branch 'master' of github.com:cassunde/tomee

 examples/cdi-dynamic-inject/README.adoc            | 114 ++++++++++++++++++++
 examples/cdi-dynamic-inject/README_pt.adoc         | 115 +++++++++++++++++++++
 examples/cdi-dynamic-inject/pom.xml                |  89 ++++++++++++++++
 .../cdi/inject/dynamic/FinalizePayment.java        |  48 +++++++++
 .../cdi/inject/dynamic/PayByQualifier.java         |  34 ++++++
 .../main/java/org/superbiz/cdi/qualifier/Cash.java |  44 ++++++++
 .../org/superbiz/cdi/qualifier/CreditCard.java     |  44 ++++++++
 .../java/org/superbiz/cdi/qualifier/Payment.java   |  29 ++++++
 .../superbiz/cdi/qualifier/PaymentQualifier.java   |  46 +++++++++
 .../org/superbiz/cdi/qualifier/PaymentType.java    |  30 ++++++
 .../src/main/resources/META-INF/beans.xml          |  19 ++++
 .../dynamic/FinalizePaymentQualifierTest.java      |  65 ++++++++++++
 .../cdi/inject/dynamic/FinalizePaymentTest.java    |  64 ++++++++++++
 .../org/superbiz/cdi/qualifier/PaymentTest.java    |  67 ++++++++++++
 14 files changed, 808 insertions(+)


[tomee] 08/11: Merge branch 'TOMEE-2736' of github.com:rzo1/tomee

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit a4a89dd70aa60d93f137647bb5f2e7c8b1878b8e
Merge: e313484 522959c
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Thu Nov 14 20:29:00 2019 +0000

    Merge branch 'TOMEE-2736' of github.com:rzo1/tomee

 .../apache/openejb/maven/plugin/AbstractTomEEMojo.java   | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)


[tomee] 11/11: Checkstyle

Posted by jg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git

commit 4ec07effc3d93b33a8b62f7b783d9c888891e276
Author: Jonathan Gallimore <jo...@jrg.me.uk>
AuthorDate: Fri Nov 15 12:07:24 2019 +0000

    Checkstyle
---
 .../src/main/java/org/apache/tomee/webservices/TomcatRsRegistry.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tomee/tomee-jaxrs/src/main/java/org/apache/tomee/webservices/TomcatRsRegistry.java b/tomee/tomee-jaxrs/src/main/java/org/apache/tomee/webservices/TomcatRsRegistry.java
index 86d4bd1..92cd968 100644
--- a/tomee/tomee-jaxrs/src/main/java/org/apache/tomee/webservices/TomcatRsRegistry.java
+++ b/tomee/tomee-jaxrs/src/main/java/org/apache/tomee/webservices/TomcatRsRegistry.java
@@ -159,7 +159,9 @@ public class TomcatRsRegistry implements RsRegistry {
         final Container[] children = host.findChildren();
 
         for (final Container child : children) {
-            if (! Context.class.isInstance(child)) continue;
+            if (! Context.class.isInstance(child)) {
+                continue;
+            }
 
             final Context context = (Context) child;