From 81080e83e2a5d36bf6c0c86e7494f8705605fd98 Mon Sep 17 00:00:00 2001 From: Jean-Louis Monteiro Date: Tue, 10 Jan 2023 12:38:51 +0100 Subject: [PATCH 1/5] TOMEE-4164 JSON-B TCK --- tck/jsonb-signature-test/pom.xml | 164 ++++++++++++++++++++++++++++++ tck/jsonb-standalone/pom.xml | 167 +++++++++++++++++++++++++++++++ tck/pom.xml | 2 + 3 files changed, 333 insertions(+) create mode 100644 tck/jsonb-signature-test/pom.xml create mode 100644 tck/jsonb-standalone/pom.xml diff --git a/tck/jsonb-signature-test/pom.xml b/tck/jsonb-signature-test/pom.xml new file mode 100644 index 00000000000..447cc11695c --- /dev/null +++ b/tck/jsonb-signature-test/pom.xml @@ -0,0 +1,164 @@ + + + + + tck + org.apache.tomee + 10.0.0-SNAPSHOT + + + 4.0.0 + jsonb-signature-test + TomEE :: TCK :: JSON-B Signature Tests + + + + org.apache.johnzon + johnzon-core + jakarta + + + org.apache.johnzon + * + + + org.apache.geronimo.specs + * + + + + + org.apache.johnzon + johnzon-mapper + jakarta + + + org.apache.johnzon + * + + + org.apache.geronimo.specs + * + + + + + org.apache.johnzon + johnzon-jsonb + jakarta + + + org.apache.johnzon + * + + + org.apache.geronimo.specs + * + + + + + + org.apache.tomee + jakartaee-api + + + + jakarta.json.bind + jakarta.json.bind-tck + 3.0.0 + test + + + + org.apache.openwebbeans + openwebbeans-se + 2.0.27 + jakarta + + + org.apache.openwebbeans + * + + + org.apache.geronimo.specs + * + + + + + org.apache.openwebbeans + openwebbeans-impl + 2.0.27 + jakarta + + + org.apache.openwebbeans + * + + + org.apache.geronimo.specs + * + + + + + org.apache.openwebbeans + openwebbeans-spi + 2.0.27 + jakarta + + + org.apache.openwebbeans + * + + + org.apache.geronimo.specs + * + + + + + + + + + src/test/resources + true + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + false + 1 + + jakarta.json.bind:jakarta.json.bind-tck + + + **/JSONBSigTest + + + + + + + \ No newline at end of file diff --git a/tck/jsonb-standalone/pom.xml b/tck/jsonb-standalone/pom.xml new file mode 100644 index 00000000000..418a7f4e5a4 --- /dev/null +++ b/tck/jsonb-standalone/pom.xml @@ -0,0 +1,167 @@ + + + + + tck + org.apache.tomee + 10.0.0-SNAPSHOT + + + 4.0.0 + jsonb-standalone + TomEE :: TCK :: JSON-B Standalone + + + + org.apache.johnzon + johnzon-core + jakarta + + + org.apache.johnzon + * + + + org.apache.geronimo.specs + * + + + + + org.apache.johnzon + johnzon-mapper + jakarta + + + org.apache.johnzon + * + + + org.apache.geronimo.specs + * + + + + + org.apache.johnzon + johnzon-jsonb + jakarta + + + org.apache.johnzon + * + + + org.apache.geronimo.specs + * + + + + + + org.apache.tomee + jakartaee-api + + + + jakarta.json.bind + jakarta.json.bind-tck + 3.0.0 + test + + + + org.apache.openwebbeans + openwebbeans-se + 2.0.27 + jakarta + + + org.apache.openwebbeans + * + + + org.apache.geronimo.specs + * + + + + + org.apache.openwebbeans + openwebbeans-impl + 2.0.27 + jakarta + + + org.apache.openwebbeans + * + + + org.apache.geronimo.specs + * + + + + + org.apache.openwebbeans + openwebbeans-spi + 2.0.27 + jakarta + + + org.apache.openwebbeans + * + + + org.apache.geronimo.specs + * + + + + + + + + + src/test/resources + true + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire.version} + + false + 1 + + jakarta.json.bind:jakarta.json.bind-tck + + + ee.jakarta.tck.json.bind.** + + + **/JSONBSigTest + + + + + + + \ No newline at end of file diff --git a/tck/pom.xml b/tck/pom.xml index 5b1c2fc3870..3bba6d45c31 100644 --- a/tck/pom.xml +++ b/tck/pom.xml @@ -41,6 +41,8 @@ bval-embedded bval-tomee bval-signature-test + jsonb-standalone + jsonb-signature-test microprofile-tck From b9becb288ef01c4b5346eeaa1c4124f4aaae0873 Mon Sep 17 00:00:00 2001 From: Richard Zowalla Date: Tue, 21 Nov 2023 11:15:31 +0100 Subject: [PATCH 2/5] Merge with latest changes from main --- tck/jsonb-signature-test/pom.xml | 77 +------------------------------ tck/jsonb-standalone/pom.xml | 78 +------------------------------- tck/pom.xml | 1 + 3 files changed, 5 insertions(+), 151 deletions(-) diff --git a/tck/jsonb-signature-test/pom.xml b/tck/jsonb-signature-test/pom.xml index 447cc11695c..6ec60a97a67 100644 --- a/tck/jsonb-signature-test/pom.xml +++ b/tck/jsonb-signature-test/pom.xml @@ -19,7 +19,7 @@ tck org.apache.tomee - 10.0.0-SNAPSHOT + 10.0.0-M1-SNAPSHOT 4.0.0 @@ -30,47 +30,14 @@ org.apache.johnzon johnzon-core - jakarta - - - org.apache.johnzon - * - - - org.apache.geronimo.specs - * - - org.apache.johnzon johnzon-mapper - jakarta - - - org.apache.johnzon - * - - - org.apache.geronimo.specs - * - - org.apache.johnzon johnzon-jsonb - jakarta - - - org.apache.johnzon - * - - - org.apache.geronimo.specs - * - - @@ -81,57 +48,17 @@ jakarta.json.bind jakarta.json.bind-tck - 3.0.0 + ${jsonb-tck.version} test - - org.apache.openwebbeans - openwebbeans-se - 2.0.27 - jakarta - - - org.apache.openwebbeans - * - - - org.apache.geronimo.specs - * - - - org.apache.openwebbeans openwebbeans-impl - 2.0.27 - jakarta - - - org.apache.openwebbeans - * - - - org.apache.geronimo.specs - * - - org.apache.openwebbeans openwebbeans-spi - 2.0.27 - jakarta - - - org.apache.openwebbeans - * - - - org.apache.geronimo.specs - * - - diff --git a/tck/jsonb-standalone/pom.xml b/tck/jsonb-standalone/pom.xml index 418a7f4e5a4..2a23e72589c 100644 --- a/tck/jsonb-standalone/pom.xml +++ b/tck/jsonb-standalone/pom.xml @@ -19,7 +19,7 @@ tck org.apache.tomee - 10.0.0-SNAPSHOT + 10.0.0-M1-SNAPSHOT 4.0.0 @@ -30,47 +30,14 @@ org.apache.johnzon johnzon-core - jakarta - - - org.apache.johnzon - * - - - org.apache.geronimo.specs - * - - org.apache.johnzon johnzon-mapper - jakarta - - - org.apache.johnzon - * - - - org.apache.geronimo.specs - * - - org.apache.johnzon johnzon-jsonb - jakarta - - - org.apache.johnzon - * - - - org.apache.geronimo.specs - * - - @@ -81,57 +48,16 @@ jakarta.json.bind jakarta.json.bind-tck - 3.0.0 + ${jsonb-tck.version} test - - - org.apache.openwebbeans - openwebbeans-se - 2.0.27 - jakarta - - - org.apache.openwebbeans - * - - - org.apache.geronimo.specs - * - - - org.apache.openwebbeans openwebbeans-impl - 2.0.27 - jakarta - - - org.apache.openwebbeans - * - - - org.apache.geronimo.specs - * - - org.apache.openwebbeans openwebbeans-spi - 2.0.27 - jakarta - - - org.apache.openwebbeans - * - - - org.apache.geronimo.specs - * - - diff --git a/tck/pom.xml b/tck/pom.xml index 4874f704b7e..c8d38e70e40 100644 --- a/tck/pom.xml +++ b/tck/pom.xml @@ -29,6 +29,7 @@ 4.0.11 3.0.1 + 3.0.0 org.apache.bval.jsr.ApacheValidationProvider From ec304f1af6d11d29e486cb291a5a424b13ba089a Mon Sep 17 00:00:00 2001 From: Richard Zowalla Date: Tue, 21 Nov 2023 11:31:45 +0100 Subject: [PATCH 3/5] Enhances config for JSONB tests --- tck/jsonb-signature-test/pom.xml | 17 +++++++++++++++++ tck/jsonb-standalone/pom.xml | 30 +++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/tck/jsonb-signature-test/pom.xml b/tck/jsonb-signature-test/pom.xml index 6ec60a97a67..935299a1c3d 100644 --- a/tck/jsonb-signature-test/pom.xml +++ b/tck/jsonb-signature-test/pom.xml @@ -52,6 +52,11 @@ test + + org.apache.openwebbeans + openwebbeans-se + ${version.openwebbeans} + org.apache.openwebbeans openwebbeans-impl @@ -60,6 +65,13 @@ org.apache.openwebbeans openwebbeans-spi + + + org.netbeans.tools + sigtest-maven-plugin + 1.6 + test + @@ -83,8 +95,13 @@ **/JSONBSigTest + + ${project.build.directory}/jimage + ${project.build.directory}/signaturedirectory/jakarta.json.bind-api.jar:${project.build.directory}/jimage/java.base:${project.build.directory}/jimage/java.rmi:${project.build.directory}/jimage/java.sql:${project.build.directory}/jimage/java.naming + + diff --git a/tck/jsonb-standalone/pom.xml b/tck/jsonb-standalone/pom.xml index 2a23e72589c..055d80f665c 100644 --- a/tck/jsonb-standalone/pom.xml +++ b/tck/jsonb-standalone/pom.xml @@ -51,6 +51,11 @@ ${jsonb-tck.version} test + + org.apache.openwebbeans + openwebbeans-se + ${version.openwebbeans} + org.apache.openwebbeans openwebbeans-impl @@ -69,6 +74,11 @@ + + org.apache.maven.plugins + maven-dependency-plugin + + org.apache.maven.plugins maven-surefire-plugin @@ -79,12 +89,26 @@ jakarta.json.bind:jakarta.json.bind-tck - - ee.jakarta.tck.json.bind.** - + + + **/SerializersCustomizationCDITest + + + **/AnnotationTypeInfoTest + **/JSONBSigTest + + + + false + false + + + COMPAT + + -Duser.language=en -Duser.region=US From c7859cce11aa855eb3606fb4dcf7ec211971149b Mon Sep 17 00:00:00 2001 From: Richard Zowalla Date: Tue, 21 Nov 2023 11:42:53 +0100 Subject: [PATCH 4/5] Fix signature tests --- tck/jsonb-signature-test/pom.xml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/tck/jsonb-signature-test/pom.xml b/tck/jsonb-signature-test/pom.xml index 935299a1c3d..e35d9d82627 100644 --- a/tck/jsonb-signature-test/pom.xml +++ b/tck/jsonb-signature-test/pom.xml @@ -82,6 +82,33 @@ + + org.apache.maven.plugins + maven-dependency-plugin + + + copy + generate-test-resources + + copy + + + + + + org.apache.tomee + jakartaee-api + ${version.jakartaee-api} + jar + true + ${project.build.directory}/signaturedirectory + jakartaee-api.jar + + + + + + org.apache.maven.plugins maven-surefire-plugin @@ -97,7 +124,7 @@ ${project.build.directory}/jimage - ${project.build.directory}/signaturedirectory/jakarta.json.bind-api.jar:${project.build.directory}/jimage/java.base:${project.build.directory}/jimage/java.rmi:${project.build.directory}/jimage/java.sql:${project.build.directory}/jimage/java.naming + ${project.build.directory}/signaturedirectory/jakartaee-api.jar:${project.build.directory}/jimage/java.base:${project.build.directory}/jimage/java.rmi:${project.build.directory}/jimage/java.sql:${project.build.directory}/jimage/java.naming From 7284bf5771580235c35ea863def84dc24fa84ac3 Mon Sep 17 00:00:00 2001 From: Richard Zowalla Date: Tue, 21 Nov 2023 12:35:42 +0100 Subject: [PATCH 5/5] Passes standalone jsonb standalone --- tck/jsonb-standalone/pom.xml | 4 +++ .../tomee/jsonb/tck/TomEEOwbCDIProvider.java | 34 +++++++++++++++++++ .../jakarta.enterprise.inject.spi.CDIProvider | 1 + 3 files changed, 39 insertions(+) create mode 100644 tck/jsonb-standalone/src/test/java/org/apache/tomee/jsonb/tck/TomEEOwbCDIProvider.java create mode 100644 tck/jsonb-standalone/src/test/resources/META-INF/services/jakarta.enterprise.inject.spi.CDIProvider diff --git a/tck/jsonb-standalone/pom.xml b/tck/jsonb-standalone/pom.xml index 055d80f665c..02380f1a1cb 100644 --- a/tck/jsonb-standalone/pom.xml +++ b/tck/jsonb-standalone/pom.xml @@ -64,6 +64,10 @@ org.apache.openwebbeans openwebbeans-spi + + org.apache.xbean + xbean-finder-shaded + diff --git a/tck/jsonb-standalone/src/test/java/org/apache/tomee/jsonb/tck/TomEEOwbCDIProvider.java b/tck/jsonb-standalone/src/test/java/org/apache/tomee/jsonb/tck/TomEEOwbCDIProvider.java new file mode 100644 index 00000000000..17c491c7cf0 --- /dev/null +++ b/tck/jsonb-standalone/src/test/java/org/apache/tomee/jsonb/tck/TomEEOwbCDIProvider.java @@ -0,0 +1,34 @@ +/* + * 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.tomee.jsonb.tck; + +import jakarta.enterprise.inject.spi.CDI; +import org.apache.webbeans.container.OwbCDIProvider; + +// CDI Integration TCKs rely on undefined CDI behaviour: they expect that calling CDI.current() throws an Exception when CDI is not started +// OWB doesn't do that, so we try to achieve this here as a workaround by calling CDI#getBeanManager before returning CDI +public class TomEEOwbCDIProvider extends OwbCDIProvider { + @Override + public CDI getCDI() { + CDI cdi = super.getCDI(); + cdi.getBeanManager(); + + return cdi; + } +} \ No newline at end of file diff --git a/tck/jsonb-standalone/src/test/resources/META-INF/services/jakarta.enterprise.inject.spi.CDIProvider b/tck/jsonb-standalone/src/test/resources/META-INF/services/jakarta.enterprise.inject.spi.CDIProvider new file mode 100644 index 00000000000..2e9b93bd152 --- /dev/null +++ b/tck/jsonb-standalone/src/test/resources/META-INF/services/jakarta.enterprise.inject.spi.CDIProvider @@ -0,0 +1 @@ +org.apache.tomee.jsonb.tck.TomEEOwbCDIProvider \ No newline at end of file