Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » EMF Compare fails
EMF Compare fails [message #138531] Tue, 14 July 2009 10:26 Go to next message
No real name is currently offline No real nameFriend
Messages: 61
Registered: July 2009
Member
Hi,

I'm trying to use EMF Compare programmaticly:

MatchModel match = MatchService.doMatch(referenceModel,
createdModel, Collections.<String, Object> emptyMap());
// Computing differences
DiffModel diff = DiffService.doDiff(match, false);

Both models are UML-models and they do exist (are not null).

Unfortunatly, the first line already throws a NullPointerException:

java.lang.NullPointerException
at
org.eclipse.emf.compare.match.engine.GenericMatchEngine.mode lMatch(GenericMatchEngine.java:356)
at
org.eclipse.emf.compare.match.service.MatchService.doMatch(M atchService.java:160)
at
alltests.ParentT2MAndM2TTestCase.testT2M(ParentT2MAndM2TTest Case.java:246)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall( FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(Refl ectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr ameworkMethod.java:41)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate( InvokeMethod.java:20)
at
org.junit.internal.runners.statements.RunBefores.evaluate(Ru nBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(Run Afters.java:31)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit 4ClassRunner.java:73)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit 4ClassRunner.java:46)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java :180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java: 41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java: 173)
at
org.junit.internal.runners.statements.RunBefores.evaluate(Ru nBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(Run Afters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at org.junit.runners.Suite.runChild(Suite.java:115)
at org.junit.runners.Suite.runChild(Suite.java:23)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java :180)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java: 41)
at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java: 173)
at
org.junit.internal.runners.statements.RunBefores.evaluate(Ru nBefores.java:28)
at
org.junit.internal.runners.statements.RunAfters.evaluate(Run Afters.java:31)
at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.r un(JUnit4TestReference.java:46)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:390)
at
org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunne r.main(RemotePluginTestRunner.java:62)
at
org.eclipse.pde.internal.junit.runtime.CoreTestApplication.r un(CoreTestApplication.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.eclipse.equinox.internal.app.EclipseAppContainer.callMet hodWithException(EclipseAppContainer.java:574)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:368)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)


What am I doint wrong?



Thank you
Re: EMF Compare fails [message #138609 is a reply to message #138531] Wed, 15 July 2009 08:10 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060502000508020604010806
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Usul,

Judging by the fact you're calling the comparison from unit tests and
the failure appears right off the bat, my best guess is that you're
calling MatchService.doMatch() on models that are not contained within
Resources. You can either
1) call MatchService.doContentMatch() instead (that would see all
inter-model differences as "Add" or "Remove" operations)
or
2) create Resources to contain your models and possibly create a
ResourceSet to contain these Resources and then call
MatchService.doMatch() on it.

Laurent Goubet
Obeo

Usul a
Re: EMF Compare fails [message #138657 is a reply to message #138609] Wed, 15 July 2009 17:46 Go to previous message
No real name is currently offline No real nameFriend
Messages: 61
Registered: July 2009
Member
OK, thank you, that solved it.
Re: EMF Compare fails [message #621133 is a reply to message #138531] Wed, 15 July 2009 08:10 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060502000508020604010806
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit

Hi Usul,

Judging by the fact you're calling the comparison from unit tests and
the failure appears right off the bat, my best guess is that you're
calling MatchService.doMatch() on models that are not contained within
Resources. You can either
1) call MatchService.doContentMatch() instead (that would see all
inter-model differences as "Add" or "Remove" operations)
or
2) create Resources to contain your models and possibly create a
ResourceSet to contain these Resources and then call
MatchService.doMatch() on it.

Laurent Goubet
Obeo

Usul a
Re: EMF Compare fails [message #621137 is a reply to message #138609] Wed, 15 July 2009 17:46 Go to previous message
No real name is currently offline No real nameFriend
Messages: 61
Registered: July 2009
Member
OK, thank you, that solved it.
Previous Topic:[EMF Compare] Conflicting should be true, but is false
Next Topic:Is EMF Compare right for this use-case?
Goto Forum:
  


Current Time: Fri Mar 01 12:21:25 GMT 2024

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

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

Back to the top