Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » EMF Compare Customization (FIXED)(EMF Customization test failing. Need help in fixing the customization/test)
EMF Compare Customization (FIXED) [message #1730999] Mon, 02 May 2016 04:15 Go to next message
Neeraj Bhusare is currently offline Neeraj BhusareFriend
Messages: 177
Registered: July 2009
Location: Canada
Senior Member
Hi All,

I have created a language (Xtext) [0] that allows defining Java like Classes (named SmallClazz) and attributes in it. The attribute has a name and a DataType. The DataType is of BasicType or ClassType. Please note that a ClassType represents a reference to the SmallClazz instance.

I am working on an sample project [1] that makes use of EMF Compare to find the differences betwee the instances of SmallClazz type. As outlined in the developer guide [2], I have cutomized the DiffBuilder [3] and ignored few compare phases [4] that are not of my interest.

I have a set of unit-tests [5] for the above EMF Compare customizations. All the tests are green except the one that tries to test the changes made to the attribute DataType [6]. To be very specific, the change to the datatype is from a ClassType (Foo) to another ClassType (Bar). Now, I have gree tests [7] for changes to datatype from - BasicType to another BasicType, and BasicType to ClassType.

Based on my investigation, I found that the Match object that matches the two ClassType (Foo and Bar) instances contains a null differences list [8]. As a workaround, I customized the Matcher to make use of the referred SmallClazz name while matching the ClasstType instances [9], but that leads to a NPE [10]. I was not successful in finding the cause. I'll be greatful if someone could explain.

Am I missing something here ?

I am on Mars.2 Release (4.5.2), EMF Compare 3.1.1.201509120604.

[0] https://goo.gl/NfBaVd
[1] https://goo.gl/w4YkHT
[2] https://goo.gl/KmNbAE
[3] https://goo.gl/9VptVI
[4] https://goo.gl/xG9zjq - See methods : getCustomEquivalenceEngine(), getCustomConflictDetector() and getCustomDiffEngine()
[5] https://goo.gl/P78rzh
[6] https://goo.gl/P78rzh - See test : testAttributeDataTypeChangedFromClassTypeToClassType()
[7] https://goo.gl/P78rzh - See tests : testAttributeDataTypeChangedFromBasicTypeToBasicType(), testAttributeDataTypeChangedFromBasicTypeToClassType()
[8] https://goo.gl/g0SPrU
[9] https://goo.gl/rnMeUI - See method : getCustomMatcher(), line 102.
[10] https://goo.gl/JeIURM

Tx in advance.


Twitter : @NeerajBhusare
Blog : https://nbhusare.github.io/
Best regards, Neeraj

[Updated on: Thu, 12 May 2016 00:43]

Report message to a moderator

Re: EMF Compare Customization (FIXED) [message #1732023 is a reply to message #1730999] Thu, 12 May 2016 00:42 Go to previous messageGo to next message
Neeraj Bhusare is currently offline Neeraj BhusareFriend
Messages: 177
Registered: July 2009
Location: Canada
Senior Member
Hi,

I was able to fix the issue. The solution was to alter - A) Structure of the model, B) Custom Matcher. I introduced "Namespace" in the new model that contains the SmallClazz object. Secondly, the custom Matcher now makes use of the fully-qualified-name while matching two SmallClazz objects and uses simple-name while matching the ClassType datatype objects.

I have created a new repo. that contains the solution - https://github.com/nbhusare/EMF-Compare . The unit-tests can be found here - https://goo.gl/HqmVQH.

Tx.


Twitter : @NeerajBhusare
Blog : https://nbhusare.github.io/
Best regards, Neeraj
Re: EMF Compare Customization (FIXED) [message #1732584 is a reply to message #1732023] Wed, 18 May 2016 11:26 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

Thanks for the repositories, we'll try and have a look to see if we have a bug of some sort on our side.

Laurent Goubet
Obeo

[Updated on: Wed, 18 May 2016 04:22]

Report message to a moderator

Previous Topic:[EMF Compare] Cannot find Diff and Match plugins
Next Topic:[EMF Compare] Problem with EMF Synchronization Model
Goto Forum:
  


Current Time: Thu Apr 25 13:41:32 GMT 2024

Powered by FUDForum. Page generated in 0.03495 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top