Search in sources :

Example 1 with XmlDumper

use of org.jbpm.compiler.xml.compiler.XmlDumper in project kogito-runtimes by kiegroup.

the class DumperTestHelper method XmlFile.

public static void XmlFile(String filename) throws Exception {
    SemanticKnowledgeBuilderConfigurationImpl conf = new SemanticKnowledgeBuilderConfigurationImpl();
    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);
    assertThat(buffer).isEqualToIgnoringWhitespace(result);
    assertThat(result).isNotNull();
}
Also used : SemanticKnowledgeBuilderConfigurationImpl(org.jbpm.compiler.xml.compiler.SemanticKnowledgeBuilderConfigurationImpl) InputStreamReader(java.io.InputStreamReader) PackageDescr(org.drools.drl.ast.descr.PackageDescr) XmlDumper(org.jbpm.compiler.xml.compiler.XmlDumper) XmlPackageReader(org.jbpm.compiler.xml.compiler.XmlPackageReader)

Aggregations

InputStreamReader (java.io.InputStreamReader)1 PackageDescr (org.drools.drl.ast.descr.PackageDescr)1 SemanticKnowledgeBuilderConfigurationImpl (org.jbpm.compiler.xml.compiler.SemanticKnowledgeBuilderConfigurationImpl)1 XmlDumper (org.jbpm.compiler.xml.compiler.XmlDumper)1 XmlPackageReader (org.jbpm.compiler.xml.compiler.XmlPackageReader)1