Skip to content

Commit

Permalink
Merge pull request #1004 from apache/TOMEE-4164_JSONB-TCK
Browse files Browse the repository at this point in the history
TOMEE-4164 JSON-B TCK Setup
  • Loading branch information
rzo1 authored Jan 19, 2024
2 parents d6ec33f + a2ca38f commit b846fdc
Show file tree
Hide file tree
Showing 5 changed files with 295 additions and 0 deletions.
135 changes: 135 additions & 0 deletions tck/jsonb-signature-test/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<?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/maven-v4_0_0.xsd">
<parent>
<artifactId>tck</artifactId>
<groupId>org.apache.tomee</groupId>
<version>10.0.0-M1-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>jsonb-signature-test</artifactId>
<name>TomEE :: TCK :: JSON-B Signature Tests</name>

<dependencies>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-mapper</artifactId>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-jsonb</artifactId>
</dependency>

<dependency>
<groupId>org.apache.tomee</groupId>
<artifactId>jakartaee-api</artifactId>
</dependency>

<dependency>
<groupId>jakarta.json.bind</groupId>
<artifactId>jakarta.json.bind-tck</artifactId>
<version>${jsonb-tck.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-se</artifactId>
<version>${version.openwebbeans}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-impl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-spi</artifactId>
</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>
<executions>
<execution>
<id>copy</id>
<phase>generate-test-resources</phase>
<goals>
<goal>copy</goal>
</goals>

<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.tomee</groupId>
<artifactId>jakartaee-api</artifactId>
<version>${version.jakartaee-api}</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/signaturedirectory</outputDirectory>
<destFileName>jakartaee-api.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</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>
<includes>
<include>**/JSONBSigTest</include>
</includes>
<systemProperties>
<jimage.dir>${project.build.directory}/jimage</jimage.dir>
<signature.sigTestClasspath>${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</signature.sigTestClasspath>
</systemProperties>
</configuration>
</plugin>

</plugins>
</build>

</project>
121 changes: 121 additions & 0 deletions tck/jsonb-standalone/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?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/maven-v4_0_0.xsd">
<parent>
<artifactId>tck</artifactId>
<groupId>org.apache.tomee</groupId>
<version>10.0.0-M1-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>jsonb-standalone</artifactId>
<name>TomEE :: TCK :: JSON-B Standalone</name>

<dependencies>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-mapper</artifactId>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-jsonb</artifactId>
</dependency>

<dependency>
<groupId>org.apache.tomee</groupId>
<artifactId>jakartaee-api</artifactId>
</dependency>

<dependency>
<groupId>jakarta.json.bind</groupId>
<artifactId>jakarta.json.bind-tck</artifactId>
<version>${jsonb-tck.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-se</artifactId>
<version>${version.openwebbeans}</version>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-impl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
<artifactId>openwebbeans-spi</artifactId>
</dependency>
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-finder-shaded</artifactId>
</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>
<dependenciesToScan>
<dependency>jakarta.json.bind:jakarta.json.bind-tck</dependency>
</dependenciesToScan>

<excludes>
<!-- https://github.com/jakartaee/jsonb-api/issues/344 -->
<exclude>**/SerializersCustomizationCDITest</exclude>

<!-- https://github.com/jakartaee/jsonb-api/issues/347 -->
<exclude>**/AnnotationTypeInfoTest</exclude>

<exclude>**/JSONBSigTest</exclude>
</excludes>

<systemProperties>
<!-- 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>
Original file line number Diff line number Diff line change
@@ -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<Object> getCDI() {
CDI<Object> cdi = super.getCDI();
cdi.getBeanManager();

return cdi;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.apache.tomee.jsonb.tck.TomEEOwbCDIProvider
4 changes: 4 additions & 0 deletions tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
<properties>
<cdi-tck.version>4.0.11</cdi-tck.version>
<bval-tck.version>3.0.1</bval-tck.version>
<jsonb-tck.version>3.0.0</jsonb-tck.version>

<jsonp-tck.version>2.1.1</jsonp-tck.version>
<validation.provider>org.apache.bval.jsr.ApacheValidationProvider</validation.provider>
</properties>
Expand All @@ -43,6 +45,8 @@
<module>bval-signature-test</module>
<module>jsonp-standalone</module>
<module>jsonp-signature-test</module>
<module>jsonb-standalone</module>
<module>jsonb-signature-test</module>
<module>microprofile-tck</module>
</modules>

Expand Down

0 comments on commit b846fdc

Please sign in to comment.