Skip to content

Commit 9050a4d

Browse files
committed
Move tck execution from separate modules to core/jsonb
1 parent f69449e commit 9050a4d

File tree

8 files changed

+243
-385
lines changed

8 files changed

+243
-385
lines changed

johnzon-core/pom.xml

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

36+
37+
<dependencies>
38+
<dependency>
39+
<groupId>jakarta.json</groupId>
40+
<artifactId>jakarta.json-tck-tests</artifactId>
41+
<version>2.1.1</version>
42+
<scope>test</scope>
43+
</dependency>
44+
<dependency>
45+
<groupId>jakarta.json</groupId>
46+
<artifactId>jakarta.json-tck-tests-pluggability</artifactId>
47+
<version>2.1.1</version>
48+
<scope>test</scope>
49+
</dependency>
50+
51+
<dependency>
52+
<groupId>org.netbeans.tools</groupId>
53+
<artifactId>sigtest-maven-plugin</artifactId>
54+
<version>1.7</version>
55+
<scope>test</scope>
56+
</dependency>
57+
</dependencies>
58+
3659
<build>
3760
<plugins>
3861
<plugin>
@@ -46,31 +69,100 @@
4669
</instructions>
4770
</configuration>
4871
</plugin>
72+
73+
<plugin>
74+
<groupId>org.apache.maven.plugins</groupId>
75+
<artifactId>maven-dependency-plugin</artifactId>
76+
77+
<executions>
78+
<execution>
79+
<id>copy</id>
80+
<phase>generate-test-resources</phase>
81+
<goals>
82+
<goal>copy</goal>
83+
</goals>
84+
85+
<configuration>
86+
<artifactItems>
87+
<artifactItem>
88+
<groupId>jakarta.json</groupId>
89+
<artifactId>jakarta.json-api</artifactId>
90+
<version>${jakarta-jsonp-api.version}</version>
91+
<type>jar</type>
92+
<overWrite>true</overWrite>
93+
<outputDirectory>${project.build.directory}/signaturedirectory</outputDirectory>
94+
<destFileName>jakarta.json-api.jar</destFileName>
95+
</artifactItem>
96+
</artifactItems>
97+
</configuration>
98+
</execution>
99+
</executions>
100+
</plugin>
101+
102+
<plugin>
103+
<groupId>org.apache.maven.plugins</groupId>
104+
<artifactId>maven-surefire-plugin</artifactId>
105+
<version>${surefire.plugin.version}</version>
106+
107+
<!-- Explicitly configure providers so we can mix JUnit 4 (johnzon) and JUnit 5 (TCK) tests -->
108+
<dependencies>
109+
<dependency>
110+
<groupId>org.apache.maven.surefire</groupId>
111+
<artifactId>surefire-junit4</artifactId>
112+
<version>${surefire.plugin.version}</version>
113+
</dependency>
114+
<dependency>
115+
<groupId>org.apache.maven.surefire</groupId>
116+
<artifactId>surefire-junit-platform</artifactId>
117+
<version>${surefire.plugin.version}</version>
118+
</dependency>
119+
</dependencies>
120+
121+
<executions>
122+
<execution>
123+
<id>tck-test</id>
124+
125+
<goals>
126+
<goal>test</goal>
127+
</goals>
128+
129+
<configuration>
130+
<dependenciesToScan>jakarta.json:jakarta.json-tck-tests</dependenciesToScan>
131+
132+
<!-- don't run johnzon tests multiple times, handled in default-test already -->
133+
<excludes>
134+
<exclude>**/org/apache/johnzon/**</exclude>
135+
</excludes>
136+
137+
<systemPropertyVariables>
138+
<jimage.dir>${project.build.directory}/jimage</jimage.dir>
139+
<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>
140+
</systemPropertyVariables>
141+
</configuration>
142+
</execution>
143+
144+
<execution>
145+
<id>tck-pluggability</id>
146+
147+
<goals>
148+
<goal>test</goal>
149+
</goals>
150+
151+
<configuration>
152+
<dependenciesToScan>jakarta.json:jakarta.json-tck-tests-pluggability</dependenciesToScan>
153+
154+
<!-- don't run johnzon tests multiple times, handled in default-test already -->
155+
<excludes>
156+
<exclude>**/org/apache/johnzon/**</exclude>
157+
</excludes>
158+
159+
<!-- pluggability tests come with their own JsonProvider implementation,
160+
so we have to hide the johnzon one for these to run -->
161+
<classesDirectory>${project.build.outputDirectory}/nowhere</classesDirectory>
162+
</configuration>
163+
</execution>
164+
</executions>
165+
</plugin>
49166
</plugins>
50167
</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-
-->
76168
</project>

johnzon-jsonb/pom.xml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,27 @@
107107
<groupId>org.apache.openwebbeans</groupId>
108108
<artifactId>openwebbeans-spi</artifactId>
109109
<version>${owb.version}</version>
110+
<scope>test</scope>
111+
</dependency>
112+
<dependency>
113+
<groupId>org.apache.openwebbeans</groupId>
114+
<artifactId>openwebbeans-se</artifactId>
115+
<version>${owb.version}</version>
116+
<scope>test</scope>
117+
</dependency>
118+
119+
<dependency>
120+
<groupId>jakarta.json.bind</groupId>
121+
<artifactId>jakarta.json.bind-tck</artifactId>
122+
<version>3.0.0</version>
123+
<scope>test</scope>
124+
125+
<exclusions>
126+
<exclusion>
127+
<groupId>org.junit.jupiter</groupId>
128+
<artifactId>*</artifactId>
129+
</exclusion>
130+
</exclusions>
110131
</dependency>
111132
</dependencies>
112133

@@ -136,6 +157,108 @@
136157
</instructions>
137158
</configuration>
138159
</plugin>
160+
161+
<plugin>
162+
<groupId>org.apache.maven.plugins</groupId>
163+
<artifactId>maven-dependency-plugin</artifactId>
164+
<version>3.2.0</version>
165+
<executions>
166+
<execution>
167+
<id>copy</id>
168+
<phase>generate-test-resources</phase>
169+
<goals>
170+
<goal>copy</goal>
171+
</goals>
172+
173+
<configuration>
174+
<artifactItems>
175+
<artifactItem>
176+
<groupId>jakarta.json</groupId>
177+
<artifactId>jakarta.json-api</artifactId>
178+
<version>${jakarta-jsonp-api.version}</version>
179+
<type>jar</type>
180+
<overWrite>true</overWrite>
181+
<outputDirectory>${project.build.directory}/signaturedirectory</outputDirectory>
182+
<destFileName>jakarta.json-api.jar</destFileName>
183+
</artifactItem>
184+
185+
<artifactItem>
186+
<groupId>jakarta.json.bind</groupId>
187+
<artifactId>jakarta.json.bind-api</artifactId>
188+
<version>${jakarta-jsonb-api.version}</version>
189+
<type>jar</type>
190+
<overWrite>true</overWrite>
191+
<outputDirectory>${project.build.directory}/signaturedirectory</outputDirectory>
192+
<destFileName>jakarta.json.bind-api.jar</destFileName>
193+
</artifactItem>
194+
</artifactItems>
195+
</configuration>
196+
</execution>
197+
</executions>
198+
</plugin>
199+
200+
<plugin>
201+
<groupId>org.apache.maven.plugins</groupId>
202+
<artifactId>maven-surefire-plugin</artifactId>
203+
<version>${surefire.plugin.version}</version>
204+
205+
<!-- Explicitly configure providers so we can mix JUnit 4 (johnzon) and JUnit 5 (TCK) tests -->
206+
<dependencies>
207+
<dependency>
208+
<groupId>org.apache.maven.surefire</groupId>
209+
<artifactId>surefire-junit4</artifactId>
210+
<version>${surefire.plugin.version}</version>
211+
</dependency>
212+
<dependency>
213+
<groupId>org.apache.maven.surefire</groupId>
214+
<artifactId>surefire-junit-platform</artifactId>
215+
<version>${surefire.plugin.version}</version>
216+
</dependency>
217+
218+
<dependency>
219+
<groupId>org.junit.jupiter</groupId>
220+
<artifactId>junit-jupiter-engine</artifactId>
221+
<version>5.7.2</version>
222+
</dependency>
223+
</dependencies>
224+
225+
<executions>
226+
<execution>
227+
<id>tck-test</id>
228+
229+
<goals>
230+
<goal>test</goal>
231+
</goals>
232+
233+
<configuration>
234+
<dependenciesToScan>jakarta.json.bind:jakarta.json.bind-tck</dependenciesToScan>
235+
236+
<excludes>
237+
<!-- don't run johnzon tests multiple times, handled in default-test already -->
238+
<exclude>**/org/apache/johnzon/**</exclude>
239+
240+
<!-- https://github.com/jakartaee/jsonb-api/issues/344 -->
241+
<exclude>**/SerializersCustomizationCDITest</exclude>
242+
243+
<!-- https://github.com/jakartaee/jsonb-api/issues/347 -->
244+
<exclude>**/AnnotationTypeInfoTest</exclude>
245+
</excludes>
246+
247+
<systemPropertyVariables>
248+
<jimage.dir>${project.build.directory}/jimage</jimage.dir>
249+
<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>
250+
251+
<!-- don't serialize BigDecimal/BigInteger as strings. Usually enabled by default in johnzon, see https://github.com/jakartaee/jsonb-api/issues/187 -->
252+
<johnzon.use-bigdecimal-stringadapter>false</johnzon.use-bigdecimal-stringadapter>
253+
<johnzon.use-biginteger-stringadapter>false</johnzon.use-biginteger-stringadapter>
254+
255+
<!-- needed to pass JSON-B 3 TCKs on jdk 13+, see https://github.com/jakartaee/jsonb-api/issues/272 -->
256+
<java.locale.providers>COMPAT</java.locale.providers>
257+
</systemPropertyVariables>
258+
</configuration>
259+
</execution>
260+
</executions>
261+
</plugin>
139262
</plugins>
140263
</build>
141264
</project>

pom.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<johnzon.site.url>https://svn.apache.org/repos/asf/johnzon/site/publish/</johnzon.site.url>
5050
<pubsub.url>scm:svn:${johnzon.site.url}</pubsub.url>
5151
<staging.directory>${project.build.directory}/site</staging.directory>
52+
<surefire.plugin.version>3.2.5</surefire.plugin.version>
5253
<felix.plugin.version>5.1.9</felix.plugin.version>
5354
<bnd.version.policy>[$(version;==;$(@)),$(version;+;$(@)))</bnd.version.policy>
5455
<bnd.version>6.1.0</bnd.version>
@@ -72,8 +73,6 @@
7273
<module>johnzon-jsonschema</module>
7374
<module>johnzon-osgi</module>
7475
<module>johnzon-jsonlogic</module>
75-
76-
<module>tck</module>
7776
</modules>
7877

7978
<dependencyManagement>
@@ -139,12 +138,12 @@
139138
<plugin>
140139
<groupId>org.apache.maven.plugins</groupId>
141140
<artifactId>maven-surefire-plugin</artifactId>
142-
<version>3.1.2</version>
141+
<version>${surefire.plugin.version}</version>
143142
</plugin>
144143
<plugin>
145144
<groupId>org.apache.maven.plugins</groupId>
146145
<artifactId>maven-surefire-report-plugin</artifactId>
147-
<version>3.1.2</version>
146+
<version>${surefire.plugin.version}</version>
148147
</plugin>
149148
<plugin>
150149
<groupId>org.apache.maven.plugins</groupId>

0 commit comments

Comments
 (0)