SHARE
TWEET

Untitled

a guest Jul 17th, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package org.kie.workbench.common.dmn.backend;
  2.  
  3. import java.io.ByteArrayInputStream;
  4. import java.io.IOException;
  5.  
  6. import org.junit.Test;
  7. import org.kie.workbench.common.stunner.backend.service.XMLEncoderDiagramMetadataMarshaller;
  8. import org.kie.workbench.common.stunner.core.graph.Graph;
  9.  
  10. public class MatteoTest {
  11.    
  12.     private static final String EXAMPLE_1 = "{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.impl.GraphImpl\",\"^ObjectID\":\"1\",\"nodeStore\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.store.GraphNodeStoreImpl\",\"^ObjectID\":\"2\",\"nodes\":{\"^EncodedType\":\"java.util.HashMap\",\"^ObjectID\":\"3\",\"^Value\":{\"890D97DD-52BD-4876-BE1C-71ACC54AF70E\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.impl.NodeImpl\",\"^ObjectID\":\"4\",\"inEdges\":{\"^EncodedType\":\"java.util.ArrayList\",\"^ObjectID\":\"5\",\"^Value\":[{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.impl.EdgeImpl\",\"^ObjectID\":\"6\",\"sourceNode\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.impl.NodeImpl\",\"^ObjectID\":\"7\",\"inEdges\":{\"^EncodedType\":\"java.util.ArrayList\",\"^ObjectID\":\"8\",\"^Value\":[]},\"outEdges\":{\"^EncodedType\":\"java.util.ArrayList\",\"^ObjectID\":\"9\",\"^Value\":[{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.impl.EdgeImpl\",\"^ObjectID\":\"10\",\"sourceNode\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.impl.NodeImpl\",\"^ObjectID\":\"7\"},\"targetNode\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.impl.NodeImpl\",\"^ObjectID\":\"11\",\"inEdges\":{\"^EncodedType\":\"java.util.ArrayList\",\"^ObjectID\":\"12\",\"^Value\":[{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.impl.EdgeImpl\",\"^ObjectID\":\"10\"}]},\"outEdges\":{\"^EncodedType\":\"java.util.ArrayList\",\"^ObjectID\":\"13\",\"^Value\":[{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.impl.EdgeImpl\",\"^ObjectID\":\"14\",\"sourceNode\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.impl.NodeImpl\",\"^ObjectID\":\"11\"},\"targetNode\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.impl.NodeImpl\",\"^ObjectID\":\"4\"},\"uuid\":\"B5948BC9-C049-42E0-94C8-279BE6545C6E\",\"labels\":{\"^EncodedType\":\"java.util.HashSet\",\"^ObjectID\":\"15\",\"^Value\":[\"information-requirement\",\"org.kie.workbench.common.dmn.api.definition.v1_1.InformationRequirement\"]},\"content\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.ViewConnectorImpl\",\"^ObjectID\":\"16\",\"definition\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.definition.v1_1.InformationRequirement\",\"^ObjectID\":\"17\",\"stunnerLabels\":{\"^EncodedType\":\"java.util.HashSet\",\"^ObjectID\":\"18\",\"^Value\":[\"information-requirement\"]},\"nameSpaces\":{\"^EncodedType\":\"java.util.HashMap\",\"^ObjectID\":\"19\",\"^Value\":{}}},\"bounds\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.BoundsImpl\",\"^ObjectID\":\"20\",\"lr\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.BoundImpl\",\"^ObjectID\":\"21\",\"x\":30.0,\"y\":30.0},\"ul\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.BoundImpl\",\"^ObjectID\":\"22\",\"x\":0.0,\"y\":0.0}},\"sourceMagnet\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.MagnetImpl\",\"^ObjectID\":\"23\",\"location\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.Point2D\",\"^ObjectID\":\"24\",\"x\":100.0,\"y\":25.0},\"magnetType\":null},\"targetMagnet\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.MagnetImpl\",\"^ObjectID\":\"25\",\"location\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.Point2D\",\"^ObjectID\":\"26\",\"x\":0.0,\"y\":25.0},\"magnetType\":null}}}]},\"uuid\":\"53DED5E7-3942-4984-B6E4-04DDB980610E\",\"labels\":{\"^EncodedType\":\"java.util.HashSet\",\"^ObjectID\":\"27\",\"^Value\":[\"org.kie.workbench.common.dmn.api.definition.v1_1.InputData\",\"input-data\"]},\"content\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl\",\"^ObjectID\":\"28\",\"definition\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.definition.v1_1.InputData\",\"^ObjectID\":\"29\",\"stunnerLabels\":{\"^EncodedType\":\"java.util.HashSet\",\"^ObjectID\":\"30\",\"^Value\":[\"input-data\"]},\"variable\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem\",\"^ObjectID\":\"31\",\"typeRef\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.QName\",\"^ObjectID\":\"32\",\"value\":\"My QName\"},\"name\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Name\",\"^ObjectID\":\"33\",\"value\":\"My name\"},\"id\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Id\",\"^ObjectID\":\"34\",\"value\":\"B0A7BA46-799A-4EC7-9FD1-8A2F668E9BA5\"},\"label\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Label\",\"^ObjectID\":\"35\",\"value\":\"My label\"},\"description\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Description\",\"^ObjectID\":\"36\",\"readOnly\":false,\"value\":\"My description\"},\"otherAttributes\":{\"^EncodedType\":\"java.util.HashMap\",\"^ObjectID\":\"37\",\"^Value\":{}},\"extensionElements\":null,\"nameSpaces\":{\"^EncodedType\":\"java.util.HashMap\",\"^ObjectID\":\"38\",\"^Value\":{}}},\"backgroundSet\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.background.BackgroundSet\",\"^ObjectID\":\"39\",\"bgColour\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.background.BgColour\",\"^ObjectID\":\"40\",\"readOnly\":false,\"value\":\"#ffffff\"},\"borderColour\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.background.BorderColour\",\"^ObjectID\":\"41\",\"readOnly\":false,\"value\":\"#000000\"},\"borderSize\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.background.BorderSize\",\"^ObjectID\":\"42\",\"readOnly\":false,\"value\":0.5}},\"fontSet\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.font.FontSet\",\"^ObjectID\":\"43\",\"fontFamily\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.font.FontFamily\",\"^ObjectID\":\"44\",\"readOnly\":false,\"value\":\"Open Sans\"},\"fontColour\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.font.FontColour\",\"^ObjectID\":\"45\",\"readOnly\":false,\"value\":\"#000000\"},\"fontSize\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.font.FontSize\",\"^ObjectID\":\"46\",\"readOnly\":false,\"value\":10.0},\"fontBorderSize\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.font.FontBorderSize\",\"^ObjectID\":\"47\",\"readOnly\":false,\"value\":0.0}},\"dimensionsSet\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dimensions.RectangleDimensionsSet\",\"^ObjectID\":\"48\",\"width\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dimensions.Width\",\"^ObjectID\":\"49\",\"readOnly\":false,\"value\":100.0},\"height\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dimensions.Height\",\"^ObjectID\":\"50\",\"readOnly\":false,\"value\":50.0}},\"name\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Name\",\"^ObjectID\":\"51\",\"value\":\"My name\"},\"id\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Id\",\"^ObjectID\":\"52\",\"value\":\"36B7A0BB-38EC-4234-95C5-D17AFB6D04C6\"},\"label\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Label\",\"^ObjectID\":\"53\",\"value\":\"My label\"},\"description\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Description\",\"^ObjectID\":\"54\",\"readOnly\":false,\"value\":\"My description\"},\"otherAttributes\":{\"^EncodedType\":\"java.util.HashMap\",\"^ObjectID\":\"55\",\"^Value\":{}},\"extensionElements\":null,\"nameSpaces\":{\"^EncodedType\":\"java.util.HashMap\",\"^ObjectID\":\"56\",\"^Value\":{}}},\"bounds\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.BoundsImpl\",\"^ObjectID\":\"57\",\"lr\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.BoundImpl\",\"^ObjectID\":\"58\",\"x\":327.0,\"y\":255.0},\"ul\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.BoundImpl\",\"^ObjectID\":\"59\",\"x\":227.0,\"y\":205.0}}}},\"uuid\":\"B24B8454-0A31-4911-B414-4A08664FB9AA\",\"labels\":{\"^EncodedType\":\"java.util.HashSet\",\"^ObjectID\":\"60\",\"^Value\":[]},\"content\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.relationship.Child\",\"^ObjectID\":\"61\",\"^InstantiateOnly\":true}},{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.impl.EdgeImpl\",\"^ObjectID\":\"6\"}]},\"uuid\":\"FB5A8959-B5AA-4040-99F2-A9B837409540\",\"labels\":{\"^EncodedType\":\"java.util.HashSet\",\"^ObjectID\":\"62\",\"^Value\":[\"dmn_diagram\",\"org.kie.workbench.common.dmn.api.definition.v1_1.DMNDiagram\"]},\"content\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl\",\"^ObjectID\":\"63\",\"definition\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.definition.v1_1.DMNDiagram\",\"^ObjectID\":\"64\",\"backgroundSet\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.background.BackgroundSet\",\"^ObjectID\":\"65\",\"bgColour\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.background.BgColour\",\"^ObjectID\":\"66\",\"readOnly\":false,\"value\":\"#ffffff\"},\"borderColour\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.background.BorderColour\",\"^ObjectID\":\"67\",\"readOnly\":false,\"value\":\"#000000\"},\"borderSize\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.background.BorderSize\",\"^ObjectID\":\"68\",\"readOnly\":false,\"value\":0.5}},\"fontSet\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.font.FontSet\",\"^ObjectID\":\"69\",\"fontFamily\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.font.FontFamily\",\"^ObjectID\":\"70\",\"readOnly\":false,\"value\":\"Open Sans\"},\"fontColour\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.font.FontColour\",\"^ObjectID\":\"71\",\"readOnly\":false,\"value\":\"#000000\"},\"fontSize\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.font.FontSize\",\"^ObjectID\":\"72\",\"readOnly\":false,\"value\":10.0},\"fontBorderSize\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.font.FontBorderSize\",\"^ObjectID\":\"73\",\"readOnly\":false,\"value\":0.0}},\"dimensionsSet\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dimensions.RectangleDimensionsSet\",\"^ObjectID\":\"74\",\"width\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dimensions.Width\",\"^ObjectID\":\"75\",\"readOnly\":false,\"value\":100.0},\"height\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dimensions.Height\",\"^ObjectID\":\"76\",\"readOnly\":false,\"value\":50.0}},\"nameSpaces\":{\"^EncodedType\":\"java.util.HashMap\",\"^ObjectID\":\"77\",\"^Value\":{}}},\"bounds\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.BoundsImpl\",\"^ObjectID\":\"78\",\"lr\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.BoundImpl\",\"^ObjectID\":\"79\",\"x\":100.0,\"y\":50.0},\"ul\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.BoundImpl\",\"^ObjectID\":\"80\",\"x\":0.0,\"y\":0.0}}}},\"targetNode\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.impl.NodeImpl\",\"^ObjectID\":\"4\"},\"uuid\":\"7FF6F009-CCBB-47C0-AAF8-9430A12F8AF3\",\"labels\":{\"^EncodedType\":\"java.util.HashSet\",\"^ObjectID\":\"81\",\"^Value\":[]},\"content\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.relationship.Child\",\"^ObjectID\":\"82\",\"^InstantiateOnly\":true}},{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.impl.EdgeImpl\",\"^ObjectID\":\"14\"}]},\"outEdges\":{\"^EncodedType\":\"java.util.ArrayList\",\"^ObjectID\":\"83\",\"^Value\":[]},\"uuid\":\"890D97DD-52BD-4876-BE1C-71ACC54AF70E\",\"labels\":{\"^EncodedType\":\"java.util.HashSet\",\"^ObjectID\":\"84\",\"^Value\":[\"decision\",\"org.kie.workbench.common.dmn.api.definition.v1_1.Decision\"]},\"content\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.ViewImpl\",\"^ObjectID\":\"85\",\"definition\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.definition.v1_1.Decision\",\"^ObjectID\":\"86\",\"stunnerLabels\":{\"^EncodedType\":\"java.util.HashSet\",\"^ObjectID\":\"87\",\"^Value\":[\"decision\"]},\"question\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Question\",\"^ObjectID\":\"88\",\"value\":\"My question\"},\"allowedAnswers\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.AllowedAnswers\",\"^ObjectID\":\"89\",\"value\":\"My allowed answers\"},\"variable\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.definition.v1_1.InformationItem\",\"^ObjectID\":\"90\",\"typeRef\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.QName\",\"^ObjectID\":\"91\",\"value\":\"My QName\"},\"name\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Name\",\"^ObjectID\":\"92\",\"value\":\"My name\"},\"id\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Id\",\"^ObjectID\":\"93\",\"value\":\"032E5CF5-C94A-4C39-84E2-35620F8F8F6E\"},\"label\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Label\",\"^ObjectID\":\"94\",\"value\":\"My label\"},\"description\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Description\",\"^ObjectID\":\"95\",\"readOnly\":false,\"value\":\"My description\"},\"otherAttributes\":{\"^EncodedType\":\"java.util.HashMap\",\"^ObjectID\":\"96\",\"^Value\":{}},\"extensionElements\":null,\"nameSpaces\":{\"^EncodedType\":\"java.util.HashMap\",\"^ObjectID\":\"97\",\"^Value\":{}}},\"expression\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.definition.v1_1.LiteralExpression\",\"^ObjectID\":\"98\",\"text\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Text\",\"^ObjectID\":\"99\",\"value\":\"My text\"},\"importedValues\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.definition.v1_1.ImportedValues\",\"^ObjectID\":\"100\",\"importedElement\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.ImportedElement\",\"^ObjectID\":\"101\",\"value\":\"My imported element\"},\"expressionLanguage\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.ExpressionLanguage\",\"^ObjectID\":\"102\",\"value\":\"My expression language\"},\"namespace\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Namespace\",\"^ObjectID\":\"103\",\"value\":\"My namespace\"},\"locationURI\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.LocationURI\",\"^ObjectID\":\"104\",\"value\":\"My LocationURI\"},\"importType\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.ImportType\",\"^ObjectID\":\"105\",\"value\":\"My import type\"},\"nameSpaces\":{\"^EncodedType\":\"java.util.HashMap\",\"^ObjectID\":\"106\",\"^Value\":{}}},\"expressionLanguage\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.ExpressionLanguage\",\"^ObjectID\":\"107\",\"value\":\"My expression language\"},\"typeRef\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.QName\",\"^ObjectID\":\"108\",\"value\":\"My QName\"},\"id\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Id\",\"^ObjectID\":\"109\",\"value\":\"896BD996-7AE7-478F-BDB5-835934A7D985\"},\"label\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Label\",\"^ObjectID\":\"110\",\"value\":\"My label\"},\"description\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Description\",\"^ObjectID\":\"111\",\"readOnly\":false,\"value\":\"My description\"},\"otherAttributes\":{\"^EncodedType\":\"java.util.HashMap\",\"^ObjectID\":\"112\",\"^Value\":{}},\"extensionElements\":null,\"nameSpaces\":{\"^EncodedType\":\"java.util.HashMap\",\"^ObjectID\":\"113\",\"^Value\":{}}},\"backgroundSet\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.background.BackgroundSet\",\"^ObjectID\":\"114\",\"bgColour\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.background.BgColour\",\"^ObjectID\":\"115\",\"readOnly\":false,\"value\":\"#ffffff\"},\"borderColour\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.background.BorderColour\",\"^ObjectID\":\"116\",\"readOnly\":false,\"value\":\"#000000\"},\"borderSize\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.background.BorderSize\",\"^ObjectID\":\"117\",\"readOnly\":false,\"value\":0.5}},\"fontSet\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.font.FontSet\",\"^ObjectID\":\"118\",\"fontFamily\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.font.FontFamily\",\"^ObjectID\":\"119\",\"readOnly\":false,\"value\":\"Open Sans\"},\"fontColour\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.font.FontColour\",\"^ObjectID\":\"120\",\"readOnly\":false,\"value\":\"#000000\"},\"fontSize\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.font.FontSize\",\"^ObjectID\":\"121\",\"readOnly\":false,\"value\":10.0},\"fontBorderSize\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.font.FontBorderSize\",\"^ObjectID\":\"122\",\"readOnly\":false,\"value\":0.0}},\"dimensionsSet\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dimensions.RectangleDimensionsSet\",\"^ObjectID\":\"123\",\"width\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dimensions.Width\",\"^ObjectID\":\"124\",\"readOnly\":false,\"value\":100.0},\"height\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dimensions.Height\",\"^ObjectID\":\"125\",\"readOnly\":false,\"value\":50.0}},\"name\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Name\",\"^ObjectID\":\"126\",\"value\":\"My name\"},\"id\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Id\",\"^ObjectID\":\"127\",\"value\":\"19FD47BD-0B35-4602-A767-7EE1AC909A8D\"},\"label\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Label\",\"^ObjectID\":\"128\",\"value\":\"My label\"},\"description\":{\"^EncodedType\":\"org.kie.workbench.common.dmn.api.property.dmn.Description\",\"^ObjectID\":\"129\",\"readOnly\":false,\"value\":\"My description\"},\"otherAttributes\":{\"^EncodedType\":\"java.util.HashMap\",\"^ObjectID\":\"130\",\"^Value\":{}},\"extensionElements\":null,\"nameSpaces\":{\"^EncodedType\":\"java.util.HashMap\",\"^ObjectID\":\"131\",\"^Value\":{}}},\"bounds\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.BoundsImpl\",\"^ObjectID\":\"132\",\"lr\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.BoundImpl\",\"^ObjectID\":\"133\",\"x\":564.0,\"y\":255.0},\"ul\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.BoundImpl\",\"^ObjectID\":\"134\",\"x\":464.0,\"y\":205.0}}}},\"53DED5E7-3942-4984-B6E4-04DDB980610E\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.impl.NodeImpl\",\"^ObjectID\":\"11\"},\"FB5A8959-B5AA-4040-99F2-A9B837409540\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.impl.NodeImpl\",\"^ObjectID\":\"7\"}}}},\"uuid\":\"D295C998-68E2-4C36-8457-BFA4477B9E52\",\"labels\":{\"^EncodedType\":\"java.util.HashSet\",\"^ObjectID\":\"135\",\"^Value\":[\"org.kie.workbench.common.dmn.api.DMNDefinitionSet\"]},\"content\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSetImpl\",\"^ObjectID\":\"136\",\"id\":\"org.kie.workbench.common.dmn.api.DMNDefinitionSet\",\"bounds\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.BoundsImpl\",\"^ObjectID\":\"137\",\"lr\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.BoundImpl\",\"^ObjectID\":\"138\",\"x\":1400.0,\"y\":700.0},\"ul\":{\"^EncodedType\":\"org.kie.workbench.common.stunner.core.graph.content.view.BoundImpl\",\"^ObjectID\":\"139\",\"x\":0.0,\"y\":0.0}}}}";
  13.  
  14.     @Test
  15.     public void testProva() throws IOException {
  16.         DMNMarshaller m = new DMNMarshaller( new XMLEncoderDiagramMetadataMarshaller() );
  17.        
  18.         Graph unmarshall = m.unmarshall(null, new ByteArrayInputStream( EXAMPLE_1.getBytes() ));
  19.        
  20.         System.out.println( unmarshall );
  21.     }
  22. }
  23.  
  24. ---
  25.  
  26. java.lang.NullPointerException
  27.     at org.jboss.errai.marshalling.client.MarshallingSessionProviderFactory.getDecoding(MarshallingSessionProviderFactory.java:48)
  28.     at org.jboss.errai.marshalling.server.ServerMarshalling.fromJSON(ServerMarshalling.java:32)
  29.     at org.jboss.errai.marshalling.server.ServerMarshalling.fromJSON(ServerMarshalling.java:37)
  30.     at org.kie.workbench.common.dmn.backend.DMNMarshaller.unmarshall(DMNMarshaller.java:49)
  31.     at org.kie.workbench.common.dmn.backend.MatteoTest.testProva(MatteoTest.java:18)
RAW Paste Data
Top