Search in sources :

Example 11 with GraphNodeStoreImpl

use of org.kie.workbench.common.stunner.core.graph.store.GraphNodeStoreImpl in project kie-wb-common by kiegroup.

the class HashCodeAndEqualityTest method testGraphHashCode.

@Test
public void testGraphHashCode() {
    GraphImpl<String> a = new GraphImpl<String>("Graph", new GraphNodeStoreImpl());
    GraphImpl<String> b = new GraphImpl<String>("Graph", new GraphNodeStoreImpl());
    assertEquals(a.hashCode(), b.hashCode());
    NodeImpl<String> node = new NodeImpl<>("Node");
    a.addNode(node);
    assertNotEquals(a.hashCode(), b.hashCode());
    b.addNode(node);
    assertEquals(a.hashCode(), b.hashCode());
    assertEquals(a.hashCode(), a.hashCode());
}
Also used : GraphNodeStoreImpl(org.kie.workbench.common.stunner.core.graph.store.GraphNodeStoreImpl) NodeImpl(org.kie.workbench.common.stunner.core.graph.impl.NodeImpl) GraphImpl(org.kie.workbench.common.stunner.core.graph.impl.GraphImpl) Test(org.junit.Test)

Aggregations

GraphNodeStoreImpl (org.kie.workbench.common.stunner.core.graph.store.GraphNodeStoreImpl)11 GraphImpl (org.kie.workbench.common.stunner.core.graph.impl.GraphImpl)10 Test (org.junit.Test)8 NodeImpl (org.kie.workbench.common.stunner.core.graph.impl.NodeImpl)7 Graph (org.kie.workbench.common.stunner.core.graph.Graph)2 Definition (org.kie.workbench.common.stunner.core.graph.content.definition.Definition)2 DefinitionSetImpl (org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSetImpl)2 BoundImpl (org.kie.workbench.common.stunner.core.graph.content.view.BoundImpl)2 BoundsImpl (org.kie.workbench.common.stunner.core.graph.content.view.BoundsImpl)2 Annotation (java.lang.annotation.Annotation)1 HashMap (java.util.HashMap)1 Before (org.junit.Before)1 CaseManagementDiagram (org.kie.workbench.common.stunner.cm.definition.CaseManagementDiagram)1 ZoomControl (org.kie.workbench.common.stunner.core.client.canvas.controls.zoom.ZoomControl)1 Diagram (org.kie.workbench.common.stunner.core.diagram.Diagram)1 DiagramImpl (org.kie.workbench.common.stunner.core.diagram.DiagramImpl)1 MetadataImpl (org.kie.workbench.common.stunner.core.diagram.MetadataImpl)1 Node (org.kie.workbench.common.stunner.core.graph.Node)1 DefinitionSet (org.kie.workbench.common.stunner.core.graph.content.definition.DefinitionSet)1 MapIndex (org.kie.workbench.common.stunner.core.graph.processing.index.map.MapIndex)1