You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jl...@apache.org on 2022/04/15 11:40:17 UTC
[tomee] 03/03: MicroProfile JWT extends base classes from TCK, add XML suites, and debugging file
This is an automated email from the ASF dual-hosted git repository.
jlmonteiro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git
commit b17fc4477d50a93da942b38b71fda3582ac004d5
Author: Jean-Louis Monteiro <jl...@tomitribe.com>
AuthorDate: Fri Apr 15 13:40:05 2022 +0200
MicroProfile JWT extends base classes from TCK, add XML suites, and debugging file
---
tck/microprofile-tck/jwt/pom.xml | 7 +-
.../jwt/MicroProfileJWTTCKArchiveProcessor.java | 4 +-
.../tck/jwt/MicroProfileJWTTCKExtension.java | 4 +-
tck/microprofile-tck/jwt/tck-base-suite.xml | 87 ++++++++++++++++
tck/microprofile-tck/jwt/tck-build-suite.xml | 35 +++++++
.../{src/test/resources/dev.xml => tck-dev.xml} | 7 +-
tck/microprofile-tck/jwt/tck-full-suite.xml | 109 +++++++++++++++++++++
7 files changed, 242 insertions(+), 11 deletions(-)
diff --git a/tck/microprofile-tck/jwt/pom.xml b/tck/microprofile-tck/jwt/pom.xml
index f29701c4ae..624d3cc646 100644
--- a/tck/microprofile-tck/jwt/pom.xml
+++ b/tck/microprofile-tck/jwt/pom.xml
@@ -147,6 +147,11 @@
<version>4.23</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>tomcat-catalina</artifactId>
+ <version>${tomcat.version}</version>
+ </dependency>
</dependencies>
<build>
@@ -181,7 +186,7 @@
<version>3.0.0-M6</version>
<configuration>
<suiteXmlFiles>
- <suiteXmlFile>${project.build.directory}/dependency/suites/tck-full-suite.xml</suiteXmlFile>
+ <suiteXmlFile>${project.build.directory}/dependency/suites/tck-base-suite.xml</suiteXmlFile>
</suiteXmlFiles>
<reuseForks>false</reuseForks>
<parallel>none</parallel>
diff --git a/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKArchiveProcessor.java b/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKArchiveProcessor.java
index 82f31b298a..d156a589c4 100644
--- a/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKArchiveProcessor.java
+++ b/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKArchiveProcessor.java
@@ -22,12 +22,12 @@ import org.apache.tomee.arquillian.remote.RemoteTomEEConfiguration;
import org.apache.tomee.arquillian.remote.RemoteTomEEContainer;
import org.apache.tomee.microprofile.tck.jwt.validation.ExpClaimAllowMissingExpValidationTest;
import org.apache.tomee.microprofile.tck.jwt.validation.ExpClaimValidationTest;
+import org.eclipse.microprofile.jwt.tck.arquillian.BaseWarArchiveProcessor;
import org.eclipse.microprofile.jwt.tck.config.*;
import org.eclipse.microprofile.jwt.tck.util.TokenUtils;
import org.jboss.arquillian.container.spi.Container;
import org.jboss.arquillian.container.spi.ContainerRegistry;
import org.jboss.arquillian.container.spi.client.deployment.TargetDescription;
-import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
import org.jboss.arquillian.core.api.Instance;
import org.jboss.arquillian.core.api.annotation.Inject;
import org.jboss.arquillian.test.spi.TestClass;
@@ -44,7 +44,7 @@ import java.util.Map;
import java.util.Properties;
import java.util.stream.Stream;
-public class MicroProfileJWTTCKArchiveProcessor implements ApplicationArchiveProcessor {
+public class MicroProfileJWTTCKArchiveProcessor extends BaseWarArchiveProcessor {
@Inject
private Instance<ContainerRegistry> containerRegistry;
diff --git a/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKExtension.java b/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKExtension.java
index 926b119e8f..5112e8623d 100644
--- a/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKExtension.java
+++ b/tck/microprofile-tck/jwt/src/test/java/org/apache/tomee/microprofile/tck/jwt/MicroProfileJWTTCKExtension.java
@@ -16,10 +16,10 @@
*/
package org.apache.tomee.microprofile.tck.jwt;
+import org.eclipse.microprofile.jwt.tck.arquillian.BaseExtension;
import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
-import org.jboss.arquillian.core.spi.LoadableExtension;
-public class MicroProfileJWTTCKExtension implements LoadableExtension {
+public class MicroProfileJWTTCKExtension extends BaseExtension {
@Override
public void register(final ExtensionBuilder extensionBuilder) {
extensionBuilder
diff --git a/tck/microprofile-tck/jwt/tck-base-suite.xml b/tck/microprofile-tck/jwt/tck-base-suite.xml
new file mode 100644
index 0000000000..5b621dc534
--- /dev/null
+++ b/tck/microprofile-tck/jwt/tck-base-suite.xml
@@ -0,0 +1,87 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+<!--
+ Licensed 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.
+-->
+<suite name="microprofile-jwt-auth-BaseTCK" verbose="1" preserve-order="true" configfailurepolicy="continue" >
+
+ <!-- The required base JAX-RS and CDI based tests that all MP-JWT implementations
+ must pass.
+ -->
+ <test name="base-tests" verbose="10">
+ <groups>
+ <define name="base-groups">
+ <include name="arquillian" description="Arquillian internal"/>
+ <include name="utils" description="Utility tests"/>
+ <include name="jwt" description="Base JsonWebToken tests"/>
+ <include name="jaxrs" description="JAX-RS invocation tests"/>
+ <include name="cdi" description="Base CDI injection of ClaimValues"/>
+ <include name="cdi-json" description="CDI injection of JSON-P values"/>
+ <include name="cdi-provider" description="CDI injection of javax.inject.Provider values"/>
+ <include name="config" description="Validate configuration using MP-config"/>
+ </define>
+ <define name="excludes">
+ <include name="utils-extra" description="Additional utility tests" />
+ </define>
+ <run>
+ <include name="base-groups" />
+ <exclude name="excludes" />
+ </run>
+ </groups>
+ <classes>
+ <class name="org.eclipse.microprofile.jwt.tck.util.TokenUtilsTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.util.TokenUtilsEncryptTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.util.TokenUtilsSignEncryptTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.util.TokenUtilsExtraTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.UnsecuredPingTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.RequiredClaimsTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.ClaimValueInjectionTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.JsonValueInjectionTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.ProviderInjectionTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.RolesAllowedTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.InvalidTokenTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.PrimitiveInjectionTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.PrincipalInjectionTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.AudValidationTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.AudArrayValidationTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.AudValidationBadAudTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.AudValidationMissingAudTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.ApplicationScopedInjectionTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.RsaKeySignatureTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsPEMTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsPEMLocationTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsPEMLocationURLTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsJWKTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsJWKLocationTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsJWKLocationURLTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsJWKSTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsJWKSLocationTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsBase64JWKTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsFileLocationURLTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.ECPublicKeyAsPEMTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.ECPublicKeyAsPEMLocationTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.ECPublicKeyAsJWKLocationTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.IssValidationTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.IssValidationFailTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.CookieTokenTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.TokenAsCookieIgnoredTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.TokenAsCookieTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.EmptyTokenTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.jwe.RolesAllowedSignEncryptTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.jwe.PrivateKeyAsPEMClasspathTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.jwe.PrivateKeyAsJWKClasspathTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.jwe.PrivateKeyAsJWKSClasspathTest" />
+ </classes>
+ </test>
+
+</suite>
diff --git a/tck/microprofile-tck/jwt/tck-build-suite.xml b/tck/microprofile-tck/jwt/tck-build-suite.xml
new file mode 100644
index 0000000000..62b175f084
--- /dev/null
+++ b/tck/microprofile-tck/jwt/tck-build-suite.xml
@@ -0,0 +1,35 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+<!--
+ Licensed 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.
+-->
+<suite name="microprofile-jwt-auth-BaseTCK" verbose="1" preserve-order="true" configfailurepolicy="continue" >
+
+ <!-- A test-suite.xml that only includes TokenUtils tests and is run during the TCK build.
+ -->
+ <test name="base-tests">
+ <groups>
+ <run>
+ <include name="utils" />
+ <include name="utils-extra" />
+ </run>
+ </groups>
+ <classes>
+ <class name="org.eclipse.microprofile.jwt.tck.util.TokenUtilsTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.util.TokenUtilsEncryptTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.util.TokenUtilsSignEncryptTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.util.TokenUtilsExtraTest" />
+ </classes>
+ </test>
+
+</suite>
diff --git a/tck/microprofile-tck/jwt/src/test/resources/dev.xml b/tck/microprofile-tck/jwt/tck-dev.xml
similarity index 89%
rename from tck/microprofile-tck/jwt/src/test/resources/dev.xml
rename to tck/microprofile-tck/jwt/tck-dev.xml
index 29aada423e..9cbd43ddd9 100644
--- a/tck/microprofile-tck/jwt/src/test/resources/dev.xml
+++ b/tck/microprofile-tck/jwt/tck-dev.xml
@@ -14,10 +14,6 @@
under the License.
-->
<suite name="microprofile-jwt-auth-BaseTCK" verbose="1" preserve-order="true" configfailurepolicy="continue" >
-
- <!-- The required base JAX-RS and CDI based tests that all MP-JWT implementations
- must pass.
- -->
<test name="base-tests" verbose="10">
<groups>
<define name="base-groups">
@@ -39,8 +35,7 @@
</run>
</groups>
<classes>
- <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsPEMLocationURLTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.AudValidationTest" />
</classes>
</test>
-
</suite>
diff --git a/tck/microprofile-tck/jwt/tck-full-suite.xml b/tck/microprofile-tck/jwt/tck-full-suite.xml
new file mode 100644
index 0000000000..c36cee2996
--- /dev/null
+++ b/tck/microprofile-tck/jwt/tck-full-suite.xml
@@ -0,0 +1,109 @@
+<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
+<!--
+ Licensed 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.
+-->
+<suite name="microprofile-jwt-auth-FullTCK" verbose="1" preserve-order="true" configfailurepolicy="continue" >
+
+ <!-- The required base JAX-RS and CDI based tests that all MP-JWT implementations
+ must pass.
+ -->
+ <test name="base-tests" verbose="10">
+ <groups>
+ <define name="base-groups">
+ <include name="arquillian" description="Arquillian internal"/>
+ <include name="utils" description="Utility tests"/>
+ <include name="jwt" description="Base JsonWebToken tests"/>
+ <include name="jaxrs" description="JAX-RS invocation tests"/>
+ <include name="cdi" description="Base CDI injection of ClaimValues"/>
+ <include name="cdi-json" description="CDI injection of JSON-P values"/>
+ <include name="cdi-provider" description="CDI injection of javax.inject.Provider values"/>
+ <include name="config" description="Validate configuration using MP-config"/>
+ </define>
+ <define name="excludes">
+ <include name="utils-extra" description="Additional utility tests" />
+ </define>
+ <run>
+ <include name="base-groups" />
+ <exclude name="excludes" />
+ </run>
+ </groups>
+ <classes>
+ <class name="org.eclipse.microprofile.jwt.tck.util.TokenUtilsTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.util.TokenUtilsEncryptTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.util.TokenUtilsSignEncryptTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.util.TokenUtilsExtraTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.UnsecuredPingTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.RequiredClaimsTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.ClaimValueInjectionTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.JsonValueInjectionTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.ProviderInjectionTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.RolesAllowedTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.InvalidTokenTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.PrimitiveInjectionTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.PrincipalInjectionTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.AudValidationTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.AudArrayValidationTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.AudValidationBadAudTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.AudValidationMissingAudTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.ApplicationScopedInjectionTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.RsaKeySignatureTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsPEMTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsPEMLocationTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsPEMLocationURLTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsJWKTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsJWKLocationTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsJWKLocationURLTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsJWKSTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsJWKSLocationTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsBase64JWKTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.PublicKeyAsFileLocationURLTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.ECPublicKeyAsPEMTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.ECPublicKeyAsPEMLocationTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.ECPublicKeyAsJWKLocationTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.IssValidationTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.IssValidationFailTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.CookieTokenTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.TokenAsCookieIgnoredTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.TokenAsCookieTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.EmptyTokenTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.jwe.RolesAllowedSignEncryptTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.jwe.PrivateKeyAsPEMClasspathTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.jwe.PrivateKeyAsJWKClasspathTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.config.jwe.PrivateKeyAsJWKSClasspathTest" />
+ </classes>
+ </test>
+ <test name="extended-tests" verbose="10">
+ <groups>
+ <define name="extended-groups">
+ <include name="ejb-optional" description="EJB container integration tests"/>
+ <include name="jacc-optional" description="JACC API integration tests"/>
+ <include name="servlet-optional" description="Servlet container integration tests"/>
+ <include name="ee-security-optional" description="Java EE security feature tests"/>
+ </define>
+ <define name="excludes">
+ <include name="utils-extra" description="Additional utility tests" />
+ </define>
+ <run>
+ <include name="extended-groups" />
+ <exclude name="excludes" />
+ </run>
+ </groups>
+ <classes>
+ <class name="org.eclipse.microprofile.jwt.tck.container.ejb.EjbTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.jacc.SubjectTest" />
+ <class name="org.eclipse.microprofile.jwt.tck.container.servlet.ServletTest" />
+ </classes>
+
+ </test>
+</suite>