Search in sources :

Example 6 with BPMNDISemanticModule

use of org.jbpm.bpmn2.xml.BPMNDISemanticModule in project jbpm by kiegroup.

the class BPMN2XMLTest method testInvalidXML.

public void testInvalidXML() throws Exception, SAXException {
    SemanticModules modules = new SemanticModules();
    modules.addSemanticModule(new BPMNSemanticModule());
    modules.addSemanticModule(new BPMNDISemanticModule());
    XmlProcessReader processReader = new XmlProcessReader(modules, getClass().getClassLoader()) {

        @Override
        protected String processParserMessage(LinkedList<Object> parents, org.xml.sax.Attributes attr, String errorMessage) {
            setErrorMessage(super.processParserMessage(parents, attr, errorMessage));
            return errorMessage;
        }
    };
    processReader.read(BPMN2XMLTest.class.getResourceAsStream("/BPMN2-XMLProcessWithError.bpmn2"));
    assertNotNull(getErrorMessage());
    assertThat(getErrorMessage()).contains("Process Info: id:error.process, pkg:org.jbpm, name:errorprocess, version:1.0 \n" + "Node Info: id:_F8A89567-7416-4CCA-9CCD-BC1DDE870F1E name: \n" + "Parser message: (null: 45, 181): cvc-complex-type.2.4.a: Invalid content was found");
}
Also used : SemanticModules(org.drools.core.xml.SemanticModules) BPMNDISemanticModule(org.jbpm.bpmn2.xml.BPMNDISemanticModule) XmlProcessReader(org.jbpm.compiler.xml.XmlProcessReader) BPMNSemanticModule(org.jbpm.bpmn2.xml.BPMNSemanticModule) LinkedList(java.util.LinkedList)

Aggregations

BPMNDISemanticModule (org.jbpm.bpmn2.xml.BPMNDISemanticModule)6 BPMNSemanticModule (org.jbpm.bpmn2.xml.BPMNSemanticModule)6 SemanticModules (org.drools.core.xml.SemanticModules)4 XmlProcessReader (org.jbpm.compiler.xml.XmlProcessReader)4 LinkedList (java.util.LinkedList)2 KnowledgeBuilderConfigurationImpl (org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl)2 BPMNExtensionsSemanticModule (org.jbpm.bpmn2.xml.BPMNExtensionsSemanticModule)2 RuleFlowProcess (org.jbpm.ruleflow.core.RuleFlowProcess)2 Process (org.kie.api.definition.process.Process)2 StringReader (java.io.StringReader)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 PostConstruct (javax.annotation.PostConstruct)1 Diff (org.custommonkey.xmlunit.Diff)1 Difference (org.custommonkey.xmlunit.Difference)1 DifferenceListener (org.custommonkey.xmlunit.DifferenceListener)1 ElementNameAndAttributeQualifier (org.custommonkey.xmlunit.ElementNameAndAttributeQualifier)1 KnowledgeBuilderImpl (org.drools.compiler.builder.impl.KnowledgeBuilderImpl)1 Resource (org.kie.api.io.Resource)1 KnowledgeBuilderConfiguration (org.kie.internal.builder.KnowledgeBuilderConfiguration)1