Campoie / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

Add XML validation against XSD or DTD #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
E.g.

expect().bodyMatches(XTD).when().get("/something");

Original issue reported on code.google.com by johan.ha...@gmail.com on 13 Feb 2011 at 1:37

GoogleCodeExporter commented 9 years ago
http://groovy.codehaus.org/Validating+XML+with+a+W3C+XML+Schema
http://groovy.codehaus.org/Validating+XML+with+a+DTD

Original comment by johan.ha...@gmail.com on 15 Feb 2011 at 7:47

GoogleCodeExporter commented 9 years ago
syntax should probably be: 

expect().body().matchesXsd(XSD). .. 

Should support string, inputstream, file, reader etc

Original comment by johan.ha...@gmail.com on 18 Feb 2011 at 3:27

GoogleCodeExporter commented 9 years ago
http://stackoverflow.com/questions/1096365/validate-an-xml-file-against-local-dt
d-file-with-java

Original comment by johan.ha...@gmail.com on 20 Feb 2011 at 6:04

GoogleCodeExporter commented 9 years ago
Perhaps syntax should be:

expect().body(matchesXsd(XSD))..

Original comment by johan.ha...@gmail.com on 20 Feb 2011 at 6:05

GoogleCodeExporter commented 9 years ago
http://www.roseindia.net/xml/dom/DOMValidateDTD.shtml

Original comment by johan.ha...@gmail.com on 20 Feb 2011 at 6:06

GoogleCodeExporter commented 9 years ago
expect().bodyMatchesXsd(..)
expect().bodyMatchesDtd(..)

expect().body(dtd(dtdString)).

expect().body().matchesDtd(dtdString).
expect().matchesDtd(dtdString).

expect().body().dtd(dtdString).
expect().validation().dtd(dtdString).
expect().dtd(dtdString).

expect().dtdValidation(dtdString).
expect().xsdValidation(xsdString).

Original comment by johan.ha...@gmail.com on 25 Feb 2011 at 10:10

GoogleCodeExporter commented 9 years ago
Hamcrest matcher may be better since then you can use both for expectations and 
for hamcrest matching when the response have been returned as String.

E.g. 

expect().body(matchesDtd(dtd))..

String body = get("/lotto").asString();
assertThat(body, matchesDtd(dtd));

Original comment by johan.ha...@gmail.com on 26 Feb 2011 at 10:06

GoogleCodeExporter commented 9 years ago
http://www.apacheserver.net/q32629/Java-DTD-validation-XML-files-without-DTD-dec
laration-included-in

Original comment by johan.ha...@gmail.com on 1 Mar 2011 at 8:52

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 1 Mar 2011 at 7:48