Search in sources :

Example 21 with GuidedDecisionTableEditorGraphModel

use of org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphModel in project drools-wb by kiegroup.

the class GuidedDTGraphXMLPersistenceTest method checkMarshallingModelWithoutEntryPosition.

@Test
public void checkMarshallingModelWithoutEntryPosition() {
    final Path path = PathFactory.newPath("path", "default://path");
    final GuidedDecisionTableEditorGraphModel model = new GuidedDecisionTableEditorGraphModel();
    model.getEntries().add(new GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry(path, path));
    final String xml = GuidedDTGraphXMLPersistence.getInstance().marshal(model);
    assertNotNull(xml);
    assertEqualsIgnoreWhitespace("<graph>\n" + "  <entries>\n" + "    <entry>\n" + "      <pathHead class=\"org.uberfire.backend.vfs.PathFactory$PathImpl\">\n" + "        <uri>default://path</uri>\n" + "        <fileName>path</fileName>\n" + "        <attributes/>\n" + "        <hasVersionSupport>false</hasVersionSupport>\n" + "      </pathHead>\n" + "      <pathVersion class=\"org.uberfire.backend.vfs.PathFactory$PathImpl\" reference=\"../pathHead\"/>\n" + "    </entry>\n" + "  </entries>\n" + "</graph>", xml);
}
Also used : Path(org.uberfire.backend.vfs.Path) GuidedDecisionTableEditorGraphModel(org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphModel) Test(org.junit.Test)

Example 22 with GuidedDecisionTableEditorGraphModel

use of org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphModel in project drools-wb by kiegroup.

the class GuidedDTGraphXMLPersistenceTest method checkUnmarshallingCorruptString.

@Test
public void checkUnmarshallingCorruptString() {
    final GuidedDecisionTableEditorGraphModel model = GuidedDTGraphXMLPersistence.getInstance().unmarshal("cheese");
    assertEmptyModel(model);
}
Also used : GuidedDecisionTableEditorGraphModel(org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphModel) Test(org.junit.Test)

Aggregations

GuidedDecisionTableEditorGraphModel (org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphModel)22 Test (org.junit.Test)16 Path (org.uberfire.backend.vfs.Path)9 URI (java.net.URI)3 Metadata (org.guvnor.common.services.shared.metadata.model.Metadata)3 Map (java.util.Map)2 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)2 GuidedDecisionTableEditorContent (org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorContent)2 GuidedDecisionTableEditorGraphContent (org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphContent)2 FileExtensionFilter (org.guvnor.common.services.backend.file.FileExtensionFilter)2 Overview (org.guvnor.common.services.shared.metadata.model.Overview)2 ObservablePath (org.uberfire.backend.vfs.ObservablePath)2 ResourceOpenedEvent (org.uberfire.workbench.events.ResourceOpenedEvent)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 PostConstruct (javax.annotation.PostConstruct)1