use of org.drools.compiler.compiler.xml.XmlDumper in project drools by kiegroup.
the class DumperTestHelper method XmlFile.
public static void XmlFile(String filename) throws Exception {
KnowledgeBuilderConfigurationImpl conf = new KnowledgeBuilderConfigurationImpl();
XmlPackageReader xmlPackageReader = new XmlPackageReader(conf.getSemanticModules());
xmlPackageReader.getParser().setClassLoader(DumperTestHelper.class.getClassLoader());
xmlPackageReader.read(new InputStreamReader(DumperTestHelper.class.getResourceAsStream(filename)));
final PackageDescr pkgOriginal = xmlPackageReader.getPackageDescr();
final XmlDumper dumper = new XmlDumper();
final String result = dumper.dump(pkgOriginal);
String buffer = readFile(filename);
System.out.println(buffer);
System.out.println(result);
Assertions.assertThat(buffer).isEqualToIgnoringWhitespace(result);
assertNotNull(result);
}
Aggregations