Skip to content

Commit d5665b9

Browse files
authored
Integrate TCK test execution in jsonb/core modules (#125)
* run TCK tests by default * Move tck execution from separate modules to core/jsonb * Attempt to fix build * Run tests with junit-vintage-engine * remove ManualTckTest * explicitly declare junit-vintage usage in each module
1 parent 5db4b28 commit d5665b9

File tree

18 files changed

+288
-465
lines changed

18 files changed

+288
-465
lines changed

johnzon-core/pom.xml

Lines changed: 116 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,42 @@
3333
<staging.directory>${project.parent.reporting.outputDirectory}</staging.directory>
3434
</properties>
3535

36+
37+
<dependencies>
38+
<dependency>
39+
<groupId>org.junit.vintage</groupId>
40+
<artifactId>junit-vintage-engine</artifactId>
41+
<scope>test</scope>
42+
</dependency>
43+
44+
<dependency>
45+
<groupId>jakarta.json</groupId>
46+
<artifactId>jakarta.json-tck-tests</artifactId>
47+
<version>2.1.1</version>
48+
<scope>test</scope>
49+
</dependency>
50+
<dependency>
51+
<groupId>jakarta.json</groupId>
52+
<artifactId>jakarta.json-tck-tests-pluggability</artifactId>
53+
<version>2.1.1</version>
54+
<scope>test</scope>
55+
</dependency>
56+
57+
<dependency>
58+
<groupId>org.netbeans.tools</groupId>
59+
<artifactId>sigtest-maven-plugin</artifactId>
60+
<version>1.7</version>
61+
<scope>test</scope>
62+
63+
<exclusions>
64+
<exclusion>
65+
<groupId>org.netbeans.tools</groupId>
66+
<artifactId>ct-sym</artifactId>
67+
</exclusion>
68+
</exclusions>
69+
</dependency>
70+
</dependencies>
71+
3672
<build>
3773
<plugins>
3874
<plugin>
@@ -46,31 +82,86 @@
4682
</instructions>
4783
</configuration>
4884
</plugin>
85+
86+
<plugin>
87+
<groupId>org.apache.maven.plugins</groupId>
88+
<artifactId>maven-dependency-plugin</artifactId>
89+
90+
<executions>
91+
<execution>
92+
<id>copy</id>
93+
<phase>generate-test-resources</phase>
94+
<goals>
95+
<goal>copy</goal>
96+
</goals>
97+
98+
<configuration>
99+
<artifactItems>
100+
<artifactItem>
101+
<groupId>jakarta.json</groupId>
102+
<artifactId>jakarta.json-api</artifactId>
103+
<version>${jakarta-jsonp-api.version}</version>
104+
<type>jar</type>
105+
<overWrite>true</overWrite>
106+
<outputDirectory>${project.build.directory}/signaturedirectory</outputDirectory>
107+
<destFileName>jakarta.json-api.jar</destFileName>
108+
</artifactItem>
109+
</artifactItems>
110+
</configuration>
111+
</execution>
112+
</executions>
113+
</plugin>
114+
115+
<plugin>
116+
<groupId>org.apache.maven.plugins</groupId>
117+
<artifactId>maven-surefire-plugin</artifactId>
118+
<version>${surefire.plugin.version}</version>
119+
120+
<executions>
121+
<execution>
122+
<id>tck-test</id>
123+
124+
<goals>
125+
<goal>test</goal>
126+
</goals>
127+
128+
<configuration>
129+
<dependenciesToScan>jakarta.json:jakarta.json-tck-tests</dependenciesToScan>
130+
131+
<!-- don't run johnzon tests multiple times, handled in default-test already -->
132+
<excludes>
133+
<exclude>**/org/apache/johnzon/**</exclude>
134+
</excludes>
135+
136+
<systemPropertyVariables>
137+
<jimage.dir>${project.build.directory}/jimage</jimage.dir>
138+
<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>
139+
</systemPropertyVariables>
140+
</configuration>
141+
</execution>
142+
143+
<execution>
144+
<id>tck-test-pluggability</id>
145+
146+
<goals>
147+
<goal>test</goal>
148+
</goals>
149+
150+
<configuration>
151+
<dependenciesToScan>jakarta.json:jakarta.json-tck-tests-pluggability</dependenciesToScan>
152+
153+
<!-- don't run johnzon tests multiple times, handled in default-test already -->
154+
<excludes>
155+
<exclude>**/org/apache/johnzon/**</exclude>
156+
</excludes>
157+
158+
<!-- pluggability tests come with their own JsonProvider implementation,
159+
so we have to hide the johnzon one for these to run -->
160+
<classesDirectory>${project.build.outputDirectory}/nowhere</classesDirectory>
161+
</configuration>
162+
</execution>
163+
</executions>
164+
</plugin>
49165
</plugins>
50166
</build>
51-
52-
<!-- avoid warnings at build time + this is not sufficient to run anyway (edit ts.jte)
53-
<profiles>
54-
<profile>
55-
<id>jakartaee-tck</id>
56-
57-
<dependencies>
58-
<dependency>
59-
<groupId>org.eclipse.jakartaee.tck.local</groupId>
60-
<artifactId>tsharness</artifactId>
61-
<version>8.0-SNAPSHOT</version>
62-
<scope>system</scope>
63-
<systemPath>/opt/eclipse/javaeetck/lib/tsharness.jar</systemPath>
64-
</dependency>
65-
<dependency>
66-
<groupId>org.eclipse.jakartaee.tck.local</groupId>
67-
<artifactId>sonparsertests_appclient_vehicle_client</artifactId>
68-
<version>8.0-SNAPSHOT</version>
69-
<scope>system</scope>
70-
<systemPath>/opt/eclipse/javaeetck/dist/com/sun/ts/tests/jsonp/api/jsonparsertests/jsonparsertests_appclient_vehicle_client.jar</systemPath>
71-
</dependency>
72-
</dependencies>
73-
</profile>
74-
</profiles>
75-
-->
76167
</project>

johnzon-core/src/test/java/org/apache/johnzon/core/ManualTckTest.java

Lines changed: 0 additions & 60 deletions
This file was deleted.

johnzon-jaxrs/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
<version>${project.version}</version>
4444
</dependency>
4545

46+
<dependency>
47+
<groupId>org.junit.vintage</groupId>
48+
<artifactId>junit-vintage-engine</artifactId>
49+
<scope>test</scope>
50+
</dependency>
4651
<dependency>
4752
<groupId>org.apache.cxf</groupId>
4853
<artifactId>cxf-rt-rs-client</artifactId>

johnzon-json-extras/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
</properties>
3535

3636
<dependencies>
37+
<dependency>
38+
<groupId>org.junit.vintage</groupId>
39+
<artifactId>junit-vintage-engine</artifactId>
40+
<scope>test</scope>
41+
</dependency>
42+
3743
<dependency>
3844
<groupId>jakarta.json.bind</groupId>
3945
<artifactId>jakarta.json.bind-api</artifactId>

johnzon-jsonb/pom.xml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@
6767
<version>${project.version}</version>
6868
</dependency>
6969

70+
<dependency>
71+
<groupId>org.junit.vintage</groupId>
72+
<artifactId>junit-vintage-engine</artifactId>
73+
<scope>test</scope>
74+
</dependency>
75+
7076
<dependency>
7177
<groupId>org.apache.cxf</groupId>
7278
<artifactId>cxf-rt-rs-client</artifactId>
@@ -107,6 +113,27 @@
107113
<groupId>org.apache.openwebbeans</groupId>
108114
<artifactId>openwebbeans-spi</artifactId>
109115
<version>${owb.version}</version>
116+
<scope>test</scope>
117+
</dependency>
118+
<dependency>
119+
<groupId>org.apache.openwebbeans</groupId>
120+
<artifactId>openwebbeans-se</artifactId>
121+
<version>${owb.version}</version>
122+
<scope>test</scope>
123+
</dependency>
124+
125+
<dependency>
126+
<groupId>jakarta.json.bind</groupId>
127+
<artifactId>jakarta.json.bind-tck</artifactId>
128+
<version>3.0.0</version>
129+
<scope>test</scope>
130+
131+
<exclusions>
132+
<exclusion>
133+
<groupId>org.netbeans.tools</groupId>
134+
<artifactId>ct-sym</artifactId>
135+
</exclusion>
136+
</exclusions>
110137
</dependency>
111138
</dependencies>
112139

@@ -136,6 +163,88 @@
136163
</instructions>
137164
</configuration>
138165
</plugin>
166+
167+
<plugin>
168+
<groupId>org.apache.maven.plugins</groupId>
169+
<artifactId>maven-dependency-plugin</artifactId>
170+
<version>3.2.0</version>
171+
<executions>
172+
<execution>
173+
<id>copy</id>
174+
<phase>generate-test-resources</phase>
175+
<goals>
176+
<goal>copy</goal>
177+
</goals>
178+
179+
<configuration>
180+
<artifactItems>
181+
<artifactItem>
182+
<groupId>jakarta.json</groupId>
183+
<artifactId>jakarta.json-api</artifactId>
184+
<version>${jakarta-jsonp-api.version}</version>
185+
<type>jar</type>
186+
<overWrite>true</overWrite>
187+
<outputDirectory>${project.build.directory}/signaturedirectory</outputDirectory>
188+
<destFileName>jakarta.json-api.jar</destFileName>
189+
</artifactItem>
190+
191+
<artifactItem>
192+
<groupId>jakarta.json.bind</groupId>
193+
<artifactId>jakarta.json.bind-api</artifactId>
194+
<version>${jakarta-jsonb-api.version}</version>
195+
<type>jar</type>
196+
<overWrite>true</overWrite>
197+
<outputDirectory>${project.build.directory}/signaturedirectory</outputDirectory>
198+
<destFileName>jakarta.json.bind-api.jar</destFileName>
199+
</artifactItem>
200+
</artifactItems>
201+
</configuration>
202+
</execution>
203+
</executions>
204+
</plugin>
205+
206+
<plugin>
207+
<groupId>org.apache.maven.plugins</groupId>
208+
<artifactId>maven-surefire-plugin</artifactId>
209+
<version>${surefire.plugin.version}</version>
210+
211+
<executions>
212+
<execution>
213+
<id>tck-test</id>
214+
215+
<goals>
216+
<goal>test</goal>
217+
</goals>
218+
219+
<configuration>
220+
<dependenciesToScan>jakarta.json.bind:jakarta.json.bind-tck</dependenciesToScan>
221+
222+
<excludes>
223+
<!-- don't run johnzon tests multiple times, handled in default-test already -->
224+
<exclude>**/org/apache/johnzon/**</exclude>
225+
226+
<!-- https://github.com/jakartaee/jsonb-api/issues/344 -->
227+
<exclude>**/SerializersCustomizationCDITest</exclude>
228+
229+
<!-- https://github.com/jakartaee/jsonb-api/issues/347 -->
230+
<exclude>**/AnnotationTypeInfoTest</exclude>
231+
</excludes>
232+
233+
<systemPropertyVariables>
234+
<jimage.dir>${project.build.directory}/jimage</jimage.dir>
235+
<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>
236+
237+
<!-- don't serialize BigDecimal/BigInteger as strings. Usually enabled by default in johnzon, see https://github.com/jakartaee/jsonb-api/issues/187 -->
238+
<johnzon.use-bigdecimal-stringadapter>false</johnzon.use-bigdecimal-stringadapter>
239+
<johnzon.use-biginteger-stringadapter>false</johnzon.use-biginteger-stringadapter>
240+
241+
<!-- needed to pass JSON-B 3 TCKs on jdk 13+, see https://github.com/jakartaee/jsonb-api/issues/272 -->
242+
<java.locale.providers>COMPAT</java.locale.providers>
243+
</systemPropertyVariables>
244+
</configuration>
245+
</execution>
246+
</executions>
247+
</plugin>
139248
</plugins>
140249
</build>
141250
</project>

johnzon-jsonlogic/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
<packaging>bundle</packaging>
3131

3232
<dependencies>
33+
<dependency>
34+
<groupId>org.junit.vintage</groupId>
35+
<artifactId>junit-vintage-engine</artifactId>
36+
<scope>test</scope>
37+
</dependency>
3338
<dependency>
3439
<groupId>org.apache.johnzon</groupId>
3540
<artifactId>johnzon-core</artifactId>

johnzon-jsonschema/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
<optional>true</optional>
4545
</dependency>
4646

47+
<dependency>
48+
<groupId>org.junit.vintage</groupId>
49+
<artifactId>junit-vintage-engine</artifactId>
50+
<scope>test</scope>
51+
</dependency>
4752
<dependency>
4853
<groupId>org.apache.johnzon</groupId>
4954
<artifactId>johnzon-core</artifactId>

0 commit comments

Comments
 (0)