Skip to content

Commit 054786e

Browse files
authored
Merge pull request #889 from kaiyaok2/fix_nio_tests
Fixed non-idempotent unit tests in `JSONObjectTest`
2 parents 8983ca6 + b6e347d commit 054786e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/java/org/json/junit/JSONObjectTest.java

+9
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import org.json.junit.data.Singleton;
5757
import org.json.junit.data.SingletonEnum;
5858
import org.json.junit.data.WeirdList;
59+
import org.junit.After;
5960
import org.junit.Ignore;
6061
import org.junit.Test;
6162

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

79+
@After
80+
public void tearDown() {
81+
SingletonEnum.getInstance().setSomeInt(0);
82+
SingletonEnum.getInstance().setSomeString(null);
83+
Singleton.getInstance().setSomeInt(0);
84+
Singleton.getInstance().setSomeString(null);
85+
}
86+
7887
/**
7988
* Tests that the similar method is working as expected.
8089
*/

0 commit comments

Comments
 (0)