Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#13018 closed enhancement (fixed)

[Patch] Use new test rules for AutosaveTaskTest, increase coverage.

Reported by: michael2402 Owned by: team
Priority: normal Milestone: 16.06
Component: Unit tests Version:
Keywords: gsoc-core Cc: Don-vip, bastiK, stoecker


Code coverage for AutosaveTask was 31%, is >80% now. Error checking is missing in tests but basic features should be covered.

This test requires some adjustments to AutosaveTask / Main:

  • recoverUnsavedLayers returns a Future to wait for.
  • recoverUnsavedLayers now waits until OpenFileTask is done before loading.
  • Add a special call to mainPanel.reAddListeners to main at the right place to only add that listener if main is started (JOSMFixture does it's own add). Not nice but it is the best for now without throwing all of JOSM startup over.

And I added some code cleanup:

  • addLayerChangeListener(..., true) fires the listener on every layer. This shortens the code.
  • add documentation
  • do not let tests clean the layers they added - JOSMTestRule does this.

Attachments (1)

patch-test-AutosaveTaskTest-use-rules.patch (14.4 KB) - added by michael2402 7 years ago.

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by michael2402

comment:1 Changed 7 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 10444/josm:

fix #13018 - Use new test rules for AutosaveTaskTest, increase coverage (patch by michael2402) - gsoc-core

comment:2 Changed 7 years ago by Don-vip

Milestone: 16.06

comment:3 Changed 7 years ago by Don-vip

In 10447/josm:

see #12994, see #13018 - checkstyle

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.