Modify ↓
#12508 closed defect (fixed)
Exception in `MoveCommandTest` and others
Reported by: | bastiK | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 16.02 |
Component: | Unit tests | Version: | |
Keywords: | junit fixture | Cc: | Don-vip |
Description
I get a NPE when running the MoveCommandTest
and similar tests with Netbeans:
Testcase: equalsContract(org.openstreetmap.josm.command.MoveCommandTest): Caused an ERROR null java.lang.NullPointerException at org.openstreetmap.josm.data.preferences.IntegerProperty.get(IntegerProperty.java:26) at org.openstreetmap.josm.gui.layer.OsmDataLayer.<init>(OsmDataLayer.java:135) at org.openstreetmap.josm.command.MoveCommandTest.equalsContract(MoveCommandTest.java:21) Test org.openstreetmap.josm.command.MoveCommandTest FAILED
Looks to me as if Main.pref
is indeed not initialized. What am I missing?
Attachments (0)
Change History (4)
comment:2 Changed 8 years ago by
Keywords: | junit fixture added |
---|---|
Milestone: | → 16.02 |
Note: See
TracTickets for help on using
tickets.
Probably the test needs fixture to be run independently. On Jenkins, all tests share the same JVM state, so if a test creates a fixture, it is reused by tests run after. I may have missed some fixtures in the tests I wrote recently.