Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
<!-- For JSONAssert -->
<dependencies>
<dependency>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
<version>0.0.20131108.vaadin1</version>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20230618</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down Expand Up @@ -87,6 +87,31 @@
</reportPlugins>
</configuration>
</plugin>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<version>1.0.0.Final</version>
<executions>
<execution>
<id>add-module-infos</id>
<phase>package</phase>
<goals>
<goal>add-module-info</goal>
</goals>
<configuration>
<jvmVersion>9</jvmVersion>
<module>
<moduleInfo>
<name>org.skyscreamer.jsonassert</name>
<exports>
org.skyscreamer.jsonassert*;
</exports>
</moduleInfo>
</module>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<extensions>
<extension>
Expand Down
36 changes: 0 additions & 36 deletions src/main/java/org/json/JSONString.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Utility class that contains Json manipulation methods.
*/
public final class JSONCompareUtil {
private static Integer INTEGER_ONE = new Integer(1);
private static final Integer INTEGER_ONE = 1;

private JSONCompareUtil() {
}
Expand Down Expand Up @@ -228,13 +228,13 @@ public static String formatUniqueKey(String key, String uniqueKey, Object value)
* @return the cardinality map
*/
public static <T> Map<T, Integer> getCardinalityMap(final Collection<T> coll) {
Map count = new HashMap<T, Integer>();
Map<T, Integer> count = new HashMap<T, Integer>();
for (T item : coll) {
Integer c = (Integer) (count.get(item));
Integer c = count.get(item);
if (c == null) {
count.put(item, INTEGER_ONE);
} else {
count.put(item, new Integer(c.intValue() + 1));
count.put(item, c + 1);
}
}
return count;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void testJSONArrayWithNullValueAndJsonObject() throws JSONException {
private JSONArray getJSONArray1() {
JSONArray jsonArray1 = new JSONArray();
jsonArray1.put(1);
jsonArray1.put(null);
jsonArray1.put((Object) null);
jsonArray1.put(3);
jsonArray1.put(2);
return jsonArray1;
Expand All @@ -41,7 +41,7 @@ private JSONArray getJSONArray1() {
private JSONArray getJSONArray2() {
JSONArray jsonArray1 = new JSONArray();
jsonArray1.put(1);
jsonArray1.put(null);
jsonArray1.put((Object) null);
jsonArray1.put(3);
jsonArray1.put(2);
return jsonArray1;
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/org/skyscreamer/jsonassert/JSONAssertTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -498,14 +498,14 @@ public void testAssertEqualsJSONObject2Boolean() throws JSONException {

@Test
public void testAssertEqualsString2JsonComparator() throws IllegalArgumentException, JSONException {
JSONAssert.assertEquals("Message", "{\"entry\":{\"id\":x}}", "{\"entry\":{\"id\":1, \"id\":2}}",
JSONAssert.assertEquals("Message", "{\"entry\":{\"id\":x}}", "{\"entry\":{\"id\":1}}",
new CustomComparator(
JSONCompareMode.STRICT,
new Customization("entry.id",
new RegularExpressionValueMatcher<Object>("\\d"))
));

performAssertEqualsTestForMessageVerification("{\"entry\":{\"id\":x}}", "{\"entry\":{\"id\":1, \"id\":as}}",
performAssertEqualsTestForMessageVerification("{\"entry\":{\"id\":x}}", "{\"entry\":{\"id\":as}}",
new CustomComparator(
JSONCompareMode.STRICT,
new Customization("entry.id",
Expand Down Expand Up @@ -626,14 +626,14 @@ public void testAssertNotEqualsJSONObject2Boolean() throws JSONException {

@Test
public void testAssertNotEqualsString2JsonComparator() throws IllegalArgumentException, JSONException {
JSONAssert.assertNotEquals("Message", "{\"entry\":{\"id\":x}}", "{\"entry\":{\"id\":1, \"id\":hh}}",
JSONAssert.assertNotEquals("Message", "{\"entry\":{\"id\":x}}", "{\"entry\":{\"id\":hh}}",
new CustomComparator(
JSONCompareMode.STRICT,
new Customization("entry.id",
new RegularExpressionValueMatcher<Object>("\\d"))
));

performAssertNotEqualsTestForMessageVerification("{\"entry\":{\"id\":x}}", "{\"entry\":{\"id\":1, \"id\":2}}",
performAssertNotEqualsTestForMessageVerification("{\"entry\":{\"id\":x}}", "{\"entry\":{\"id\":1}}",
new CustomComparator(
JSONCompareMode.STRICT,
new Customization("entry.id",
Expand Down