Skip to content

Commit 684702c

Browse files
UrielChcaimoQIURC
authored
mutiple updates, new github workflow, more coverage.... (#280)
* improve testing * fix maven-resources-plugin version to 3.3.1 * patch on github ations * patch versions * fix version * rollback versions * downgrade * add condition for github workflows * patch action * test patch action * edd exta test in action * add jacoco * patch coverage * patch coverage * Support reading multiple JSON syntax blocks in a single input (#269) (#272) Co-authored-by: QIURC <[email protected]> * change year + offset some code + fix warning * fix warnings * fix warnings * add missing jsdoc * add missing jsdoc * spotless:apply * add tests * mvn spotless:apply * add tests * mvn spotless:apply * add tests * add publishing action * update changelog --------- Co-authored-by: Caimo <[email protected]> Co-authored-by: QIURC <[email protected]>
1 parent c7dfb8f commit 684702c

File tree

64 files changed

+2245
-97
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2245
-97
lines changed

.github/workflows/release-publish.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Release and Publish to Maven Central
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@v4
22+
with:
23+
java-version: '17'
24+
distribution: 'temurin'
25+
cache: 'maven'
26+
server-id: ossrh
27+
server-username: MAVEN_USERNAME
28+
server-password: MAVEN_PASSWORD
29+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
30+
gpg-passphrase: GPG_PASSPHRASE
31+
32+
- name: Import GPG key
33+
run: |
34+
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --dearmor > ~/.gnupg/secring.gpg
35+
gpg --import ~/.gnupg/secring.gpg
36+
37+
- name: Release accessors-smart
38+
run: |
39+
cd accessors-smart
40+
./mvnw clean deploy -P release-sign-artifacts
41+
env:
42+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
43+
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
44+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
45+
46+
- name: Release json-smart
47+
run: |
48+
cd json-smart
49+
./mvnw clean deploy -P release-sign-artifacts
50+
env:
51+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
52+
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
53+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
54+
55+
- name: Release json-smart-action
56+
run: |
57+
cd json-smart-action
58+
./mvnw clean deploy -P release-sign-artifacts
59+
env:
60+
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
61+
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
62+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ So I do not use my json-smart anymore. I had fun with this project. If you want
2525

2626
* JSONObject merge support overwrite as parameter. [PR 238](https://github.com/netplex/json-smart-v2/pull/238)
2727
* Add `JSONParser.ACCEPT_INCOMPLETE` to allow parsing partial and incomplete JSON without error [PR 254](https://github.com/netplex/json-smart-v2/pull/254)
28+
* Add multiple JSON syntax blocks in a single input [PR 272](https://github.com/netplex/json-smart-v2/pull/272)
2829

2930
### *V 2.5.2* (2025-02-12)
3031

accessors-smart/pom.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
Copyright 2011-2024 JSON-SMART authors
2+
Copyright 2011-2025 JSON-SMART authors
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -278,6 +278,16 @@ limitations under the License.
278278
</execution>
279279
</executions>
280280
</plugin>
281+
<plugin>
282+
<groupId>org.apache.maven.plugins</groupId>
283+
<artifactId>maven-install-plugin</artifactId>
284+
<version>3.1.4</version>
285+
</plugin>
286+
<plugin>
287+
<groupId>org.apache.maven.plugins</groupId>
288+
<artifactId>maven-deploy-plugin</artifactId>
289+
<version>3.1.4</version>
290+
</plugin>
281291
</plugins>
282292
</build>
283293
<dependencies>

accessors-smart/src/main/java/net/minidev/asm/ASMUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package net.minidev.asm;
22

33
/*
4-
* Copyright 2011-2024 JSON-SMART authors
4+
* Copyright 2011-2025 JSON-SMART authors
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

accessors-smart/src/main/java/net/minidev/asm/Accessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package net.minidev.asm;
22

33
/*
4-
* Copyright 2011-2024 JSON-SMART authors
4+
* Copyright 2011-2025 JSON-SMART authors
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

accessors-smart/src/main/java/net/minidev/asm/BeansAccess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package net.minidev.asm;
22

33
/*
4-
* Copyright 2011-2024 JSON-SMART authors
4+
* Copyright 2011-2025 JSON-SMART authors
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

accessors-smart/src/main/java/net/minidev/asm/DynamicClassLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package net.minidev.asm;
22

33
/*
4-
* Copyright 2011-2024 JSON-SMART authors
4+
* Copyright 2011-2025 JSON-SMART authors
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.

accessors-smart/src/test/java/net/minidev/asm/ASMTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ public void testGet() throws Exception {
114114
// T1 = System.currentTimeMillis() - T1;
115115
}
116116

117-
@Test
118117
private void subtext(BeansAccess<BTest> acc) {
119118
BTest t = new BTest();
120119
acc.set(t, "pubBoolValue", true);
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package net.minidev.asm.ex;
2+
3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
import static org.junit.jupiter.api.Assertions.assertNotNull;
5+
import static org.junit.jupiter.api.Assertions.assertNull;
6+
import static org.junit.jupiter.api.Assertions.assertTrue;
7+
8+
import org.junit.jupiter.api.Test;
9+
10+
public class ConvertExceptionTest {
11+
12+
@Test
13+
public void testDefaultConstructor() {
14+
ConvertException exception = new ConvertException();
15+
assertNotNull(exception);
16+
assertNull(exception.getMessage());
17+
assertTrue(exception instanceof RuntimeException);
18+
}
19+
20+
@Test
21+
public void testConstructorWithMessage() {
22+
String message = "Test conversion error";
23+
ConvertException exception = new ConvertException(message);
24+
assertNotNull(exception);
25+
assertEquals(message, exception.getMessage());
26+
assertTrue(exception instanceof RuntimeException);
27+
}
28+
29+
@Test
30+
public void testConstructorWithNullMessage() {
31+
ConvertException exception = new ConvertException(null);
32+
assertNotNull(exception);
33+
assertNull(exception.getMessage());
34+
}
35+
36+
@Test
37+
public void testConstructorWithEmptyMessage() {
38+
String message = "";
39+
ConvertException exception = new ConvertException(message);
40+
assertNotNull(exception);
41+
assertEquals(message, exception.getMessage());
42+
}
43+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package net.minidev.asm.ex;
2+
3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
import static org.junit.jupiter.api.Assertions.assertNotNull;
5+
import static org.junit.jupiter.api.Assertions.assertNull;
6+
import static org.junit.jupiter.api.Assertions.assertTrue;
7+
8+
import org.junit.jupiter.api.Test;
9+
10+
public class NoSuchFieldExceptionTest {
11+
12+
@Test
13+
public void testDefaultConstructor() {
14+
NoSuchFieldException exception = new NoSuchFieldException();
15+
assertNotNull(exception);
16+
assertNull(exception.getMessage());
17+
assertTrue(exception instanceof RuntimeException);
18+
}
19+
20+
@Test
21+
public void testConstructorWithMessage() {
22+
String message = "Test field not found error";
23+
NoSuchFieldException exception = new NoSuchFieldException(message);
24+
assertNotNull(exception);
25+
assertEquals(message, exception.getMessage());
26+
assertTrue(exception instanceof RuntimeException);
27+
}
28+
29+
@Test
30+
public void testConstructorWithNullMessage() {
31+
NoSuchFieldException exception = new NoSuchFieldException(null);
32+
assertNotNull(exception);
33+
assertNull(exception.getMessage());
34+
}
35+
36+
@Test
37+
public void testConstructorWithEmptyMessage() {
38+
String message = "";
39+
NoSuchFieldException exception = new NoSuchFieldException(message);
40+
assertNotNull(exception);
41+
assertEquals(message, exception.getMessage());
42+
}
43+
}

0 commit comments

Comments
 (0)