Skip to content

Commit

Permalink
Update to Java 21 (#188)
Browse files Browse the repository at this point in the history
* Setting maven.compiler.release to 21

* Updating nexus staging maven plugin

* Updated source/Javadoc plugin
  • Loading branch information
Corby Page authored Jun 22, 2024
1 parent 8e2ba62 commit eebcfe8
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 25 deletions.
84 changes: 63 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@
<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">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>

<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
<version>1.5.2-SNAPSHOT</version>
<version>1.5.2</version>
<packaging>jar</packaging>

<name>JSONassert</name>
<description>A library to develop RESTful but flexible APIs</description>
<url>https://github.com/skyscreamer/JSONassert</url>

<properties>
<maven.compiler.release>21</maven.compiler.release>
</properties>

<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
Expand Down Expand Up @@ -60,32 +58,72 @@
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
<version>3.11.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.10.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
<source>8</source>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<reportPlugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
</plugin>
</reportPlugins>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
<dependencies>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.15</version> <!-- apparently this needs to be exactly this version -->
</dependency>
</dependencies>
</plugin>
</plugins>
<extensions>
Expand All @@ -112,6 +150,10 @@
<id>github-project-site</id>
<url>gitsite:[email protected]/skyscreamer/JSONassert.git</url>
</site>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>

<profiles>
Expand All @@ -128,7 +170,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
* <p>To simplify complexity of expected JSON string, the value <code>"{a:[[9]]}"</code> may be replaced by <code>"{a:[9]}"</code> or <code>"{a:9}"</code></p>
*
* @author Duncan Mackinder
*
* @param <T> Array Type
*/
public class ArrayValueMatcher<T> implements LocationAwareValueMatcher<T> {
private final JSONComparator comparator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
* <p>These different modes define different behavior for the comparison of JSON for testing.
* Each mode encapsulates two underlying behaviors: extensibility and strict ordering.</p>
*
* <table border="1" summary="Behavior of JSONCompareMode">
* <table border="1">
* <caption>
* Behavior of JSONCompareMode
* </caption>
* <tr><th>&nbsp;</th><th>Extensible</th><th>Strict Ordering</th></tr>
* <tr><th>STRICT</th><th>no</th><th>yes</th></tr>
* <tr><th>LENIENT</th><th>yes</th><th>no</th></tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* A ValueMatcher extension that provides location in form of prefix to the equals method.
*
* @author Duncan Mackinder
*
* @param <T> Generic Type
*/
public interface LocationAwareValueMatcher<T> extends ValueMatcher<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* specify regular expression pattern that actual value must match.
*
* @author Duncan Mackinder
*
* @param <T> Generic Type
*/
public class RegularExpressionValueMatcher<T> implements ValueMatcher<T> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@
/**
* This class provides a skeletal implementation of the {@link JSONComparator}
* interface, to minimize the effort required to implement this interface.
*
*
*/
public abstract class AbstractComparator implements JSONComparator {

/**
* Default constructor
*/
public AbstractComparator() {
}

/**
* Compares JSONObject provided to the expected JSONObject, and returns the results of the comparison.
*
Expand Down Expand Up @@ -57,6 +65,12 @@ public final JSONCompareResult compareJSON(JSONArray expected, JSONArray actual)
return result;
}

/**
* @param prefix
* @param expected
* @param actual
* @param result
*/
protected void checkJsonObjectKeysActualInExpected(String prefix, JSONObject expected, JSONObject actual, JSONCompareResult result) {
Set<String> actualKeys = getKeys(actual);
for (String key : actualKeys) {
Expand All @@ -66,6 +80,14 @@ protected void checkJsonObjectKeysActualInExpected(String prefix, JSONObject exp
}
}

/**
*
* @param prefix
* @param expected
* @param actual
* @param result
* @throws JSONException
*/
protected void checkJsonObjectKeysExpectedInActual(String prefix, JSONObject expected, JSONObject actual, JSONCompareResult result) throws JSONException {
Set<String> expectedKeys = getKeys(expected);
for (String key : expectedKeys) {
Expand Down

0 comments on commit eebcfe8

Please sign in to comment.