@@ -1013,128 +1013,128 @@ public void jsonObjectNonAndWrongValues() {
10131013 jsonObject .getBoolean ("nonKey" );
10141014 fail ("Expected an exception" );
10151015 } catch (JSONException e ) {
1016- assertTrue ("expecting an exception message" ,
1017- "JSONObject[\" nonKey\" ] not found." . equals ( e .getMessage () ));
1016+ assertEquals ("expecting an exception message" ,
1017+ "JSONObject[\" nonKey\" ] not found." , e .getMessage ());
10181018 }
10191019 try {
10201020 jsonObject .getBoolean ("stringKey" );
10211021 fail ("Expected an exception" );
10221022 } catch (JSONException e ) {
1023- assertTrue ("Expecting an exception message" ,
1024- "JSONObject[\" stringKey\" ] is not a Boolean." .
1025- equals ( e .getMessage () ));
1023+ assertEquals ("Expecting an exception message" ,
1024+ "JSONObject[\" stringKey\" ] is not a Boolean." ,
1025+ e .getMessage ());
10261026 }
10271027 try {
10281028 jsonObject .getString ("nonKey" );
10291029 fail ("Expected an exception" );
10301030 } catch (JSONException e ) {
1031- assertTrue ("Expecting an exception message" ,
1032- "JSONObject[\" nonKey\" ] not found." .
1033- equals ( e .getMessage () ));
1031+ assertEquals ("Expecting an exception message" ,
1032+ "JSONObject[\" nonKey\" ] not found." ,
1033+ e .getMessage ());
10341034 }
10351035 try {
10361036 jsonObject .getString ("trueKey" );
10371037 fail ("Expected an exception" );
10381038 } catch (JSONException e ) {
1039- assertTrue ("Expecting an exception message" ,
1040- "JSONObject[\" trueKey\" ] not a string." .
1041- equals ( e .getMessage () ));
1039+ assertEquals ("Expecting an exception message" ,
1040+ "JSONObject[\" trueKey\" ] not a string." ,
1041+ e .getMessage ());
10421042 }
10431043 try {
10441044 jsonObject .getDouble ("nonKey" );
10451045 fail ("Expected an exception" );
10461046 } catch (JSONException e ) {
1047- assertTrue ("Expecting an exception message" ,
1048- "JSONObject[\" nonKey\" ] not found." .
1049- equals ( e .getMessage () ));
1047+ assertEquals ("Expecting an exception message" ,
1048+ "JSONObject[\" nonKey\" ] not found." ,
1049+ e .getMessage ());
10501050 }
10511051 try {
10521052 jsonObject .getDouble ("stringKey" );
10531053 fail ("Expected an exception" );
10541054 } catch (JSONException e ) {
1055- assertTrue ("Expecting an exception message" ,
1056- "JSONObject[\" stringKey\" ] is not a number." .
1057- equals ( e .getMessage () ));
1055+ assertEquals ("Expecting an exception message" ,
1056+ "JSONObject[\" stringKey\" ] is not a number." ,
1057+ e .getMessage ());
10581058 }
10591059 try {
10601060 jsonObject .getFloat ("nonKey" );
10611061 fail ("Expected an exception" );
10621062 } catch (JSONException e ) {
1063- assertTrue ("Expecting an exception message" ,
1064- "JSONObject[\" nonKey\" ] not found." .
1065- equals ( e .getMessage () ));
1063+ assertEquals ("Expecting an exception message" ,
1064+ "JSONObject[\" nonKey\" ] not found." ,
1065+ e .getMessage ());
10661066 }
10671067 try {
10681068 jsonObject .getFloat ("stringKey" );
10691069 fail ("Expected an exception" );
10701070 } catch (JSONException e ) {
1071- assertTrue ("Expecting an exception message" ,
1072- "JSONObject[\" stringKey\" ] is not a number." .
1073- equals ( e .getMessage () ));
1071+ assertEquals ("Expecting an exception message" ,
1072+ "JSONObject[\" stringKey\" ] is not a number." ,
1073+ e .getMessage ());
10741074 }
10751075 try {
10761076 jsonObject .getInt ("nonKey" );
10771077 fail ("Expected an exception" );
10781078 } catch (JSONException e ) {
1079- assertTrue ("Expecting an exception message" ,
1080- "JSONObject[\" nonKey\" ] not found." .
1081- equals ( e .getMessage () ));
1079+ assertEquals ("Expecting an exception message" ,
1080+ "JSONObject[\" nonKey\" ] not found." ,
1081+ e .getMessage ());
10821082 }
10831083 try {
10841084 jsonObject .getInt ("stringKey" );
10851085 fail ("Expected an exception" );
10861086 } catch (JSONException e ) {
1087- assertTrue ("Expecting an exception message" ,
1088- "JSONObject[\" stringKey\" ] is not an int." .
1089- equals ( e .getMessage () ));
1087+ assertEquals ("Expecting an exception message" ,
1088+ "JSONObject[\" stringKey\" ] is not a number." ,
1089+ e .getMessage ());
10901090 }
10911091 try {
10921092 jsonObject .getLong ("nonKey" );
10931093 fail ("Expected an exception" );
10941094 } catch (JSONException e ) {
1095- assertTrue ("Expecting an exception message" ,
1096- "JSONObject[\" nonKey\" ] not found." .
1097- equals ( e .getMessage () ));
1095+ assertEquals ("Expecting an exception message" ,
1096+ "JSONObject[\" nonKey\" ] not found." ,
1097+ e .getMessage ());
10981098 }
10991099 try {
11001100 jsonObject .getLong ("stringKey" );
11011101 fail ("Expected an exception" );
11021102 } catch (JSONException e ) {
1103- assertTrue ("Expecting an exception message" ,
1104- "JSONObject[\" stringKey\" ] is not a long." .
1105- equals ( e .getMessage () ));
1103+ assertEquals ("Expecting an exception message" ,
1104+ "JSONObject[\" stringKey\" ] is not a number." ,
1105+ e .getMessage ());
11061106 }
11071107 try {
11081108 jsonObject .getJSONArray ("nonKey" );
11091109 fail ("Expected an exception" );
11101110 } catch (JSONException e ) {
1111- assertTrue ("Expecting an exception message" ,
1112- "JSONObject[\" nonKey\" ] not found." .
1113- equals ( e .getMessage () ));
1111+ assertEquals ("Expecting an exception message" ,
1112+ "JSONObject[\" nonKey\" ] not found." ,
1113+ e .getMessage ());
11141114 }
11151115 try {
11161116 jsonObject .getJSONArray ("stringKey" );
11171117 fail ("Expected an exception" );
11181118 } catch (JSONException e ) {
1119- assertTrue ("Expecting an exception message" ,
1120- "JSONObject[\" stringKey\" ] is not a JSONArray." .
1121- equals ( e .getMessage () ));
1119+ assertEquals ("Expecting an exception message" ,
1120+ "JSONObject[\" stringKey\" ] is not a JSONArray." ,
1121+ e .getMessage ());
11221122 }
11231123 try {
11241124 jsonObject .getJSONObject ("nonKey" );
11251125 fail ("Expected an exception" );
11261126 } catch (JSONException e ) {
1127- assertTrue ("Expecting an exception message" ,
1128- "JSONObject[\" nonKey\" ] not found." .
1129- equals ( e .getMessage () ));
1127+ assertEquals ("Expecting an exception message" ,
1128+ "JSONObject[\" nonKey\" ] not found." ,
1129+ e .getMessage ());
11301130 }
11311131 try {
11321132 jsonObject .getJSONObject ("stringKey" );
11331133 fail ("Expected an exception" );
11341134 } catch (JSONException e ) {
1135- assertTrue ("Expecting an exception message" ,
1136- "JSONObject[\" stringKey\" ] is not a JSONObject." .
1137- equals ( e .getMessage () ));
1135+ assertEquals ("Expecting an exception message" ,
1136+ "JSONObject[\" stringKey\" ] is not a JSONObject." ,
1137+ e .getMessage ());
11381138 }
11391139 }
11401140
0 commit comments