Skip to content

Commit

Permalink
Merge pull request #889 from kaiyaok2/fix_nio_tests
Browse files Browse the repository at this point in the history
Fixed non-idempotent unit tests in `JSONObjectTest`
  • Loading branch information
stleary committed May 3, 2024
2 parents 8983ca6 + b6e347d commit 054786e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/java/org/json/junit/JSONObjectTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
import org.json.junit.data.Singleton;
import org.json.junit.data.SingletonEnum;
import org.json.junit.data.WeirdList;
import org.junit.After;
import org.junit.Ignore;
import org.junit.Test;

Expand All @@ -75,6 +76,14 @@ public class JSONObjectTest {
*/
static final Pattern NUMBER_PATTERN = Pattern.compile("-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?");

@After
public void tearDown() {
SingletonEnum.getInstance().setSomeInt(0);
SingletonEnum.getInstance().setSomeString(null);
Singleton.getInstance().setSomeInt(0);
Singleton.getInstance().setSomeString(null);
}

/**
* Tests that the similar method is working as expected.
*/
Expand Down

0 comments on commit 054786e

Please sign in to comment.