Merge pull request #98 from apache/jakartaee-10-tck

WIP Jakarta EE 10 TCK setup
diff --git a/johnzon-jsonb/pom.xml b/johnzon-jsonb/pom.xml
index 5ad89d0..6416111 100644
--- a/johnzon-jsonb/pom.xml
+++ b/johnzon-jsonb/pom.xml
@@ -101,35 +101,12 @@
       <groupId>org.apache.openwebbeans</groupId>
       <artifactId>openwebbeans-impl</artifactId>
       <version>${owb.version}</version>
-      <classifier>jakarta</classifier>
       <scope>test</scope>
-      <exclusions>
-        <exclusion>
-          <groupId>org.apache.openwebbeans</groupId>
-          <artifactId>*</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.geronimo.specs</groupId>
-          <artifactId>*</artifactId>
-        </exclusion>
-      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.apache.openwebbeans</groupId>
       <artifactId>openwebbeans-spi</artifactId>
       <version>${owb.version}</version>
-      <classifier>jakarta</classifier>
-      <scope>test</scope>
-      <exclusions>
-        <exclusion>
-          <groupId>org.apache.openwebbeans</groupId>
-          <artifactId>*</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>org.apache.geronimo.specs</groupId>
-          <artifactId>*</artifactId>
-        </exclusion>
-      </exclusions>
     </dependency>
   </dependencies>
 
diff --git a/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/JohnzonBuilder.java b/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/JohnzonBuilder.java
index 9f364aa..6c8daa0 100644
--- a/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/JohnzonBuilder.java
+++ b/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/JohnzonBuilder.java
@@ -235,6 +235,16 @@
                         Integer.parseInt(it.toString()))
                 .ifPresent(builder::setSnippetMaxLength);
 
+        config.getProperty("johnzon.use-biginteger-stringadapter")
+                .or(() -> Optional.ofNullable(System.getProperty("johnzon.use-biginteger-stringadapter")))
+                .map(Object::toString).map(Boolean::parseBoolean)
+                .ifPresent(builder::setUseBigIntegerStringAdapter);
+
+        config.getProperty("johnzon.use-bigdecimal-stringadapter")
+                .or(() -> Optional.ofNullable(System.getProperty("johnzon.use-bigdecimal-stringadapter")))
+                .map(Object::toString).map(Boolean::parseBoolean)
+                .ifPresent(builder::setUseBigDecimalStringAdapter);
+
         // user adapters
         final Types types = new Types();
 
diff --git a/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/JsonbAccessMode.java b/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/JsonbAccessMode.java
index f6036c5..fb3f3fc 100644
--- a/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/JsonbAccessMode.java
+++ b/johnzon-jsonb/src/main/java/org/apache/johnzon/jsonb/JsonbAccessMode.java
@@ -607,8 +607,9 @@
 
             final WriterConverters writerConverters = new WriterConverters(annotations, types);
             final JsonbProperty property = annotations.getAnnotation(JsonbProperty.class);
-            final JsonbNillable nillable = annotations.getClassOrPackageAnnotation(JsonbNillable.class);
-            final boolean isNillable = isNillable(property, nillable);
+            final JsonbNillable propertyNillable = annotations.getAnnotation(JsonbNillable.class);
+            final JsonbNillable classOrPackageNillable = annotations.getClassOrPackageAnnotation(JsonbNillable.class);
+            final boolean isNillable = isNillable(property, propertyNillable, classOrPackageNillable);
             final String key = property == null || property.value().isEmpty() ? naming.translateName(entry.getKey()) : property.value();
             if (result.put(key, new Reader() {
                 @Override
@@ -725,8 +726,9 @@
 
             final ReaderConverters converters = new ReaderConverters(initialWriter);
             final JsonbProperty property = initialWriter.getAnnotation(JsonbProperty.class);
-            final JsonbNillable nillable = initialWriter.getClassOrPackageAnnotation(JsonbNillable.class);
-            final boolean isNillable = isNillable(property, nillable);
+            final JsonbNillable propertyNillable = initialWriter.getAnnotation(JsonbNillable.class);
+            final JsonbNillable classOrPackageNillable = initialWriter.getClassOrPackageAnnotation(JsonbNillable.class);
+            final boolean isNillable = isNillable(property, propertyNillable, classOrPackageNillable);
             final String key = property == null || property.value().isEmpty() ? naming.translateName(entry.getKey()) : property.value();
             if (result.put(key, new Writer() {
                 @Override
@@ -829,12 +831,14 @@
                 });
     }
 
-    private boolean isNillable(final JsonbProperty property, final JsonbNillable nillable) {
-        if (property != null) {
+    private boolean isNillable(final JsonbProperty property, final JsonbNillable propertyNillable, final JsonbNillable classOrPackageNillable) {
+        if (propertyNillable != null) {
+            return propertyNillable.value();
+        } else if (property != null) {
             return property.nillable();
         }
-        if (nillable != null) {
-            return nillable.value();
+        if (classOrPackageNillable != null) {
+            return classOrPackageNillable.value();
         }
         return globalIsNillable;
     }
diff --git a/johnzon-jsonb/src/test/java/org/apache/johnzon/jsonb/JsonbTypesTest.java b/johnzon-jsonb/src/test/java/org/apache/johnzon/jsonb/JsonbTypesTest.java
index 089f99b..2c5987b 100644
--- a/johnzon-jsonb/src/test/java/org/apache/johnzon/jsonb/JsonbTypesTest.java
+++ b/johnzon-jsonb/src/test/java/org/apache/johnzon/jsonb/JsonbTypesTest.java
@@ -21,6 +21,8 @@
 import static org.junit.Assert.assertEquals;
 
 import java.io.StringReader;
+import java.math.BigDecimal;
+import java.math.BigInteger;
 import java.net.URI;
 import java.net.URL;
 import java.time.Duration;
@@ -63,7 +65,8 @@
         final LocalDate localDate = LocalDate.of(2015, 1, 1);
         final LocalTime localTime = LocalTime.of(1, 2, 3);
         final LocalDateTime localDateTime = LocalDateTime.of(2015, 1, 1, 1, 1);
-        final String expected = "{\"calendar\":\"2015-01-01T01:01:00Z[UTC]\",\"date\":\"2015-01-01T01:01:00Z[UTC]\"," +
+        final String expected = "{\"bigDecimal\":\"1.5\",\"bigInteger\":\"1\"," +
+                "\"calendar\":\"2015-01-01T01:01:00Z[UTC]\",\"date\":\"2015-01-01T01:01:00Z[UTC]\"," +
                 "\"duration\":\"PT30S\",\"gregorianCalendar\":\"2015-01-01T01:01:00Z[UTC]\"," +
                 "\"instant\":\"2015-01-01T00:00:00Z\",\"localDate\":\"2015-01-01\"," +
                 "\"localDateTime\":\"2015-01-01T01:01\",\"localTime\":\"01:02:03\"," +
@@ -97,6 +100,25 @@
         assertEquals(TimeUnit.DAYS.toMillis(localDate.toEpochDay()), types.instant.toEpochMilli());
         assertEquals(Duration.of(30, ChronoUnit.SECONDS), types.duration);
         assertEquals(Period.of(0, 1, 10), types.period);
+        assertEquals(BigInteger.valueOf(1), types.bigInteger);
+        assertEquals(BigDecimal.valueOf(1.5), types.bigDecimal);
+
+        assertEquals(expected, jsonb.toJson(types));
+
+        jsonb.close();
+    }
+
+    @Test
+    public void testReadAndWriteBigIntDecimalAsNumbers() throws Exception {
+        final String expected = "{\"bigDecimal\":1.5,\"bigInteger\":1}";
+        final Jsonb jsonb = newJsonb(
+                new JsonbConfig()
+                        .setProperty("johnzon.use-biginteger-stringadapter", false)
+                        .setProperty("johnzon.use-bigdecimal-stringadapter", false));
+
+        final Types types = jsonb.fromJson(new StringReader(expected), Types.class);
+        assertEquals(BigInteger.valueOf(1), types.bigInteger);
+        assertEquals(BigDecimal.valueOf(1.5), types.bigDecimal);
 
         assertEquals(expected, jsonb.toJson(types));
 
@@ -134,7 +156,7 @@
     }
     
     private static Jsonb newJsonb() {
-        return newJsonb(null);
+        return newJsonb((String) null);
     }
     
     private static Jsonb newJsonb(String dateFormat) {
@@ -142,12 +164,17 @@
         if (!StringUtils.isEmpty(dateFormat)){
             jsonbConfig.withDateFormat(dateFormat, Locale.getDefault());
         }
-        return JsonbProvider.provider().create().withConfig(jsonbConfig.setProperty("johnzon.attributeOrder", new Comparator<String>() {
+
+        return newJsonb(jsonbConfig.setProperty("johnzon.attributeOrder", new Comparator<String>() {
             @Override
             public int compare(final String o1, final String o2) {
                 return o1.compareTo(o2);
             }
-        })).build();
+        }));
+    }
+
+    private static Jsonb newJsonb(JsonbConfig jsonbConfig) {
+        return JsonbProvider.provider().create().withConfig(jsonbConfig).build();
     }
 
     public static class Types {
@@ -172,6 +199,8 @@
         private LocalDate localDate;
         private OffsetDateTime offsetDateTime;
         private OffsetTime offsetTime;
+        private BigInteger bigInteger;
+        private BigDecimal bigDecimal;
 
         public LocalTime getLocalTime() {
             return localTime;
@@ -341,6 +370,22 @@
             this.offsetTime = offsetTime;
         }
 
+        public BigInteger getBigInteger() {
+            return bigInteger;
+        }
+
+        public void setBigInteger(BigInteger bigInteger) {
+            this.bigInteger = bigInteger;
+        }
+
+        public BigDecimal getBigDecimal() {
+            return bigDecimal;
+        }
+
+        public void setBigDecimal(BigDecimal bigDecimal) {
+            this.bigDecimal = bigDecimal;
+        }
+
         @Override
         public boolean equals(final Object o) {
             if (this == o) {
@@ -369,7 +414,9 @@
                 Objects.equals(localDateTime, types.localDateTime) &&
                 Objects.equals(localDate, types.localDate) &&
                 Objects.equals(offsetDateTime, types.offsetDateTime) &&
-                Objects.equals(offsetTime, types.offsetTime);
+                Objects.equals(offsetTime, types.offsetTime) &&
+                Objects.equals(bigInteger, types.bigInteger) &&
+                Objects.equals(bigDecimal, types.bigDecimal);
         }
 
         @Override
@@ -377,7 +424,7 @@
             return Objects.hash(
                 url, uri, optionalString, optionalInt, optionalLong, optionalDouble, date,
                 calendar, gregorianCalendar, timeZone, zoneId, zoneOffset, simpleTimeZone, instant, duration,
-                period, localDateTime, localDate, offsetDateTime, offsetTime);
+                period, localDateTime, localDate, offsetDateTime, offsetTime, bigInteger, bigDecimal);
         }
     }
 
diff --git a/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/MapperBuilder.java b/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/MapperBuilder.java
index 0c60436..9b08896 100644
--- a/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/MapperBuilder.java
+++ b/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/MapperBuilder.java
@@ -270,6 +270,16 @@
         return this;
     }
 
+    public MapperBuilder setUseBigIntegerStringAdapter(final boolean convertBigIntegerToString) {
+        adapters.setUseBigIntegerStringAdapter(convertBigIntegerToString);
+        return this;
+    }
+
+    public MapperBuilder setUseBigDecimalStringAdapter(final boolean convertBigDecimalToString) {
+        adapters.setUseBigDecimalStringAdapter(convertBigDecimalToString);
+        return this;
+    }
+
     public MapperBuilder setAdaptersDateTimeFormatterString(final String dateTimeFormatter) {
         adapters.setDateTimeFormatter(DateTimeFormatter.ofPattern(dateTimeFormatter));
         return this;
diff --git a/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/map/LazyConverterMap.java b/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/map/LazyConverterMap.java
index f1a4e42..2a6c0bc 100644
--- a/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/map/LazyConverterMap.java
+++ b/johnzon-mapper/src/main/java/org/apache/johnzon/mapper/map/LazyConverterMap.java
@@ -92,6 +92,8 @@
 
     private boolean useShortISO8601Format = true;
     private DateTimeFormatter dateTimeFormatter;
+    private boolean useBigIntegerStringAdapter = true;
+    private boolean useBigDecimalStringAdapter = true;
 
     public void setUseShortISO8601Format(final boolean useShortISO8601Format) {
         this.useShortISO8601Format = useShortISO8601Format;
@@ -101,6 +103,14 @@
         this.dateTimeFormatter = dateTimeFormatter;
     }
 
+    public void setUseBigDecimalStringAdapter(boolean useBigDecimalStringAdapter) {
+        this.useBigDecimalStringAdapter = useBigDecimalStringAdapter;
+    }
+
+    public void setUseBigIntegerStringAdapter(boolean useBigIntegerStringAdapter) {
+        this.useBigIntegerStringAdapter = useBigIntegerStringAdapter;
+    }
+
     @Override
     public Adapter<?, ?> get(final Object key) {
         final Adapter<?, ?> found = super.get(key);
@@ -133,13 +143,13 @@
 
     public Set<AdapterKey> adapterKeys() {
         return Stream.concat(
-                super.keySet().stream()
-                        .filter(it -> super.get(it) != NO_ADAPTER),
-                Stream.of(Date.class, URI.class, URL.class, Class.class, String.class, BigDecimal.class, BigInteger.class,
-                        Locale.class, Period.class, Duration.class, Calendar.class, GregorianCalendar.class, TimeZone.class,
-                        ZoneId.class, ZoneOffset.class, SimpleTimeZone.class, Instant.class, LocalDateTime.class, LocalDate.class,
-                        ZonedDateTime.class, OffsetDateTime.class, OffsetTime.class)
-                        .map(it -> new AdapterKey(it, String.class, true)))
+                        super.keySet().stream()
+                                .filter(it -> super.get(it) != NO_ADAPTER),
+                        Stream.of(Date.class, URI.class, URL.class, Class.class, String.class, BigDecimal.class, BigInteger.class,
+                                        Locale.class, Period.class, Duration.class, Calendar.class, GregorianCalendar.class, TimeZone.class,
+                                        ZoneId.class, ZoneOffset.class, SimpleTimeZone.class, Instant.class, LocalDateTime.class, LocalDate.class,
+                                        ZonedDateTime.class, OffsetDateTime.class, OffsetTime.class)
+                                .map(it -> new AdapterKey(it, String.class, true)))
                 .collect(toSet());
     }
 
@@ -160,10 +170,10 @@
         if (from == String.class) {
             return add(key, new ConverterAdapter<>(new StringConverter(), String.class));
         }
-        if (from == BigDecimal.class) {
+        if (from == BigDecimal.class && useBigIntegerStringAdapter) {
             return add(key, new ConverterAdapter<>(new BigDecimalConverter(), BigDecimal.class));
         }
-        if (from == BigInteger.class) {
+        if (from == BigInteger.class && useBigDecimalStringAdapter) {
             return add(key, new ConverterAdapter<>(new BigIntegerConverter(), BigInteger.class));
         }
         if (from == Locale.class) {
diff --git a/pom.xml b/pom.xml
index eaa8a78..6739533 100644
--- a/pom.xml
+++ b/pom.xml
@@ -52,7 +52,7 @@
     <checkstyle.version>3.0.0</checkstyle.version> <!-- Increasing checkstyle to 3.1 or above will require changes to the checkstyleRules -->
     <!-- JVM values for surefire plugin -->
     <surefire.jvm.params>-Xms1024m -Xmx2048m -Dfile.encoding=UTF-8</surefire.jvm.params>
-    <owb.version>2.0.27</owb.version>
+    <owb.version>4.0.0</owb.version>
     <arquillian.jvm.args />
   </properties>
 
@@ -68,6 +68,7 @@
     <module>johnzon-jsonschema</module>
     <module>johnzon-osgi</module>
     <module>johnzon-jsonlogic</module>
+    <module>tck</module>
   </modules>
 
   <dependencyManagement>
@@ -346,7 +347,7 @@
                   <property name="ignorePattern" value="@version|@see" />
                 </module>
                 <module name="MethodLength">
-                  <property name="max" value="255" />
+                  <property name="max" value="264" />
                 </module>
                 <module name="ParameterNumber">
                   <property name="max" value="13" />
diff --git a/tck/jsonb/pom.xml b/tck/jsonb/pom.xml
new file mode 100644
index 0000000..d12bbfd
--- /dev/null
+++ b/tck/jsonb/pom.xml
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <artifactId>tck</artifactId>
+    <groupId>org.apache.johnzon</groupId>
+    <version>2.0.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>jsonb</artifactId>
+  <name>Johnzon :: TCK :: JSON-B</name>
+  <packaging>jar</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>jakarta.json.bind</groupId>
+      <artifactId>jakarta.json.bind-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>jakarta.enterprise</groupId>
+      <artifactId>jakarta.enterprise.cdi-api</artifactId>
+      <version>4.0.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.johnzon</groupId>
+      <artifactId>johnzon-jsonb</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>jakarta.json.bind</groupId>
+      <artifactId>jakarta.json.bind-tck</artifactId>
+      <version>3.0.0</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.openwebbeans</groupId>
+      <artifactId>openwebbeans-se</artifactId>
+      <version>${owb.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.openwebbeans</groupId>
+      <artifactId>openwebbeans-impl</artifactId>
+      <version>${owb.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.openwebbeans</groupId>
+      <artifactId>openwebbeans-spi</artifactId>
+      <version>${owb.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.netbeans.tools</groupId>
+      <artifactId>sigtest-maven-plugin</artifactId>
+      <version>1.6</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>${surefire.version}</version>
+        <configuration>
+          <reuseForks>false</reuseForks>
+          <forkCount>1</forkCount>
+          <dependenciesToScan>
+            <dependency>jakarta.json.bind:jakarta.json.bind-tck</dependency>
+          </dependenciesToScan>
+
+          <systemProperties>
+            <jimage.dir>${project.build.directory}/jimage</jimage.dir>
+            <signature.sigTestClasspath>${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</signature.sigTestClasspath>
+
+            <!-- don't serialize BigDecimal/BigInteger as strings. Usually enabled by default in johnzon, see https://github.com/jakartaee/jsonb-api/issues/187 -->
+            <johnzon.use-bigdecimal-stringadapter>false</johnzon.use-bigdecimal-stringadapter>
+            <johnzon.use-biginteger-stringadapter>false</johnzon.use-biginteger-stringadapter>
+
+            <!-- needed to pass JSON-B 3 TCKs on jdk 13+, see https://github.com/jakartaee/jsonb-api/issues/272 -->
+            <java.locale.providers>COMPAT</java.locale.providers>
+          </systemProperties>
+          <argLine>-Duser.language=en -Duser.region=US</argLine>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/tck/jsonb/src/test/java/org/apache/johnzon/jsonb/tck/JohnzonOwbCDIProvider.java b/tck/jsonb/src/test/java/org/apache/johnzon/jsonb/tck/JohnzonOwbCDIProvider.java
new file mode 100644
index 0000000..ab8ef14
--- /dev/null
+++ b/tck/jsonb/src/test/java/org/apache/johnzon/jsonb/tck/JohnzonOwbCDIProvider.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.johnzon.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 JohnzonOwbCDIProvider extends OwbCDIProvider {
+    @Override
+    public CDI<Object> getCDI() {
+        CDI<Object> cdi = super.getCDI();
+        cdi.getBeanManager();
+
+        return cdi;
+    }
+}
diff --git a/tck/jsonb/src/test/resources/META-INF/services/jakarta.enterprise.inject.spi.CDIProvider b/tck/jsonb/src/test/resources/META-INF/services/jakarta.enterprise.inject.spi.CDIProvider
new file mode 100644
index 0000000..2c45b33
--- /dev/null
+++ b/tck/jsonb/src/test/resources/META-INF/services/jakarta.enterprise.inject.spi.CDIProvider
@@ -0,0 +1 @@
+org.apache.johnzon.jsonb.tck.JohnzonOwbCDIProvider
diff --git a/tck/jsonp/pom.xml b/tck/jsonp/pom.xml
new file mode 100644
index 0000000..8b5c048
--- /dev/null
+++ b/tck/jsonp/pom.xml
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <artifactId>tck</artifactId>
+    <groupId>org.apache.johnzon</groupId>
+    <version>2.0.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>jsonp</artifactId>
+  <name>Johnzon :: TCK :: JSON-P</name>
+  <packaging>jar</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>jakarta.json</groupId>
+      <artifactId>jakarta.json-api</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>jakarta.json</groupId>
+      <artifactId>jakarta.json-tck-tests</artifactId>
+      <version>2.1.1</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>jakarta.json</groupId>
+      <artifactId>jakarta.json-tck-tests-pluggability</artifactId>
+      <version>2.1.1</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.johnzon</groupId>
+      <artifactId>johnzon-core</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.apache.openwebbeans</groupId>
+      <artifactId>openwebbeans-se</artifactId>
+      <version>${owb.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.openwebbeans</groupId>
+      <artifactId>openwebbeans-impl</artifactId>
+      <version>${owb.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.openwebbeans</groupId>
+      <artifactId>openwebbeans-spi</artifactId>
+      <version>${owb.version}</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.netbeans.tools</groupId>
+      <artifactId>sigtest-maven-plugin</artifactId>
+      <version>1.6</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <testResources>
+      <testResource>
+        <directory>src/test/resources</directory>
+        <filtering>true</filtering>
+      </testResource>
+    </testResources>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>${surefire.version}</version>
+        <configuration>
+          <reuseForks>false</reuseForks>
+          <forkCount>1</forkCount>
+        </configuration>
+
+        <!-- Pluggability tests need to be run separately from normal TCKs as they bring their
+             own JsonProvider implementation which would break other TCK tests -->
+        <executions>
+          <execution>
+            <id>tck-pluggability</id>
+
+            <goals>
+              <goal>test</goal>
+            </goals>
+
+            <configuration>
+              <dependenciesToScan>jakarta.json:jakarta.json-tck-tests-pluggability</dependenciesToScan>
+
+              <classpathDependencyExcludes>
+                <classpathDependencyExclude>jakarta.json:jakarta.json-tck-tests</classpathDependencyExclude>
+              </classpathDependencyExcludes>
+            </configuration>
+          </execution>
+
+          <execution>
+            <id>tck</id>
+
+            <goals>
+              <goal>test</goal>
+            </goals>
+
+            <configuration>
+              <dependenciesToScan>jakarta.json:jakarta.json-tck-tests</dependenciesToScan>
+
+              <systemProperties>
+                <jimage.dir>${project.build.directory}/jimage</jimage.dir>
+                <signature.sigTestClasspath>${project.build.directory}/signaturedirectory/jakarta.json-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</signature.sigTestClasspath>
+              </systemProperties>
+
+              <classpathDependencyExcludes>
+                <classpathDependencyExclude>jakarta.json:jakarta.json-tck-tests-pluggability</classpathDependencyExclude>
+              </classpathDependencyExcludes>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+
+</project>
diff --git a/tck/pom.xml b/tck/pom.xml
new file mode 100644
index 0000000..01aff41
--- /dev/null
+++ b/tck/pom.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <artifactId>johnzon</artifactId>
+    <groupId>org.apache.johnzon</groupId>
+    <version>2.0.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+
+  <artifactId>tck</artifactId>
+  <name>Johnzon :: TCK</name>
+  <packaging>pom</packaging>
+
+  <modules>
+    <module>jsonb</module>
+    <module>jsonp</module>
+  </modules>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-dependency-plugin</artifactId>
+          <version>3.2.0</version>
+          <executions>
+            <execution>
+              <id>copy</id>
+              <phase>generate-test-resources</phase>
+              <goals>
+                <goal>copy</goal>
+              </goals>
+
+              <configuration>
+                <artifactItems>
+                  <artifactItem>
+                    <groupId>jakarta.json</groupId>
+                    <artifactId>jakarta.json-api</artifactId>
+                    <version>${jakarta-jsonp-api.version}</version>
+                    <type>jar</type>
+                    <overWrite>true</overWrite>
+                    <outputDirectory>${project.build.directory}/signaturedirectory</outputDirectory>
+                    <destFileName>jakarta.json-api.jar</destFileName>
+                  </artifactItem>
+
+                  <artifactItem>
+                    <groupId>jakarta.json.bind</groupId>
+                    <artifactId>jakarta.json.bind-api</artifactId>
+                    <version>${jakarta-jsonb-api.version}</version>
+                    <type>jar</type>
+                    <overWrite>true</overWrite>
+                    <outputDirectory>${project.build.directory}/signaturedirectory</outputDirectory>
+                    <destFileName>jakarta.json.bind-api.jar</destFileName>
+                  </artifactItem>
+                </artifactItems>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+
+</project>