1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 16:00:51 -07:00

Fixes for failing tests due to android integration

This commit is contained in:
John J. Aylward 2017-06-21 14:59:42 -04:00
parent 441fec7498
commit 3081b4bd96
2 changed files with 61 additions and 60 deletions

View file

@ -42,11 +42,11 @@ public class JSONMLTest {
String xmlStr = "";
try {
JSONML.toJSONArray(xmlStr);
assertTrue("Expecting an exception", false);
fail("Expecting an exception");
} catch (JSONException e) {
assertTrue("Expecting an exception message",
"Bad XML at 1 [character 2 line 1]".
equals(e.getMessage()));
assertEquals("Expecting an exception message",
"Bad XML at 0 [character 1 line 1]",
e.getMessage());
}
}
@ -95,11 +95,11 @@ public class JSONMLTest {
String xmlStr = "{ \"this is\": \"not xml\"}";
try {
JSONML.toJSONArray(xmlStr);
assertTrue("Expecting an exception", false);
fail("Expecting an exception");
} catch (JSONException e) {
assertTrue("Expecting an exception message",
"Bad XML at 25 [character 26 line 1]".
equals(e.getMessage()));
assertEquals("Expecting an exception message",
"Bad XML at 23 [character 24 line 1]",
e.getMessage());
}
}
@ -198,11 +198,11 @@ public class JSONMLTest {
"</addresses>";
try {
JSONML.toJSONArray(xmlStr);
assertTrue("Expecting an exception", false);
fail("Expecting an exception");
} catch (JSONException e) {
assertTrue("Expecting an exception message",
"Misshaped tag at 176 [character 14 line 7]".
equals(e.getMessage()));
assertEquals("Expecting an exception message",
"Misshaped tag at 176 [character 14 line 4]",
e.getMessage());
}
}
@ -223,11 +223,11 @@ public class JSONMLTest {
"</addresses>";
try {
JSONML.toJSONArray(xmlStr);
assertTrue("Expecting an exception", false);
fail("Expecting an exception");
} catch (JSONException e) {
assertTrue("Expecting an exception message",
"Misshaped meta tag at 216 [character 13 line 11]".
equals(e.getMessage()));
assertEquals("Expecting an exception message",
"Misshaped meta tag at 216 [character 13 line 7]",
e.getMessage());
}
}
@ -253,11 +253,11 @@ public class JSONMLTest {
"</addresses>";
try {
JSONML.toJSONArray(xmlStr);
assertTrue("Expecting an exception", false);
fail("Expecting an exception");
} catch (JSONException e) {
assertTrue("Expecting an exception message",
"Misshaped meta tag at 215 [character 13 line 11]".
equals(e.getMessage()));
assertEquals("Expecting an exception message",
"Misshaped meta tag at 215 [character 13 line 7]",
e.getMessage());
}
}
@ -283,11 +283,11 @@ public class JSONMLTest {
"</addresses>";
try {
JSONML.toJSONArray(xmlStr);
assertTrue("Expecting an exception", false);
fail("Expecting an exception");
} catch (JSONException e) {
assertTrue("Expecting an exception message",
"Misplaced '<' at 194 [character 5 line 10]".
equals(e.getMessage()));
assertEquals("Expecting an exception message",
"Misplaced '<' at 194 [character 5 line 6]",
e.getMessage());
}
}
@ -343,11 +343,11 @@ public class JSONMLTest {
"</addresses>";
try {
JSONML.toJSONArray(xmlStr);
assertTrue("Expecting an exception", false);
fail("Expecting an exception");
} catch (JSONException e) {
assertTrue("Expecting an exception message",
"Misplaced '<' at 206 [character 1 line 12]".
equals(e.getMessage()));
assertEquals("Expecting an exception message",
"Misplaced '<' at 206 [character 1 line 7]",
e.getMessage());
}
}
@ -373,11 +373,11 @@ public class JSONMLTest {
"</addresses>";
try {
JSONML.toJSONArray(xmlStr);
assertTrue("Expecting an exception", false);
fail("Expecting an exception");
} catch (JSONException e) {
assertTrue("Expecting an exception message",
"Expected 'CDATA[' at 204 [character 11 line 9]".
equals(e.getMessage()));
assertEquals("Expecting an exception message",
"Expected 'CDATA[' at 204 [character 11 line 5]",
e.getMessage());
}
}