]> gerrit.simantics Code Review - simantics/interop.git/commitdiff
Improve Proteus property comparison
authorluukkainen <luukkainen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 4 Jul 2016 13:32:53 +0000 (13:32 +0000)
committerMarko Luukkainen <marko.luukkainen@vtt.fi>
Thu, 2 Feb 2017 12:01:34 +0000 (14:01 +0200)
refs #6560

git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@32949 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.interop/src/org/simantics/interop/test/GraphComparator.java

index e20c83e10b2ef021c1b8218e1ae7aab0e6ff6363..72a975f790789e1d3f2971683b4fed07fd15a9fd 100644 (file)
@@ -205,6 +205,10 @@ public class GraphComparator {
        }\r
        \r
        public void test(Session session) throws DatabaseException {\r
+               test(session, r1, r2);\r
+       }\r
+       \r
+       public void test(Session session, Resource r1, Resource r2) throws DatabaseException {\r
                \r
                comparator.setComparator(this);\r
                \r
@@ -349,8 +353,7 @@ public class GraphComparator {
                                                addComparable(leftS, rightS, false);\r
                                        }\r
                                }\r
-                       }\r
-                       \r
+                       }               \r
                }\r
        }\r
        \r
@@ -856,7 +859,7 @@ public class GraphComparator {
                                        break;\r
                                } else {\r
                                        while (i2 < ss2.size()) {\r
-                                               if (DEBUG) System.out.println("Compare Statements diff2 " + printStatement(g,ss2.get(i2)));\r
+                                               if (DEBUG) System.out.println("Compare Statements addition " + printStatement(g,ss2.get(i2)));\r
                                                \r
                                                addAddition(ss2.get(i2));\r
                                                i2++;\r
@@ -865,7 +868,7 @@ public class GraphComparator {
                                }\r
                        } else if (i2 >= ss2.size()) {\r
                                while (i1 < ss1.size()) {\r
-                                       if (DEBUG) System.out.println("Compare Statements diff1 " + printStatement(g,ss1.get(i1)));\r
+                                       if (DEBUG) System.out.println("Compare Statements deletion " + printStatement(g,ss1.get(i1)));\r
                                        addDeletion(ss1.get(i1));\r
                                        i1++;\r
                                }\r
@@ -880,13 +883,13 @@ public class GraphComparator {
                                i2+=same2;\r
                        } else if (c < 0) {\r
                                for (int i = 0; i < same1; i++) {\r
-                                       if (DEBUG) System.out.println("Compare Statements diff1 " + printStatement(g,ss1.get(i+i1)));\r
+                                       if (DEBUG) System.out.println("Compare Statements deletion " + printStatement(g,ss1.get(i+i1)));\r
                                        addDeletion(ss1.get(i+i1));\r
                                }\r
                                i1 += same1;\r
                        } else {\r
                                for (int i = 0; i < same2; i++) {\r
-                                       if (DEBUG) System.out.println("Compare Statements diff2 " + printStatement(g,ss2.get(i+i2)));\r
+                                       if (DEBUG) System.out.println("Compare Statements addition " + printStatement(g,ss2.get(i+i2)));\r
                                        addAddition(ss2.get(i+i2));\r
                                }\r
                                \r
@@ -1036,13 +1039,13 @@ public class GraphComparator {
                }\r
                for (int i1 = off1; i1 < off1 + len1; i1++) {\r
                        if (!used1[i1-off1]) {\r
-                               if (DEBUG) System.out.println("Compare Object diff1 " + printStatement(g,ss1.get(i1)));\r
+                               if (DEBUG) System.out.println("Compare Object deletion " + printStatement(g,ss1.get(i1)));\r
                                addDeletion(ss1.get(i1));\r
                        }\r
                }\r
                for (int i2 = off2; i2 < off2 + len2; i2++) {\r
                        if (!used2[i2-off2]) {\r
-                               if (DEBUG) System.out.println("Compare Object diff2 " + printStatement(g,ss2.get(i2)));\r
+                               if (DEBUG) System.out.println("Compare Object addition " + printStatement(g,ss2.get(i2)));\r
                                addAddition(ss2.get(i2));\r
                        }\r
                }\r