Opened 8 years ago
Last modified 8 days ago
#13344 reopened defect
Unable to run unit tests in Eclipse on Windows
Reported by: | GerdP | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 16.08 |
Component: | Unit tests | Version: | |
Keywords: | eclipse | Cc: |
Description (last modified by )
I try to execute the test MultipolygonTestTest.
I have the source in the edit window and do a right click into the window, then select
Run as -> JUnit test
This is what I get: ERROR: java.io.IOException: Failed to open input stream for resource 'resource://data/preferences.xsd' java.io.IOException: Failed to open input stream for resource 'resource://data/preferences.xsd' at org.openstreetmap.josm.io.CachedFile.getInputStream(CachedFile.java:214) at org.openstreetmap.josm.data.preferences.PreferencesReader.validateXML(PreferencesReader.java:95) at org.openstreetmap.josm.data.preferences.PreferencesReader.validateXML(PreferencesReader.java:84) at org.openstreetmap.josm.data.Preferences.load(Preferences.java:572) at org.openstreetmap.josm.data.Preferences.init(Preferences.java:678) at org.openstreetmap.josm.JOSMFixture.init(JOSMFixture.java:102) at org.openstreetmap.josm.data.validation.tests.MultipolygonTestTest.setUp(MultipolygonTestTest.java:45) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Attachments (2)
Change History (11)
by , 8 years ago
Attachment: | eclipse-config.txt added |
---|
comment:1 by , 8 years ago
Description: | modified (diff) |
---|
by , 8 years ago
comment:2 by , 8 years ago
Keywords: | eclipse added |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
comment:3 by , 8 years ago
Resolution: | worksforme |
---|---|
Status: | closed → reopened |
OK, that takes me to the next problem: How do I configure the url within eclipse?
I guess I can change the url in the source, but maybe there is a better solution?
java.lang.AssertionError: configured server url 'https://api.openstreetmap.org/api/' seems to be a productive url, aborting.
at org.junit.Assert.fail(Assert.java:88)
at org.openstreetmap.josm.JOSMFixture.init(JOSMFixture.java:119)
at org.openstreetmap.josm.data.validation.tests.MultipolygonTestTest.setUp(MultipolygonTestTest.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
follow-up: 5 comment:4 by , 8 years ago
I had the same problem when starting to test. Those are the patches I use:
https://github.com/michaelzangl/josm/commits/mirror-patched
You may be interested in:
- Make tests runnable from eclipse.
- Use dev server for tests.
- Make test clean delete more.
I did not submit them as patch since they may break other things ;-)
The remaining changes are for setting my local java version and setting up travis.
comment:5 by , 8 years ago
Replying to michael2402:
I had the same problem when starting to test. Those are the patches I use:
https://github.com/michaelzangl/josm/commits/mirror-patched
You may be interested in:
- Make tests runnable from eclipse.
- Use dev server for tests.
- Make test clean delete more.
Thanks, that helped a lot.
comment:6 by , 8 years ago
Milestone: | → 16.08 |
---|
comment:9 by , 8 days ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
It's currently a bit tricky due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=127994, you must add
bin2
directory to the runtime classpath of your run/debug configurations: