fix(性能测试): 修复性能测试输出jmx格式化的问题

--bug=1010141 --user=刘瑞斌 [性能测试]github#10263性能测试引用自动化场景或者 场景转性能,会
格式化前后置脚本,如果脚本中有注释的话,格式化后 换行 导致脚本报错
https://www.tapd.cn/55049933/s/1101654

Closes #10263
This commit is contained in:
CaptainB 2022-02-08 11:24:44 +08:00 committed by CountryBuilder
parent 935b2780aa
commit 1e3d08663b
3 changed files with 4 additions and 4 deletions

View File

@ -349,7 +349,7 @@ public class EngineFactory {
//
inputSource.close();
}
return EngineSourceParserFactory.formatXml(rootDocument);
return EngineSourceParserFactory.getBytes(rootDocument);
} catch (Exception e) {
MSException.throwException(e);
}

View File

@ -38,8 +38,8 @@ public class EngineSourceParserFactory {
return reader.read(source);
}
public static byte[] formatXml(Document document) throws Exception {
OutputFormat format = OutputFormat.createPrettyPrint();
public static byte[] getBytes(Document document) throws Exception {
OutputFormat format = OutputFormat.createCompactFormat();
try (
ByteArrayOutputStream out = new ByteArrayOutputStream();
) {

View File

@ -62,7 +62,7 @@ public class JmeterDocumentParser implements EngineSourceParser {
parseHashTree(ele);
}
return EngineSourceParserFactory.formatXml(document);
return EngineSourceParserFactory.getBytes(document);
}