mirror of
https://github.com/google/nomulus.git
synced 2025-05-12 22:38:16 +02:00
Pretty-print actual XML in tests
This means that, when writing new tests that are failing, you get much more useful logs that show the actual XML in a more comprehensible format that is suitable for pasting back into the golden file in the test (if the change was intended). This requires outputting the standalone parameter in the XML transformer, and some minor changes to some tests as a result that were relying on it being stripped out. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=204513690
This commit is contained in:
parent
df5d9957f7
commit
278ec2b289
5 changed files with 11 additions and 7 deletions
|
@ -303,6 +303,7 @@ public class XmlTransformer {
|
|||
try {
|
||||
Transformer transformer = transformerFactory.newTransformer();
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
|
||||
transformer.setOutputProperty(OutputKeys.STANDALONE, "yes");
|
||||
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
|
||||
transformer.transform(
|
||||
new StreamSource(new StringReader(xmlString)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue