mirror of https://github.com/apache/nifi.git
NIFI-13709 Added more meaningful message when validation fails with non-compliant XML is validated and no schema is provided.
Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com> This closes #9229.
This commit is contained in:
parent
5f0cbed5a6
commit
727b0ba106
|
@ -217,7 +217,7 @@ public class ValidateXml extends AbstractProcessor {
|
|||
reader.next();
|
||||
}
|
||||
} catch (final XMLStreamException e) {
|
||||
throw new ProcessingException("Reading stream failed", e);
|
||||
throw new ProcessingException("Reading stream failed: " + e.getMessage(), e);
|
||||
}
|
||||
} else {
|
||||
final XMLStreamReaderProvider readerProvider = new StandardXMLStreamReaderProvider();
|
||||
|
|
|
@ -168,6 +168,8 @@ public class TestValidateXml {
|
|||
|
||||
runner.assertAllFlowFilesTransferred(ValidateXml.REL_INVALID, 1);
|
||||
runner.assertAllFlowFilesContainAttribute(ValidateXml.REL_INVALID, ValidateXml.ERROR_ATTRIBUTE_KEY);
|
||||
String errorAttribute = runner.getFlowFilesForRelationship(ValidateXml.REL_INVALID).get(0).getAttribute(ValidateXml.ERROR_ATTRIBUTE_KEY);
|
||||
assertTrue(errorAttribute.contains("ParseError"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -191,5 +193,7 @@ public class TestValidateXml {
|
|||
|
||||
runner.assertAllFlowFilesTransferred(ValidateXml.REL_INVALID, 1);
|
||||
runner.assertAllFlowFilesContainAttribute(ValidateXml.REL_INVALID, ValidateXml.ERROR_ATTRIBUTE_KEY);
|
||||
String errorAttribute = runner.getFlowFilesForRelationship(ValidateXml.REL_INVALID).get(0).getAttribute(ValidateXml.ERROR_ATTRIBUTE_KEY);
|
||||
assertTrue(errorAttribute.contains("ParseError"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue