From e563dbcaaae945a163349ad7c14ed8b7f58c3d2c Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Mon, 29 May 2023 10:34:40 +0300 Subject: [PATCH 1/9] Setup java 8 as minimum version --- .github/workflows/pipeline.yml | 24 +++++++++++-------- pom.xml | 20 ++++++++-------- .../java/org/json/junit/JSONObjectTest.java | 6 ++--- 3 files changed, 27 insertions(+), 23 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 08352a085..f55506da4 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -11,19 +11,21 @@ on: jobs: # old-school build and jar method. No tests run or compiled. - build-1_6: + build-11: runs-on: ubuntu-latest strategy: matrix: - # build for java 1.6, however don't run any tests - java: [ 1.6 ] + # build for java 11, however don't run any tests + java: [ 11, 17, 19, 20 ] name: Java ${{ matrix.java }} steps: - - uses: actions/checkout@v2 - - name: Setup java - uses: actions/setup-java@v1 + - uses: actions/checkout@v3 + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v3 with: + distribution: 'temurin' java-version: ${{ matrix.java }} + cache: 'maven' - name: Compile Java ${{ matrix.java }} run: | mkdir -p target/classes @@ -42,14 +44,16 @@ jobs: strategy: matrix: # build against supported Java LTS versions: - java: [ 8, 11 ] + java: [ 11, 17 ] name: Java ${{ matrix.java }} steps: - - uses: actions/checkout@v2 - - name: Setup java - uses: actions/setup-java@v1 + - uses: actions/checkout@v3 + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v3 with: + distribution: 'temurin' java-version: ${{ matrix.java }} + cache: 'maven' - name: Compile Java ${{ matrix.java }} run: mvn clean compile -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.target=${{ matrix.java }} -Dmaven.test.skip=true -Dmaven.site.skip=true -Dmaven.javadoc.skip=true - name: Run Tests ${{ matrix.java }} diff --git a/pom.xml b/pom.xml index b9e0e608d..d6ed899c9 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ org.mockito mockito-core - 1.9.5 + 4.2.0 test @@ -79,7 +79,7 @@ org.apache.felix maven-bundle-plugin - 3.0.1 + 5.1.9 true @@ -93,16 +93,16 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.11.0 - 1.6 - 1.6 + 1.8 + 1.8 org.apache.maven.plugins maven-source-plugin - 2.1.2 + 3.3.0 attach-sources @@ -115,7 +115,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.7 + 3.5.0 attach-javadocs @@ -131,7 +131,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.5 + 1.6 sign-artifacts @@ -162,7 +162,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.3.0 @@ -173,4 +173,4 @@ - + \ No newline at end of file diff --git a/src/test/java/org/json/junit/JSONObjectTest.java b/src/test/java/org/json/junit/JSONObjectTest.java index e869a8d5c..3250c258a 100644 --- a/src/test/java/org/json/junit/JSONObjectTest.java +++ b/src/test/java/org/json/junit/JSONObjectTest.java @@ -626,9 +626,9 @@ public void jsonObjectByBean1() { assertTrue("expected 42", Integer.valueOf("42").equals(jsonObject.query("/intKey"))); assertTrue("expected -23.45e7", Double.valueOf("-23.45e7").equals(jsonObject.query("/doubleKey"))); // sorry, mockito artifact - assertTrue("expected 2 callbacks items", ((List)(JsonPath.read(doc, "$.callbacks"))).size() == 2); - assertTrue("expected 0 handler items", ((Map)(JsonPath.read(doc, "$.callbacks[0].handler"))).size() == 0); - assertTrue("expected 0 callbacks[1] items", ((Map)(JsonPath.read(doc, "$.callbacks[1]"))).size() == 0); + assertTrue("expected 2 mockitoInterceptor items", ((Map)(JsonPath.read(doc, "$.mockitoInterceptor"))).size() == 2); + assertTrue("expected 0 mockitoInterceptor.serializationSupport items", + ((Map)(JsonPath.read(doc, "$.mockitoInterceptor.serializationSupport"))).size() == 0); Util.checkJSONObjectMaps(jsonObject); } From bae0b0dac924ac446952fc7395158cc804fbd958 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Mon, 29 May 2023 11:01:16 +0300 Subject: [PATCH 2/9] Updated mockito --- src/test/java/org/json/junit/JSONObjectTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/java/org/json/junit/JSONObjectTest.java b/src/test/java/org/json/junit/JSONObjectTest.java index 3250c258a..a9935a608 100644 --- a/src/test/java/org/json/junit/JSONObjectTest.java +++ b/src/test/java/org/json/junit/JSONObjectTest.java @@ -625,10 +625,13 @@ public void jsonObjectByBean1() { assertTrue("expected h\be\tllo w\u1234orld!", "h\be\tllo w\u1234orld!".equals(jsonObject.query("/escapeStringKey"))); assertTrue("expected 42", Integer.valueOf("42").equals(jsonObject.query("/intKey"))); assertTrue("expected -23.45e7", Double.valueOf("-23.45e7").equals(jsonObject.query("/doubleKey"))); +<<<<<<< HEAD // sorry, mockito artifact assertTrue("expected 2 mockitoInterceptor items", ((Map)(JsonPath.read(doc, "$.mockitoInterceptor"))).size() == 2); assertTrue("expected 0 mockitoInterceptor.serializationSupport items", ((Map)(JsonPath.read(doc, "$.mockitoInterceptor.serializationSupport"))).size() == 0); +======= +>>>>>>> 88968f3 (Updated mockito) Util.checkJSONObjectMaps(jsonObject); } From 3dd8f2ecd5ac7700c6403b2fe57ae281b9c057b3 Mon Sep 17 00:00:00 2001 From: dburbrid Date: Mon, 26 Jun 2023 09:33:03 +0100 Subject: [PATCH 3/9] Correction of bug when compiling/testing on Windows: Issue537 file must be read as UTF-8 (Issue 745) --- src/test/java/org/json/junit/JSONObjectTest.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/test/java/org/json/junit/JSONObjectTest.java b/src/test/java/org/json/junit/JSONObjectTest.java index a9935a608..3250c258a 100644 --- a/src/test/java/org/json/junit/JSONObjectTest.java +++ b/src/test/java/org/json/junit/JSONObjectTest.java @@ -625,13 +625,10 @@ public void jsonObjectByBean1() { assertTrue("expected h\be\tllo w\u1234orld!", "h\be\tllo w\u1234orld!".equals(jsonObject.query("/escapeStringKey"))); assertTrue("expected 42", Integer.valueOf("42").equals(jsonObject.query("/intKey"))); assertTrue("expected -23.45e7", Double.valueOf("-23.45e7").equals(jsonObject.query("/doubleKey"))); -<<<<<<< HEAD // sorry, mockito artifact assertTrue("expected 2 mockitoInterceptor items", ((Map)(JsonPath.read(doc, "$.mockitoInterceptor"))).size() == 2); assertTrue("expected 0 mockitoInterceptor.serializationSupport items", ((Map)(JsonPath.read(doc, "$.mockitoInterceptor.serializationSupport"))).size() == 0); -======= ->>>>>>> 88968f3 (Updated mockito) Util.checkJSONObjectMaps(jsonObject); } From a4e152f4f0bc4daa52d5ae4e32c679bc8eaecd80 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Sun, 27 Aug 2023 15:42:27 +0300 Subject: [PATCH 4/9] Update pipeline.yml --- .github/workflows/pipeline.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index f55506da4..a8e7ad606 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -11,12 +11,12 @@ on: jobs: # old-school build and jar method. No tests run or compiled. - build-11: + build-8: runs-on: ubuntu-latest strategy: matrix: # build for java 11, however don't run any tests - java: [ 11, 17, 19, 20 ] + java: [ 8, 11, 17, 19, 20 ] name: Java ${{ matrix.java }} steps: - uses: actions/checkout@v3 @@ -44,7 +44,7 @@ jobs: strategy: matrix: # build against supported Java LTS versions: - java: [ 11, 17 ] + java: [ 8, 11, 17 ] name: Java ${{ matrix.java }} steps: - uses: actions/checkout@v3 From 48089a4da75bbca566ce1c33a9b6b218d11cd609 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Mon, 28 Aug 2023 02:21:18 +0300 Subject: [PATCH 5/9] Update pipeline.yml --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index a8e7ad606..5f7474ae9 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - # build for java 11, however don't run any tests + # build for java 8, however don't run any tests java: [ 8, 11, 17, 19, 20 ] name: Java ${{ matrix.java }} steps: From be33deb7d5d1276e5d428125df1b4cd7f78e04c6 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Mon, 28 Aug 2023 02:36:02 +0300 Subject: [PATCH 6/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e999230ba..0ecc12b73 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ JSON in Java [package org.json] [![Maven Central](https://img.shields.io/maven-central/v/org.json/json.svg)](https://mvnrepository.com/artifact/org.json/json) -**[Click here if you just want the latest release jar file.](https://search.maven.org/remotecontent?filepath=org/json/json/20230618/json-20230618.jar)** +**[Click here if you just want the latest release jar file.](https://search.maven.org/remotecontent?filepath=org/json/json/20230227/json-20230227.jar)** # Overview From 2c674be1b64971327451b5c1e9c06fcb83b3b5b6 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Mon, 28 Aug 2023 18:13:22 +0300 Subject: [PATCH 7/9] Update pipeline.yml --- .github/workflows/pipeline.yml | 29 ----------------------------- README.md | 2 +- pom.xml | 2 +- 3 files changed, 2 insertions(+), 31 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 5f7474ae9..5e1dd4251 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -10,35 +10,6 @@ on: branches: [ master ] jobs: - # old-school build and jar method. No tests run or compiled. - build-8: - runs-on: ubuntu-latest - strategy: - matrix: - # build for java 8, however don't run any tests - java: [ 8, 11, 17, 19, 20 ] - name: Java ${{ matrix.java }} - steps: - - uses: actions/checkout@v3 - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: ${{ matrix.java }} - cache: 'maven' - - name: Compile Java ${{ matrix.java }} - run: | - mkdir -p target/classes - javac -d target/classes/ src/main/java/org/json/*.java - - name: Create java ${{ matrix.java }} JAR - run: | - jar cvf target/org.json.jar -C target/classes . - - name: Upload Java ${{ matrix.java }} JAR - uses: actions/upload-artifact@v1 - with: - name: Java ${{ matrix.java }} JAR - path: target/org.json.jar - build: runs-on: ubuntu-latest strategy: diff --git a/README.md b/README.md index 0ecc12b73..e999230ba 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ JSON in Java [package org.json] [![Maven Central](https://img.shields.io/maven-central/v/org.json/json.svg)](https://mvnrepository.com/artifact/org.json/json) -**[Click here if you just want the latest release jar file.](https://search.maven.org/remotecontent?filepath=org/json/json/20230227/json-20230227.jar)** +**[Click here if you just want the latest release jar file.](https://search.maven.org/remotecontent?filepath=org/json/json/20230618/json-20230618.jar)** # Overview diff --git a/pom.xml b/pom.xml index d6ed899c9..e17f145ca 100644 --- a/pom.xml +++ b/pom.xml @@ -173,4 +173,4 @@ - \ No newline at end of file + From af6d07cecb95af5cd5ed09b24c48734e2b26ce28 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Tue, 29 Aug 2023 03:22:20 +0300 Subject: [PATCH 8/9] Resolved Gradle build dependency --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 63a31a73e..91503d09d 100644 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,7 @@ repositories { dependencies { testImplementation 'junit:junit:4.13.1' testImplementation 'com.jayway.jsonpath:json-path:2.1.0' - testImplementation 'org.mockito:mockito-core:1.9.5' + testImplementation 'org.mockito:mockito-core:4.2.0' } subprojects { From e27da22e05b795ada5dba698c2781f1d8027ba3b Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Tue, 29 Aug 2023 05:00:13 +0300 Subject: [PATCH 9/9] Update build.gradle --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 91503d09d..8a3708a74 100644 --- a/build.gradle +++ b/build.gradle @@ -30,9 +30,9 @@ subprojects { } group = 'org.json' -version = 'v20211205-SNAPSHOT' +version = 'v20230618-SNAPSHOT' description = 'JSON in Java' -sourceCompatibility = '1.7' +sourceCompatibility = '1.8' configurations.all { }