| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4000,19 +4000,24 @@ public void testStrictModeJSONTokener_expectException(){ | |||
| 4000 | 4000 | @Test | |
| 4001 | 4001 | public void test_strictModeWithMisCasedBooleanOrNullValue(){ | |
| 4002 | 4002 | JSONParserConfiguration jsonParserConfiguration = new JSONParserConfiguration().withStrictMode(); | |
| 4003 | - | ||
| 4004 | 4003 | try{ | |
| 4005 | - JSONObject j1 = new JSONObject("{\"a\":True}", jsonParserConfiguration); | ||
| 4004 | + new JSONObject("{\"a\":True}", jsonParserConfiguration); | ||
| 4006 | 4005 | fail("Expected an exception"); | |
| 4007 | - } catch (JSONException e) { } | ||
| 4006 | + } catch (JSONException e) { | ||
| 4007 | + // No action, expected outcome | ||
| 4008 | + } | ||
| 4008 | 4009 | try{ | |
| 4009 | - JSONObject j2 = new JSONObject("{\"a\":TRUE}", jsonParserConfiguration); | ||
| 4010 | + new JSONObject("{\"a\":TRUE}", jsonParserConfiguration); | ||
| 4010 | 4011 | fail("Expected an exception"); | |
| 4011 | - } catch (JSONException e) { } | ||
| 4012 | + } catch (JSONException e) { | ||
| 4013 | + // No action, expected outcome | ||
| 4014 | + } | ||
| 4012 | 4015 | try{ | |
| 4013 | - JSONObject j2 = new JSONObject("{\"a\":nUlL}", jsonParserConfiguration); | ||
| 4016 | + new JSONObject("{\"a\":nUlL}", jsonParserConfiguration); | ||
| 4014 | 4017 | fail("Expected an exception"); | |
| 4015 | - } catch (JSONException e) { } | ||
| 4018 | + } catch (JSONException e) { | ||
| 4019 | + // No action, expected outcome | ||
| 4020 | + } | ||
| 4016 | 4021 | } | |
| 4017 | 4022 | ||
| 4018 | 4023 | @Test | |
@@ -4021,17 +4026,23 @@ public void test_strictModeWithInappropriateKey(){ | |||
| 4021 | 4026 | ||
| 4022 | 4027 | // Parsing the following objects should fail | |
| 4023 | 4028 | try{ | |
| 4024 | - JSONObject j3 = new JSONObject("{true : 3}", jsonParserConfiguration); | ||
| 4029 | + new JSONObject("{true : 3}", jsonParserConfiguration); | ||
| 4025 | 4030 | fail("Expected an exception"); | |
| 4026 | - } catch (JSONException e) { } | ||
| 4031 | + } catch (JSONException e) { | ||
| 4032 | + // No action, expected outcome | ||
| 4033 | + } | ||
| 4027 | 4034 | try{ | |
| 4028 | - JSONObject j4 = new JSONObject("{TRUE : 3}", jsonParserConfiguration); | ||
| 4035 | + new JSONObject("{TRUE : 3}", jsonParserConfiguration); | ||
| 4029 | 4036 | fail("Expected an exception"); | |
| 4030 | - } catch (JSONException e) { } | ||
| 4037 | + } catch (JSONException e) { | ||
| 4038 | + // No action, expected outcome | ||
| 4039 | + } | ||
| 4031 | 4040 | try{ | |
| 4032 | - JSONObject j5 = new JSONObject("{1 : 3}", jsonParserConfiguration); | ||
| 4041 | + new JSONObject("{1 : 3}", jsonParserConfiguration); | ||
| 4033 | 4042 | fail("Expected an exception"); | |
| 4034 | - } catch (JSONException e) { } | ||
| 4043 | + } catch (JSONException e) { | ||
| 4044 | + // No action, expected outcome | ||
| 4045 | + } | ||
| 4035 | 4046 | ||
| 4036 | 4047 | } | |
| 4037 | 4048 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments