eclipse / Xpect

This repository has been rewritten to move to the Eclipse Foundation. Find the old history here: https://github.com/TypeFox/Xpect
http://www.xpect-tests.org/
Eclipse Public License 2.0
30 stars 28 forks source link

NullPointerException with Xtext 2.19? #271

Closed szschaler closed 4 years ago

szschaler commented 4 years ago

I have a simple example project using XPect 0.2.0.201706301756. If I run my tests with Xtext 2.18, all works well. If I try to run the same tests with Xtext 2.19.0.v20190902, I get a NullPointerException in XtextStandaloneSetup on a line that calls on the injector to do stuff. I suspect that the injector variable hasn't been set correctly here, causing XPect to break.

At this point, I am unsure how to fix this. It may of course be some incompatibility from Xtext 2.18 to 2.19, but given that my language is as unassuming as they come (literally an afternoon's hacking of a grammar), I would be surprised.

Any suggestions?

cdietrich commented 4 years ago

can you provide a stacktrace? could you also provide a reproducing example? is the same problem there with the latest nightly https://ci.eclipse.org/xpect/job/Xpect/job/master/lastSuccessfulBuild/artifact/org.eclipse.xpect.releng/p2-repository/target/repository/?

szschaler commented 4 years ago

Trace is

java.lang.NullPointerException at org.xpect.xtext.lib.setup.XtextStandaloneSetup.(XtextStandaloneSetup.java:40) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488) at org.xpect.state.StateContainer.createFactory(StateContainer.java:154) at org.xpect.state.StateContainer.getFactory(StateContainer.java:271) at org.xpect.state.StateContainer.createInstance(StateContainer.java:174) at org.xpect.state.StateContainer.createInstance(StateContainer.java:198) at org.xpect.state.StateContainer.get(StateContainer.java:248) at org.xpect.state.StateContainer.get(StateContainer.java:210) at org.xpect.state.StateContainer.createFactory(StateContainer.java:150) at org.xpect.state.StateContainer.getFactory(StateContainer.java:271) at org.xpect.state.StateContainer.createInstance(StateContainer.java:174) at org.xpect.state.StateContainer.createInstance(StateContainer.java:198) at org.xpect.state.StateContainer.get(StateContainer.java:248) at org.xpect.state.StateContainer.get(StateContainer.java:210) at org.xpect.runner.XpectFileRunner.run(XpectFileRunner.java:135) at org.xpect.runner.XpectRunner.runChild(XpectRunner.java:208) at org.xpect.runner.XpectRunner.runChild(XpectRunner.java:1) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.xpect.runner.XpectRunner.run(XpectRunner.java:194) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)

cdietrich commented 4 years ago

This stacktrace and classnames don’t match the current code and I don’t know if the old is somewhere

=> please try with newest version => please provide a reproducible example

szschaler commented 4 years ago

Current code of what? This is a recent install of Xtext and Xpect, see version numbers on top off issue. These version numbers have been taken directly from the Eclipse plugin list.

cdietrich commented 4 years ago

i mean the one with eclipse namespaces: https://ci.eclipse.org/xpect/job/Xpect/job/master/lastSuccessfulBuild/artifact/org.eclipse.xpect.releng/p2-repository/target/repository/

szschaler commented 4 years ago

Hmm, strange. This doesn't seem to be what's installed from the nightly update site at http://www.xpect-tests.org/updatesite/nightly/, which is linked from http://www.xpect-tests.org/ ... I will try out with that version (is there a way of treating your link as an update site?) and report back.

cdietrich commented 4 years ago

cause nobody cares about having a proper updatesite at eclipse or updating the old one.

szschaler commented 4 years ago

It may well be time to update it, if it helps avoid more confusion like mine :-)

Short of installing XPect from source from this directory, is there something I can use as an update site for the build you've linked above?

cdietrich commented 4 years ago

There should be a zip and a update site see https://ci.eclipse.org/xpect/job/Xpect/job/master/19/artifact/org.eclipse.xpect.releng/p2-repository/target/

cdietrich commented 4 years ago

The first link may be usable as update site

szschaler commented 4 years ago

Thanks. Yes, that worked as an update site. I will get our IT person to install from there (long story...) and report back.

szschaler commented 4 years ago

Moving to this version of Xpect fixes the issue. However, this means that there is an issue with documentation. When people search for Xpect, the only download site they find is the one advertised here: http://www.xpect-tests.org/ This leads to http://www.xpect-tests.org/updatesite/nightly/ which has the old version. No other update site is documented anywhere, as far as I can see. In fact, that old update site is still advertised in the README file for this repository.

I note that Xpect now is an Eclipse project, but it doesn't advertise any downloads on https://projects.eclipse.org/projects/modeling.xpect/downloads, or in fact packages here. Would it be possible to update the links to the update site accordingly so that the old version is no longer delivered? I believe this would avoid confusion.

cdietrich commented 4 years ago

The problem is There is nobody who cares to do so (an i am not a committer)

szschaler commented 4 years ago

Thanks, that's nice and clear :-)