, JuStringUtils.removeNonAlphabeticalLeadingCharacters(this.testMethodReadableName));
URL tablesDataSestUrl = JuUrl.resource().relativeTo(this.getTestClass()).get(dataSetExport.tablesDataSet());
if (tablesDataSestUrl == null) tablesDataSestUrl = JuUrl.resource(dataSetExport.tablesDataSet());
ExportBuilder eb = new DbDataUtil(emUtil).buildExport()
.addTablesByDataSet(tablesDataSestUrl, true);
doc = eb.writeToXmlDocument();
if (dataSetExport.doPhysicalExport()) {
if (JuUtils.getJuPropertyChain().get("ju-testing.export.compareToResource", Boolean.class, true)) {
// Perform export in-memory and compare to resource
String resourcePrefix = dataSetExport.resourcePrefix();
String resourcePath = resourcePrefix + "/" + targetFileName;
URL resourceUrl = JuUrl.singleResource(resourcePath);
String resourceString = new IOUtil().loadTextFromUrl(resourceUrl);
String xmlString = eb.writeToXmlString();
logger.debug("Comparing DB export to resource {}", resourceUrl);
Assert.assertEquals(resourceString, xmlString);
} else {
// Perform export to file
String targetDirName = dataSetExport.targetDir();
// Create target directory
Path targetDirPath = Paths.get(this.getLocalRoot(), targetDirName);
Files.createDirectories(targetDirPath);
// Build file path
Path targetFilePath = targetDirPath.resolve(targetFileName);
eb.writeToXmlFile(targetFilePath.toString());
}
} else {
// Log XML
if (logger.isInfoEnabled()) {
XString xs = new XString(targetFileName);