Opened 8 years ago
Closed 8 years ago
#12937 closed enhancement (fixed)
Use the new LayerChangeListener
Reported by: | michael2402 | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 16.06 |
Component: | Core | Version: | |
Keywords: | gsoc-core | Cc: | Don-vip, bastiK, stoecker |
Description
Uses the new LayerChangeListener of the LayerManager. Most of it is a simple replacement.
New things:
- ValidatorDialog is now explicitly tied to the edit layer (and not to the last active data layer). They should be the same.
- I removed the runInEDT code - the whole event is handled in EDT.
- Image offset menu is updated if layer oder is changed.
- Buttons of ProperiesDialog were destroyed twice (once when layout was destroyed, once explicitly.)
Attachments (1)
Change History (10)
by , 8 years ago
Attachment: | patch-layer-manager-migrate-layer-change.patch added |
---|
comment:1 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 8 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
This causes a lot of test failures:
https://josm.openstreetmap.de/jenkins/job/JOSM/jdk=JDK7/lastCompletedBuild/testReport/
comment:3 by , 8 years ago
Summary: | [Patch] Use the new LayerChangeListener → Use the new LayerChangeListener |
---|
comment:4 by , 8 years ago
I did only run the tests from eclipse - they work there. I can reproduce the issue when running them from the console.
The problem is that JOSM has a lot of global state. This state is not reset entirely when creating the JOSMFixture. So many actions of the test class that was run previously are used again.
I suggest setting the forkmode
to perTest
for now. It makes tests run longer but every test starts with a clean state. We can switch back to forkmode="once"
after we fixed the global state problems. This may take some time, because there are many places where global state is involved.
Mind that this will extremely increase the time tests need to run (takes ~ 10 times as long as it did)
comment:5 by , 8 years ago
The tests already take a lot of time, I'd prefer to fix the problems rather than change the fork method. It's OK if it takes a few days :)
comment:6 by , 8 years ago
The main Problem I see with the tests is that they all depend on the JOSM main application. Most of them only need to have Main.pref!=null.
Since I deplayed the bug report dialog until after Java 1.8, I'm planing to do some more work on Main() the next weeks and see if I can change it in a way that allows you to run tests without loading all of JOSM. We currently have a code coverage of ~14% for running a simple test case that creates a gpx layer.
comment:7 by , 8 years ago
I started to fix the problem in #12949 - Controlling the test environment more allows us to see which parts of JOSM we need to reset. I'll add more code for the UI later, then this issue should be fixed.
comment:8 by , 8 years ago
The test failures are fixed now.
There are still the following failures:
- org.openstreetmap.josm.tools.date.DateUtilsTest.testTsFromString, fix: #13071
- org.openstreetmap.josm.gui.MapScalerTest.testMapScaler, assumes map to be scaled at 10:1, but it is not.
- org.openstreetmap.josm.gui.dialogs.InspectPrimitiveDialogTest.testBuildMapPaintText, assumes map to be scaled at 10:1, but it is not.
- org.openstreetmap.josm.io.NoteImporterTest.testTicket12531, still tracing that one down, seems to be one of the previous tests...
- org.openstreetmap.josm.plugins.PluginHandlerTestIT.testValidityOfAvailablePlugins, plugin issue
comment:9 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
All tests are fixed, thank you :)
In 10345/josm: