Exemplo n.º 1
0
 private void testWrongChildTypeValidation(
     String jsonml, TagType type, TagType[] expected, TagType actual, int index) throws Exception {
   testValidation(
       jsonml,
       String.format(
           Validator.WRONG_CHILD_TYPE_FMT, index, type, Validator.printList(expected), actual));
 }
Exemplo n.º 2
0
 // Used for correct statements - error message should be null
 private void testValidation(String jsonml) throws Exception {
   JsonML jsonMLRoot = JsonMLUtil.parseString(jsonml);
   String msg = Validator.validate(jsonMLRoot);
   if (msg != null) {
     String errorMsg = String.format("Validation error for %s.\n Received: %s\n", jsonml, msg);
   }
 }
Exemplo n.º 3
0
 private void testValidation(String jsonml, String expected) throws Exception {
   JsonML jsonMLRoot = JsonMLUtil.parseString(jsonml);
   String msg = Validator.validate(jsonMLRoot);
   if (!msg.equals(expected)) {
     String errorMsg =
         String.format(
             "Validation error for %s.\n Received: %s\n Expected: %s\n", jsonml, msg, expected);
     assertEquals(errorMsg, expected, msg);
   }
 }