package jetbrains.mps.ide.vcs.test.merge;
/*Generated by MPS */
import org.junit.Test;
import jetbrains.mps.baseLanguage.closures.runtime._FunctionTypes;
import jetbrains.mps.vcs.diff.changes.ModelChange;
import org.jetbrains.mps.openapi.model.SNode;
import jetbrains.mps.vcs.diff.changes.SetPropertyStructChange;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import jetbrains.mps.vcs.diff.changes.NodeGroupStructChange;
import jetbrains.mps.internal.collections.runtime.ListSequence;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SNodeOperations;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import jetbrains.mps.internal.collections.runtime.IWhereFilter;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SPropertyOperations;
import jetbrains.mps.lang.smodel.generator.smodelAdapter.SLinkOperations;
import jetbrains.mps.vcs.diff.changes.SetReferenceStructChange;
import jetbrains.mps.vcs.diff.StructChangeSet;
import jetbrains.mps.vcs.diff.StructChangeSetBuilder;
import jetbrains.mps.internal.collections.runtime.Sequence;
import jetbrains.mps.internal.collections.runtime.ISelector;
import jetbrains.mps.internal.collections.runtime.ILeftCombinator;
import org.junit.Assert;
/**
* Check correctness of diff algorithm
*/
public class StructuredChangesCalculationTest extends ChangesTestBase {
@Test
public void changeProperty() {
// public void f0() {} =>
// public void f0a() {}
testDiffCorectness(0, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
return new ModelChange[]{new SetPropertyStructChange(getChangeSet(), n1.getNodeId(), n2.getNodeId(), MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"), "f0a")};
}
});
}
@Test
public void changeBooleanProperty() {
// public void f1() {} =>
// public final void f1() {}
testDiffCorectness(1, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
return new ModelChange[]{new SetPropertyStructChange(getChangeSet(), n1.getNodeId(), n2.getNodeId(), MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b1fcL, 0x113294bffd2L, "isFinal"), "true")};
}
});
}
@Test
public void replaceSingleChild() {
// public int f2() {} =>
// public string f2() {}
testDiffCorectness(2, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
return new ModelChange[]{new NodeGroupStructChange(getChangeSet(), n1.getNodeId(), n2.getNodeId(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b1fcL, 0xf8cc56b1fdL, "returnType"), 0, 1, 0, 1)};
}
});
}
@Test
public void deleteSingleChild() {
// public void f3() { int var = 7; } =>
// public void f3() { int var; }
testDiffCorectness(3, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
SNode n11 = ListSequence.fromList(SNodeOperations.getNodeDescendants(n1, MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7efL, "jetbrains.mps.baseLanguage.structure.LocalVariableDeclaration"), false, new SAbstractConcept[]{})).findFirst(new IWhereFilter<SNode>() {
public boolean accept(SNode n) {
return eq_8ul4jo_a0a0a0a0a0a0a0a0b0c0f(SPropertyOperations.getString(n, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")), "var");
}
});
SNode n21 = ListSequence.fromList(SNodeOperations.getNodeDescendants(n2, MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7efL, "jetbrains.mps.baseLanguage.structure.LocalVariableDeclaration"), false, new SAbstractConcept[]{})).findFirst(new IWhereFilter<SNode>() {
public boolean accept(SNode n) {
return eq_8ul4jo_a0a0a0a0a0a1a0a0b0c0f(SPropertyOperations.getString(n, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")), "var");
}
});
return new ModelChange[]{new NodeGroupStructChange(getChangeSet(), n11.getNodeId(), n21.getNodeId(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37a7f6eL, 0xf8c37f506eL, "initializer"), 0, 1, 0, 0)};
}
});
}
@Test
public void addSingleChild() {
// public void f4() { int var; } =>
// public void f4() { int var = 12 + (9 - 8) * 7; }
testDiffCorectness(4, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
SNode n11 = ListSequence.fromList(SNodeOperations.getNodeDescendants(n1, MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7efL, "jetbrains.mps.baseLanguage.structure.LocalVariableDeclaration"), false, new SAbstractConcept[]{})).findFirst(new IWhereFilter<SNode>() {
public boolean accept(SNode n) {
return eq_8ul4jo_a0a0a0a0a0a0a0a0b0c0g(SPropertyOperations.getString(n, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")), "var");
}
});
SNode n21 = ListSequence.fromList(SNodeOperations.getNodeDescendants(n2, MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7efL, "jetbrains.mps.baseLanguage.structure.LocalVariableDeclaration"), false, new SAbstractConcept[]{})).findFirst(new IWhereFilter<SNode>() {
public boolean accept(SNode n) {
return eq_8ul4jo_a0a0a0a0a0a1a0a0b0c0g(SPropertyOperations.getString(n, MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")), "var");
}
});
return new ModelChange[]{new NodeGroupStructChange(getChangeSet(), n11.getNodeId(), n21.getNodeId(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37a7f6eL, 0xf8c37f506eL, "initializer"), 0, 0, 0, 1)};
}
});
}
@Test
public void deleteChild() {
// public void f5(int a, int b, int c, int d) { } =>
// public void f5(int a, int c, int d) { }
testDiffCorectness(5, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
return new ModelChange[]{new NodeGroupStructChange(getChangeSet(), n1.getNodeId(), n2.getNodeId(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b1fcL, 0xf8cc56b1feL, "parameter"), 1, 2, 1, 1)};
}
});
}
@Test
public void deleteChildren() {
// public void f6(int a, int b, int c, int d, int e) { } =>
// public void f6(int a, int b, int e) { }
testDiffCorectness(6, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
return new ModelChange[]{new NodeGroupStructChange(getChangeSet(), n1.getNodeId(), n2.getNodeId(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b1fcL, 0xf8cc56b1feL, "parameter"), 2, 4, 2, 2)};
}
});
}
@Test
public void addChild() {
// public void f7(int a, int c, int d) { } =>
// public void f7(int a, int b, int c, int d) { }
testDiffCorectness(7, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
return new ModelChange[]{new NodeGroupStructChange(getChangeSet(), n1.getNodeId(), n2.getNodeId(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b1fcL, 0xf8cc56b1feL, "parameter"), 1, 1, 1, 2)};
}
});
}
@Test
public void addChildren() {
// public void f8(int a, int e) { } =>
// public void f8(int a, int b, int c, int d, int e) { }
testDiffCorectness(8, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
return new ModelChange[]{new NodeGroupStructChange(getChangeSet(), n1.getNodeId(), n2.getNodeId(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b1fcL, 0xf8cc56b1feL, "parameter"), 1, 1, 1, 4)};
}
});
}
@Test
public void replaceChildren() {
// public void f9() { //xx; int a = 5; int b = 6; int c = 7; int d = 8; } =>
// public void f9() { //xx; int a = 5; a = 8; a++; a = a + 9; int d = 8; }
testDiffCorectness(9, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
return new ModelChange[]{new NodeGroupStructChange(getChangeSet(), SLinkOperations.getTarget(n1, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b1fcL, 0xf8cc56b1ffL, "body")).getNodeId(), SLinkOperations.getTarget(n2, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b1fcL, 0xf8cc56b1ffL, "body")).getNodeId(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b200L, 0xf8cc6bf961L, "statement"), 2, 4, 2, 5)};
}
});
}
@Test
public void changeReference() {
// public void f10(int a, int b) { a = 10; } =>
// public void f10(int a, int b) { b = 10; }
testDiffCorectness(10, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
SNode n11 = ListSequence.fromList(SNodeOperations.getNodeDescendants(SLinkOperations.getTarget(n1, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b1fcL, 0xf8cc56b1ffL, "body")), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c77f1e98L, "jetbrains.mps.baseLanguage.structure.VariableReference"), false, new SAbstractConcept[]{})).first();
SNode n21 = ListSequence.fromList(SNodeOperations.getNodeDescendants(SLinkOperations.getTarget(n2, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b1fcL, 0xf8cc56b1ffL, "body")), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c77f1e98L, "jetbrains.mps.baseLanguage.structure.VariableReference"), false, new SAbstractConcept[]{})).first();
SNode target = ListSequence.fromList(SLinkOperations.getChildren(n2, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b1fcL, 0xf8cc56b1feL, "parameter"))).getElement(1);
return new ModelChange[]{new SetReferenceStructChange(getChangeSet(), n11.getNodeId(), n21.getNodeId(), MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c77f1e98L, 0xf8cc6bf960L, "variableDeclaration"), SNodeOperations.getModel(target).getReference(), target.getNodeId(), "b")};
}
});
}
@Test
public void sameReferenceToParent() {
// public void f11() { f11(); } =>
// public void f11() { f11(); }
testDiffCorectness(11, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
return new ModelChange[]{};
}
});
}
@Test
public void similarReferenceInModel() {
// public void f12() { n = 10; } =>
// public void f12() { n = 10; }
testDiffCorectness(12, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
SNode n11 = ListSequence.fromList(SNodeOperations.getNodeDescendants(SLinkOperations.getTarget(n1, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b1fcL, 0xf8cc56b1ffL, "body")), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c77f1e98L, "jetbrains.mps.baseLanguage.structure.VariableReference"), false, new SAbstractConcept[]{})).first();
SNode n21 = ListSequence.fromList(SNodeOperations.getNodeDescendants(SLinkOperations.getTarget(n2, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc56b1fcL, 0xf8cc56b1ffL, "body")), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c77f1e98L, "jetbrains.mps.baseLanguage.structure.VariableReference"), false, new SAbstractConcept[]{})).first();
SNode target = SLinkOperations.getTarget(n21, MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c77f1e98L, 0xf8cc6bf960L, "variableDeclaration"));
return new ModelChange[]{new SetReferenceStructChange(getChangeSet(), n11.getNodeId(), n21.getNodeId(), MetaAdapterFactory.getReferenceLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c77f1e98L, 0xf8cc6bf960L, "variableDeclaration"), SNodeOperations.getModel(target).getReference(), target.getNodeId(), "n")};
}
});
}
@Test
public void sameOutsideReference() {
// public void f13() { System.out.println(Root.class); } =>
// public void f13() { System.out.println(Root.class); }
testDiffCorectness(13, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
return new ModelChange[]{};
}
});
}
@Test
public void sameDescendantReference() {
// public void f14() { //todo } =>
// public void f14() { //todo }
testDiffCorectness(14, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
return new ModelChange[]{};
}
});
}
@Test
public void sameInnerReferences() {
// public void f15() { } =>
// public void f15() { }
testDiffCorectness(15, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
return new ModelChange[]{};
}
});
}
@Test
public void sameReferencesToFirstModel() {
// public void f17() { new Test1(); } =>
// public void f17() { new Test1(); }
testDiffCorectness(17, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
return new ModelChange[]{};
}
});
}
@Test
public void maximumCommonLength() {
// public void f16(int ... params) { f16(0, 1+1, 2*2, 3-3, 4/4); } =>
// public void f16(int ... params) { f16(0, 1, 3-3, 2*2, 3-3, 4/4, 3-3); }
testDiffCorectness(16, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
SNode n11 = ListSequence.fromList(SNodeOperations.getNodeDescendants(n1, MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x6c6b6a1e379f9404L, "jetbrains.mps.baseLanguage.structure.LocalMethodCall"), false, new SAbstractConcept[]{})).first();
SNode n21 = ListSequence.fromList(SNodeOperations.getNodeDescendants(n2, MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x6c6b6a1e379f9404L, "jetbrains.mps.baseLanguage.structure.LocalMethodCall"), false, new SAbstractConcept[]{})).first();
return new ModelChange[]{new NodeGroupStructChange(getChangeSet(), n11.getNodeId(), n21.getNodeId(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301aeL, "actualArgument"), 1, 2, 1, 3), new NodeGroupStructChange(getChangeSet(), n11.getNodeId(), n21.getNodeId(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301aeL, "actualArgument"), 5, 5, 6, 7)};
}
});
}
@Test
public void similarNodesDeepComparison() {
// public void f18(int ... params) { f18(0, 1+1, 2*2, 3-3, 4/4); } =>
// public void f18(int ... params) { f18(0, 1+2, 3-3, 2*2, 3-3, 4/4, 3-3); }
testDiffCorectness(18, new _FunctionTypes._return_P2_E0<ModelChange[], SNode, SNode>() {
public ModelChange[] invoke(SNode n1, SNode n2) {
SNode n11 = ListSequence.fromList(SNodeOperations.getNodeDescendants(n1, MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x6c6b6a1e379f9404L, "jetbrains.mps.baseLanguage.structure.LocalMethodCall"), false, new SAbstractConcept[]{})).first();
SNode n21 = ListSequence.fromList(SNodeOperations.getNodeDescendants(n2, MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x6c6b6a1e379f9404L, "jetbrains.mps.baseLanguage.structure.LocalMethodCall"), false, new SAbstractConcept[]{})).first();
SNode n12 = SNodeOperations.cast(SLinkOperations.getTarget(SNodeOperations.cast(ListSequence.fromList(SLinkOperations.getChildren(n11, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301aeL, "actualArgument"))).getElement(1), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7fbL, "jetbrains.mps.baseLanguage.structure.PlusExpression")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbdeb6fecfL, 0xfbdeb7a11bL, "rightExpression")), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc59b314L, "jetbrains.mps.baseLanguage.structure.IntegerConstant"));
SNode n22 = SNodeOperations.cast(SLinkOperations.getTarget(SNodeOperations.cast(ListSequence.fromList(SLinkOperations.getChildren(n21, MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301aeL, "actualArgument"))).getElement(1), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc67c7fbL, "jetbrains.mps.baseLanguage.structure.PlusExpression")), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xfbdeb6fecfL, 0xfbdeb7a11bL, "rightExpression")), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc59b314L, "jetbrains.mps.baseLanguage.structure.IntegerConstant"));
return new ModelChange[]{new NodeGroupStructChange(getChangeSet(), n11.getNodeId(), n21.getNodeId(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301aeL, "actualArgument"), 2, 2, 2, 3), new NodeGroupStructChange(getChangeSet(), n11.getNodeId(), n21.getNodeId(), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x11857355952L, 0xf8c78301aeL, "actualArgument"), 5, 5, 6, 7), new SetPropertyStructChange(getChangeSet(), n12.getNodeId(), n22.getNodeId(), MetaAdapterFactory.getProperty(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8cc59b314L, 0xf8cc59b315L, "value"), "2")};
}
});
}
private StructChangeSet getChangeSet() {
return StructChangeSetBuilder.buildChangeSet(SNodeOperations.getNode("r:296ba97d-4b26-4d06-be61-297d86180cce(jetbrains.mps.ide.vcs.test.testModel)", "5876208808348821705"), SNodeOperations.getNode("r:296ba97d-4b26-4d06-be61-297d86180cce(jetbrains.mps.ide.vcs.test.testModel)", "5876208808348821705"), false);
}
private static String toString(Iterable<ModelChange> changes) {
return Sequence.fromIterable(changes).select(new ISelector<ModelChange, String>() {
public String select(ModelChange it) {
return it.toString();
}
}).sort(new ISelector<String, String>() {
public String select(String it) {
return it;
}
}, true).reduceLeft(new ILeftCombinator<String, String>() {
public String combine(String a, String b) {
return a + "\n" + b;
}
});
}
private void testDiffCorrectness(SNode n1, SNode n2, ModelChange... changes) {
StructChangeSet diff = StructChangeSetBuilder.buildChangeSet(n1, n2, false);
Assert.assertEquals(toString(Sequence.fromArray(changes)), toString(diff.getModelChanges()));
}
private void testDiffCorectness(final int ix, final _FunctionTypes._return_P2_E0<? extends ModelChange[], ? super SNode, ? super SNode> ch) {
ourProject.getModelAccess().runReadAction(new Runnable() {
public void run() {
// test with the same model
SNode n1 = SNodeOperations.cast(ListSequence.fromList(SLinkOperations.getChildren(SNodeOperations.getNode("r:e71f8bf8-158e-40c6-bd90-ff2f1a21d867(jetbrains.mps.ide.vcs.test.testdiff)", "2193727838071558326"), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101d9d3ca30L, 0x4a9a46de59132803L, "member"))).getElement(ix), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x6c6b6a1e379f9408L, "jetbrains.mps.baseLanguage.structure.MethodDeclaration"));
SNode n2 = SNodeOperations.cast(ListSequence.fromList(SLinkOperations.getChildren(SNodeOperations.getNode("r:e71f8bf8-158e-40c6-bd90-ff2f1a21d867(jetbrains.mps.ide.vcs.test.testdiff)", "2193727838071561667"), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101d9d3ca30L, 0x4a9a46de59132803L, "member"))).getElement(ix), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x6c6b6a1e379f9408L, "jetbrains.mps.baseLanguage.structure.MethodDeclaration"));
ModelChange[] changes = ch.invoke(n1, n2);
testDiffCorrectness(n1, n2, changes);
// test with other model
SNode n3 = SNodeOperations.cast(ListSequence.fromList(SLinkOperations.getChildren(SNodeOperations.getNode("r:f9cefa7f-7dcc-422d-acd3-c452503bcca5(jetbrains.mps.ide.vcs.test.testdiff2)", "2193727838071561667"), MetaAdapterFactory.getContainmentLink(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x101d9d3ca30L, 0x4a9a46de59132803L, "member"))).getElement(ix), MetaAdapterFactory.getConcept(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0x6c6b6a1e379f9408L, "jetbrains.mps.baseLanguage.structure.MethodDeclaration"));
ModelChange[] changes2 = ch.invoke(n1, n3);
testDiffCorrectness(n1, n3, changes2);
}
});
}
private static boolean eq_8ul4jo_a0a0a0a0a0a0a0a0b0c0f(Object a, Object b) {
return (a != null ? a.equals(b) : a == b);
}
private static boolean eq_8ul4jo_a0a0a0a0a0a1a0a0b0c0f(Object a, Object b) {
return (a != null ? a.equals(b) : a == b);
}
private static boolean eq_8ul4jo_a0a0a0a0a0a0a0a0b0c0g(Object a, Object b) {
return (a != null ? a.equals(b) : a == b);
}
private static boolean eq_8ul4jo_a0a0a0a0a0a1a0a0b0c0g(Object a, Object b) {
return (a != null ? a.equals(b) : a == b);
}
}