emfjson / emfjson-jackson

JSON Binding for Eclipse Modeling Framework
https://emfjson.github.io
Other
80 stars 23 forks source link

Be able to run tests (and core) in Standalone (non-OSGi) #33

Closed vorburger closed 11 years ago

vorburger commented 11 years ago

Hi, I've started some work re. being able to run tests (and core) in Standalone (non-OSGi)... not yet complete.

Is this something you'd be interested in? Wanna finish it? ;-) Else maybe I will... some other night.

PS: The 2 files which appear to be completely changes are because of Git line ending crap. If you reject, I could try to clean that some time if you like. (Not sure how much time I'll have, thought I'd send you this anyways.)

ghillairet commented 11 years ago

That could be done, yes. The tests are at the moment run with maven-tycho but they could be modified to run in standalone too.

For the core part (emfjson itself) it runs in standalone already, I made projects based on maven only build (non plugins projects) already and it works fine.

vorburger commented 11 years ago

I didn't mean so much the build (maven-tycho vs. surefire) aspect, but more that I'd like to / think it would make sense to / would be re-assuring to able to Run As > JUnit Test, as opposed to Run As > JUnit Plug-In Test.

The main issue I see seems to be that in many emfjson.junit/tests/*.json there are platform:/ URIs. Take for example the test-load-types-2.json used by the org.eclipselabs.emfjson.junit.tests.TestPolymorphicType.testLoadTwoObjectsWithReferenceAndTypeInformation() .. it uses an absolute platform:/ URI for a reference to another object within the same resource. Couldn't that be relative? What syntax? I've tried #Two instead of platform:/plugin/org.eclipselabs.emfjson.junit/tests/test-load-types-2.json#Two, but that make this test fail with IllegalArgumentException: The class 'AbstractType' is not a valid classifier... help! ;-)

ghillairet commented 11 years ago

I solved the problem by using a URIMap during the setup of tests in TestSupport, it will target different URIs depending on being run in OSGi or not.