Skip to content

Commit a3742ac

Browse files
author
John J. Aylward
committed
Fixes #821
add ignore annotation to tests that may fail due to differences in machine resources and can't be controlled via the tests
1 parent 783d298 commit a3742ac

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.json.JSONString;
3333
import org.json.JSONTokener;
3434
import org.json.junit.data.MyJsonString;
35+
import org.junit.Ignore;
3536
import org.junit.Test;
3637

3738
import com.jayway.jsonpath.Configuration;
@@ -1384,14 +1385,15 @@ public void jsonArrayClearMethodTest() {
13841385
/**
13851386
* Tests for stack overflow. See https://github.com/stleary/JSON-java/issues/654
13861387
*/
1388+
@Ignore("This test relies on system constraints and may not always pass. See: https://github.com/stleary/JSON-java/issues/821")
13871389
@Test(expected = JSONException.class)
13881390
public void issue654StackOverflowInputWellFormed() {
13891391
//String input = new String(java.util.Base64.getDecoder().decode(base64Bytes));
13901392
final InputStream resourceAsStream = JSONArrayTest.class.getClassLoader().getResourceAsStream("Issue654WellFormedArray.json");
13911393
JSONTokener tokener = new JSONTokener(resourceAsStream);
13921394
JSONArray json_input = new JSONArray(tokener);
13931395
assertNotNull(json_input);
1394-
fail("Excepected Exception.");
1396+
fail("Excepected Exception due to stack overflow.");
13951397
Util.checkJSONArrayMaps(json_input);
13961398
}
13971399

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import org.json.junit.data.Singleton;
5656
import org.json.junit.data.SingletonEnum;
5757
import org.json.junit.data.WeirdList;
58+
import org.junit.Ignore;
5859
import org.junit.Test;
5960

6061
import com.jayway.jsonpath.Configuration;
@@ -3665,14 +3666,15 @@ public void issue654IncorrectNestingNoKey2() {
36653666
/**
36663667
* Tests for stack overflow. See https://github.com/stleary/JSON-java/issues/654
36673668
*/
3669+
@Ignore("This test relies on system constraints and may not always pass. See: https://github.com/stleary/JSON-java/issues/821")
36683670
@Test(expected = JSONException.class)
36693671
public void issue654StackOverflowInputWellFormed() {
36703672
//String input = new String(java.util.Base64.getDecoder().decode(base64Bytes));
36713673
final InputStream resourceAsStream = JSONObjectTest.class.getClassLoader().getResourceAsStream("Issue654WellFormedObject.json");
36723674
JSONTokener tokener = new JSONTokener(resourceAsStream);
36733675
JSONObject json_input = new JSONObject(tokener);
36743676
assertNotNull(json_input);
3675-
fail("Excepected Exception.");
3677+
fail("Excepected Exception due to stack overflow.");
36763678
}
36773679

36783680
@Test

0 commit comments

Comments
 (0)