viatra / EMF-IncQuery

This repository is only kept for historic reasons. All development happens on eclipse.org
http://eclipse.org/viatra
13 stars 4 forks source link

IncQueryBase returns inverted Settings on getInverseReferences #372

Closed abelhegedus closed 11 years ago

abelhegedus commented 11 years ago

The Setting objects returned by NavigationHelper.getInverseReferences(EObject target) (and its variant) are target->source instead of source->target. You can test by comparing with EcoreUtil.UsageCrossReferencer.find().

Relevant lines in NavigationHelperImpl: 258, 275

I see that the methods are tested, but I was unable to find the test case that calls them.

szabta89 commented 11 years ago

@abelhegedus Yes, those should be reversed. If you check the call hierarchy in Eclipse you can easily find the InverseReferenceTest which tests that specific method. At the moment, the test only checks the size of the result set so it needs to be extended.

abelhegedus commented 11 years ago

True, I did not have the base.test project checked out.

szabta89 commented 11 years ago

https://github.com/ujhelyiz/EMF-IncQuery-Examples/commit/02cda3ff0dd26db100679ee91e512a3ef7e5c8df InverseReferenceTest asserts the target of the Setting.

istvanrath commented 11 years ago

@abelhegedus please test this.

abelhegedus commented 11 years ago

Fixed.