sebastianbenz / Jnario

Executable specifications for Java
136 stars 38 forks source link

Upgrade Xtext to 2.7 #159

Closed gzunino closed 9 years ago

gzunino commented 9 years ago

Most xtext based plugins already depends on Xtext 2.7.

Jnario is on 2.7, which makes imposible to use it togheter with other xtext based plugins (e.g. XCore)

When Jnario is installed and also Xtext 2.7 is installed it gives errors while editing feature or spec files.

An internal error occurred during: "XtextReconcilerJob".
loader constraint violation: when resolving method "org.jnario.jvmmodel.ExtendedJvmTypesBuilder.toMethod(Lorg/eclipse/emf/ecore/EObject;Ljava/lang/String;Lorg/eclipse/xtext/common/types/JvmTypeReference;Lorg/eclipse/xtext/xbase/lib/Procedures$Procedure1;)Lorg/eclipse/xtext/common/types/JvmOperation;" the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) of the current class, org/jnario/feature/jvmmodel/FeatureJvmModelInferrer, and the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) for resolved class, org/jnario/jvmmodel/ExtendedJvmTypesBuilder, have different Class objects for the type e/emf/ecore/EObject;Ljava/lang/String;Lorg/eclipse/xtext/common/types/JvmTypeReference;Lorg/eclipse/xtext/xbase/lib/Procedures$Procedure1;)Lorg/eclipse/xtext/common/types/JvmOperation; used in the signature

If you provide a snapshot based on Xtext 2.7, I'll be happy to test it.

Regards,

sebastianbenz commented 9 years ago

You can find a first version that is compatible to xtend 2.7 here: http://www.jnario.org/updates/snapshot/

gzunino commented 9 years ago

I installled the snapshot version based on xtext 2.7.2. Editor and compiler works fine. But I'm having a problem trying to execute Jnario features as "Junit Plug-in Tests". They worked just fine with Jnario 1.0. But failed on Jnario 1.1.

Exception in thread "Plug-in Tests Runner" java.lang.IllegalArgumentException: Bundle "org.eclipse.jdt.junit4.runtime.patch" not found. Possible causes include missing dependencies, too restrictive version ranges, or a non-matching required execution environment.

The problem seems to be in plugin org.eclipse.jdt.junit.runners, which is new on 1.1.0 (couldn't find it on jnario 1.0) and part of the org.jnario.ui feature.

Comparing launch argument with jnario 1.0 I see a difference on the testLoaderClass and loaderpluginname arguments (below), which refer to this new plugin. I tried adding the new plugin to my target platform and as a dependecy to my test plugin but still get the same error.

Launch Arguments for Jnario 1.1.0:

Framework arguments: -version 3 -port 54858 -testLoaderClass org.eclipse.jdt.junit4.runtime.patch.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime.patch -classNames ... Command-line arguments: -os linux -ws gtk -arch x86_64 -consoleLog -version 3 -port 54858 -testLoaderClass org.eclipse.jdt.junit4.runtime.patch.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime.patch -classNames ...

Launch Arguments for Jnario 1.0.0:

Framework arguments: -version 3 -port 44381 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -classNames ... Command-line arguments: -os linux -ws gtk -arch x86_64 -consoleLog -version 3 -port 44381 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -classNames ...

I couldn't find plugin org.eclipse.jdt.junit4.runtime.patch on jnario update site. Could it be that referente to org.eclipse.jdt.junit4.runtime.patch should actually be org.eclipse.jdt.junit.runners ?

To reproduce try to run any .feature as Junit Test Plugin.

Thanks in advance. Best regards,

gzunino commented 9 years ago

Any idea why this is failling? I'll be happy to apply and try some fix if you give some direction about where the problem could it be.

Thanks.

sebastianbenz commented 9 years ago

Could you please try installing the plugins from the following update site: http://meysholdt.github.io/eclipse_jdt_junit_runners/updatesite ?

gzunino commented 9 years ago

Installing plugin from that update site on eclipse and target platform solved the issue.

Maybe you will need to add that to install instrucctions or include the dependency in your update site

Many thanks.