Skip to content

Commit 63450d7

Browse files
committed
TEST-16 Upgraded to Java 11, guava to 26.0-jre, spock to 1.2-groovy-2.5, groovy to 2.5.3-SNAPSHOT, mockito to 2.23.0, javassist to 3.23.1-GA.
Upgraded all plugins to their latest versions. Fixed issue in its classloader to make it work with Java 8 and Java 11.
1 parent 6769f03 commit 63450d7

File tree

6 files changed

+118
-45
lines changed

6 files changed

+118
-45
lines changed

failsafe-controller/pom.xml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
*
1313
**/
1414
-->
15-
<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">
15+
<project xmlns="http://maven.apache.org/POM/4.0.0"
16+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1618
<modelVersion>4.0.0</modelVersion>
1719
<parent>
1820
<groupId>org.codice.test</groupId>
@@ -48,6 +50,7 @@
4850
<dependency>
4951
<groupId>org.codehaus.groovy</groupId>
5052
<artifactId>groovy-all</artifactId>
53+
<type>pom</type>
5154
</dependency>
5255

5356
<dependency>
@@ -61,16 +64,4 @@
6164
<scope>test</scope>
6265
</dependency>
6366
</dependencies>
64-
65-
<build>
66-
<plugins>
67-
<plugin>
68-
<groupId>org.jacoco</groupId>
69-
<artifactId>jacoco-maven-plugin</artifactId>
70-
<configuration>
71-
<skip>true</skip>
72-
</configuration>
73-
</plugin>
74-
</plugins>
75-
</build>
7667
</project>

junit-extensions/pom.xml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@
5151
<type>pom</type>
5252
<scope>test</scope>
5353
</dependency>
54-
<dependency>
55-
<groupId>org.codehaus.groovy</groupId>
56-
<artifactId>groovy-all</artifactId>
57-
<scope>test</scope>
58-
</dependency>
5954
</dependencies>
6055

6156
<build>
@@ -78,17 +73,17 @@
7873
<limit implementation="org.codice.jacoco.LenientLimit">
7974
<counter>INSTRUCTION</counter>
8075
<value>COVEREDRATIO</value>
81-
<minimum>0.70</minimum>
76+
<minimum>0.74</minimum>
8277
</limit>
8378
<limit implementation="org.codice.jacoco.LenientLimit">
8479
<counter>BRANCH</counter>
8580
<value>COVEREDRATIO</value>
86-
<minimum>0.66</minimum>
81+
<minimum>0.64</minimum>
8782
</limit>
8883
<limit implementation="org.codice.jacoco.LenientLimit">
8984
<counter>COMPLEXITY</counter>
9085
<value>COVEREDRATIO</value>
91-
<minimum>0.54</minimum>
86+
<minimum>0.52</minimum>
9287
</limit>
9388
</limits>
9489
</rule>

junit-extensions/src/main/java/org/codice/junit/impl/DeFinalizeClassLoader.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
* loaded by the parent classloader.
4848
*/
4949
public class DeFinalizeClassLoader extends ClassLoader {
50+
private static final double VERSION =
51+
Double.parseDouble(System.getProperty("java.specification.version"));
5052

5153
private final ClassPool pool;
5254
private final Set<String> filters;
@@ -103,7 +105,7 @@ protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundE
103105

104106
if (clazz == null) {
105107
clazz = super.loadClass(name, resolve); // always load it from our parent first
106-
if (DeFinalizeClassLoader.isNotFromAReservedPackage(name)) {
108+
if (DeFinalizeClassLoader.isNotFromAReservedPackage(clazz, name)) {
107109
try {
108110
clazz = reloadClass(clazz, shouldDefinalize(name));
109111
} catch (NotFoundException e) {
@@ -170,18 +172,27 @@ private void definalizeMethod(CtMethod ctMethod) {
170172
}
171173
}
172174

175+
private static boolean isNotFromAReservedPackage(Class<?> clazz, String name) {
176+
// with post Java 8, classes loaded by the boot classloader (i.e. null) are reserved
177+
if ((DeFinalizeClassLoader.VERSION >= 9.0D) && (clazz.getClassLoader() == null)) {
178+
return false;
179+
}
180+
return DeFinalizeClassLoader.isNotFromAReservedPackage(name);
181+
}
182+
173183
private static boolean isNotFromAReservedPackage(String name) {
174184
return !name.startsWith("java.")
175185
&& !name.startsWith("javax.")
176186
&& !name.startsWith("sun.")
177187
&& !name.startsWith("org.xml.")
178-
&& !name.startsWith("org.junit.");
188+
&& !name.startsWith("org.junit.")
189+
&& !name.startsWith("jdk.");
179190
}
180191

181192
private static String checkDefinalizedClass(Class<?> clazz) {
182193
final String name = clazz.getName();
183194

184-
if (!DeFinalizeClassLoader.isNotFromAReservedPackage(name)) {
195+
if (!DeFinalizeClassLoader.isNotFromAReservedPackage(clazz, name)) {
185196
throw new IllegalArgumentException("unable to definalize class: " + name);
186197
}
187198
return name;

pom.xml

Lines changed: 87 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
*
1313
**/
1414
-->
15-
<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">
15+
<project xmlns="http://maven.apache.org/POM/4.0.0"
16+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1618
<modelVersion>4.0.0</modelVersion>
1719

1820
<groupId>org.codice.test</groupId>
@@ -36,31 +38,34 @@
3638
</licenses>
3739

3840
<properties>
41+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
42+
3943
<!-- default URL properties -->
4044
<codice.scm.connection.url />
4145
<snapshots.repository.url />
4246
<reports.repository.url />
4347

44-
<maven.compiler.source>1.8</maven.compiler.source>
45-
<maven.compiler.target>1.8</maven.compiler.target>
48+
<maven.compiler.source>11</maven.compiler.source>
49+
<maven.compiler.target>11</maven.compiler.target>
50+
<maven.compiler.release>11</maven.compiler.release>
4651

47-
<codice-maven.version>0.1</codice-maven.version>
52+
<codice-maven.version>0.2</codice-maven.version>
4853

4954
<commons-lang.version>2.6</commons-lang.version>
50-
<guava.version>23.0</guava.version>
55+
<guava.version>26.0-jre</guava.version>
5156
<jsr305.version>3.0.2_1</jsr305.version>
5257
<org.slf4j.version>1.7.1</org.slf4j.version>
5358
<jodah-failsafe.version>0.9.5</jodah-failsafe.version>
5459
<logback.version>1.2.3</logback.version>
5560
<logback.classic.version>1.2.3</logback.classic.version>
5661

5762
<junit.version>4.12</junit.version>
58-
<spock.version>1.1-groovy-2.4</spock.version>
59-
<groovy.version>2.4.7</groovy.version>
60-
<mockito-core.version>2.8.47</mockito-core.version>
63+
<spock.version>1.2-groovy-2.5</spock.version>
64+
<groovy.version>2.5.3-SNAPSHOT</groovy.version>
65+
<mockito-core.version>2.23.0</mockito-core.version>
6166
<hamcrest-all.version>1.3</hamcrest-all.version>
6267

63-
<javassist.version>3.22.0-GA</javassist.version>
68+
<javassist.version>3.23.1-GA</javassist.version>
6469

6570
<!-- Gitflow Incremental Builder Properties -->
6671
<gib.referenceBranch>refs/remotes/origin/master</gib.referenceBranch>
@@ -69,7 +74,8 @@
6974
<gib.failOnError>false</gib.failOnError>
7075

7176
<!-- Maven Plugin Version Properties -->
72-
<maven-jacoco-plugin.version>0.8.1</maven-jacoco-plugin.version>
77+
<maven-jacoco-plugin.version>0.8.2</maven-jacoco-plugin.version>
78+
<maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version>
7379
</properties>
7480

7581
<scm>
@@ -112,6 +118,14 @@
112118
<name>Codice Repository</name>
113119
<url>https://artifacts.codice.org/content/groups/public/</url>
114120
</repository>
121+
<repository>
122+
<!-- Temp repo to get Groovy snapshot - must set mirrors in settings.xml to "*,!oss-jfrog" -->
123+
<id>oss-jfrog</id>
124+
<url>https://oss.jfrog.org/artifactory/libs-snapshot/</url>
125+
<snapshots>
126+
<enabled>true</enabled>
127+
</snapshots>
128+
</repository>
115129
</repositories>
116130

117131
<pluginRepositories>
@@ -201,18 +215,55 @@
201215
</dependency>
202216
<dependency>
203217
<groupId>org.codehaus.groovy</groupId>
204-
<artifactId>groovy-all</artifactId>
218+
<artifactId>groovy-dateutil</artifactId>
205219
<version>${groovy.version}</version>
206220
</dependency>
207221
<dependency>
208222
<groupId>org.spockframework</groupId>
209223
<artifactId>spock-core</artifactId>
210224
<version>${spock.version}</version>
225+
<!-- Need to exclude groovy artifacts as spock is pulling in an older version -->
211226
<exclusions>
212227
<exclusion>
213228
<groupId>org.codehaus.groovy</groupId>
214229
<artifactId>groovy-all</artifactId>
215230
</exclusion>
231+
<exclusion>
232+
<groupId>org.codehaus.groovy</groupId>
233+
<artifactId>groovy</artifactId>
234+
</exclusion>
235+
<exclusion>
236+
<groupId>org.codehaus.groovy</groupId>
237+
<artifactId>groovy-groovysh</artifactId>
238+
</exclusion>
239+
<exclusion>
240+
<groupId>org.codehaus.groovy</groupId>
241+
<artifactId>groovy-json</artifactId>
242+
</exclusion>
243+
<exclusion>
244+
<groupId>org.codehaus.groovy</groupId>
245+
<artifactId>groovy-macro</artifactId>
246+
</exclusion>
247+
<exclusion>
248+
<groupId>org.codehaus.groovy</groupId>
249+
<artifactId>groovy-nio</artifactId>
250+
</exclusion>
251+
<exclusion>
252+
<groupId>org.codehaus.groovy</groupId>
253+
<artifactId>groovy-sql</artifactId>
254+
</exclusion>
255+
<exclusion>
256+
<groupId>org.codehaus.groovy</groupId>
257+
<artifactId>groovy-templates</artifactId>
258+
</exclusion>
259+
<exclusion>
260+
<groupId>org.codehaus.groovy</groupId>
261+
<artifactId>groovy-test</artifactId>
262+
</exclusion>
263+
<exclusion>
264+
<groupId>org.codehaus.groovy</groupId>
265+
<artifactId>groovy-xml</artifactId>
266+
</exclusion>
216267
</exclusions>
217268
</dependency>
218269
</dependencies>
@@ -229,15 +280,20 @@
229280

230281
<pluginManagement>
231282
<plugins>
283+
<plugin>
284+
<groupId>org.apache.maven.plugins</groupId>
285+
<artifactId>maven-compiler-plugin</artifactId>
286+
<version>3.8.0</version>
287+
</plugin>
232288
<plugin>
233289
<groupId>org.apache.maven.plugins</groupId>
234290
<artifactId>maven-jar-plugin</artifactId>
235-
<version>3.0.2</version>
291+
<version>3.1.0</version>
236292
</plugin>
237293
<plugin>
238294
<groupId>org.apache.maven.plugins</groupId>
239295
<artifactId>maven-assembly-plugin</artifactId>
240-
<version>2.2.2</version>
296+
<version>3.1.0</version>
241297
</plugin>
242298
<plugin>
243299
<groupId>org.jacoco</groupId>
@@ -262,14 +318,23 @@
262318
<plugin>
263319
<groupId>org.apache.maven.plugins</groupId>
264320
<artifactId>maven-surefire-plugin</artifactId>
265-
<version>2.20.1</version>
321+
<version>${maven-surefire-plugin.version}</version>
266322
<configuration>
267-
<argLine>${argLine} -Djava.awt.headless=true -noverify</argLine>
323+
<argLine>${argLine} -Djava.awt.headless=true -noverify
324+
</argLine>
268325
<includes>
269326
<include>**/*Test.java</include>
270327
<include>**/*Spec.class</include>
271328
</includes>
272329
</configuration>
330+
<dependencies>
331+
<!-- without this dependency, surefire uses testng instead -->
332+
<dependency>
333+
<groupId>org.apache.maven.surefire</groupId>
334+
<artifactId>surefire-junit47</artifactId>
335+
<version>${maven-surefire-plugin.version}</version>
336+
</dependency>
337+
</dependencies>
273338
</plugin>
274339
</plugins>
275340
</pluginManagement>
@@ -278,7 +343,7 @@
278343
<plugin>
279344
<groupId>com.coveo</groupId>
280345
<artifactId>fmt-maven-plugin</artifactId>
281-
<version>2.0.0</version>
346+
<version>2.5.1</version>
282347
<executions>
283348
<execution>
284349
<phase>validate</phase>
@@ -291,15 +356,19 @@
291356
<plugin>
292357
<groupId>org.codehaus.gmavenplus</groupId>
293358
<artifactId>gmavenplus-plugin</artifactId>
294-
<version>1.5</version>
359+
<version>1.6.1</version>
295360
<executions>
296361
<execution>
297362
<goals>
298363
<goal>compile</goal>
299-
<goal>testCompile</goal>
364+
<goal>compileTests</goal>
300365
</goals>
301366
</execution>
302367
</executions>
368+
<configuration>
369+
<!-- does not yet support 11 -->
370+
<targetBytecode>1.8</targetBytecode>
371+
</configuration>
303372
</plugin>
304373
<plugin>
305374
<groupId>org.jacoco</groupId>

spock-all/pom.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
<dependency>
3434
<groupId>org.ow2.asm</groupId>
3535
<artifactId>asm</artifactId>
36-
<version>5.0.4</version>
36+
<version>7.0-beta</version>
3737
</dependency>
3838
<dependency>
3939
<groupId>cglib</groupId>
4040
<artifactId>cglib-nodep</artifactId>
41-
<version>3.2.6</version>
41+
<version>3.2.8</version>
4242
</dependency>
4343
<dependency>
4444
<groupId>org.objenesis</groupId>
@@ -50,6 +50,10 @@
5050
<artifactId>groovy-all</artifactId>
5151
<type>pom</type>
5252
</dependency>
53+
<dependency>
54+
<groupId>org.codehaus.groovy</groupId>
55+
<artifactId>groovy-dateutil</artifactId>
56+
</dependency>
5357
<dependency>
5458
<groupId>org.spockframework</groupId>
5559
<artifactId>spock-core</artifactId>

spock-extensions/pom.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
*
1313
**/
1414
-->
15-
<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">
15+
<project xmlns="http://maven.apache.org/POM/4.0.0"
16+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1618
<modelVersion>4.0.0</modelVersion>
1719

1820
<parent>
@@ -29,6 +31,7 @@
2931
<dependency>
3032
<groupId>org.codehaus.groovy</groupId>
3133
<artifactId>groovy-all</artifactId>
34+
<type>pom</type>
3235
</dependency>
3336
<dependency>
3437
<groupId>org.spockframework</groupId>

0 commit comments

Comments
 (0)