Modify

Opened 3 years ago

Closed 3 years ago

#13116 closed defect (fixed)

Failing unit test in turnrestrictions plugin

Reported by: Don-vip Owned by: team
Priority: normal Milestone:
Component: Plugin turnrestrictions Version:
Keywords: gsoc-core Cc: michael2402, bastiK

Description (last modified by Don-vip)

I have updated unit tests of turnrestrictions plugin to replace JOSMFixture by new system and face a unit test failure I don't understand:

jenkins/job/JOSM-Plugins/lastCompletedBuild/jdk=JDK8/testReport/org.openstreetmap.josm.plugins.turnrestrictions.editor/JosmSelectionListModelTest/test_editLayerChanged/

junit.framework.AssertionFailedError: assert model.getSize() == 1
       |     |         |
       |     0         false
       org.openstreetmap.josm.plugins.turnrestrictions.editor.JosmSelectionListModel@6f6c2408
	at org.codehaus.groovy.runtime.InvokerHelper.assertFailed(InvokerHelper.java:402)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:650)
	at org.openstreetmap.josm.plugins.turnrestrictions.editor.JosmSelectionListModelTest.test_editLayerChanged(JosmSelectionListModelTest.groovy:148)
	at org.openstreetmap.josm.testutils.JOSMTestRules$1.evaluate(JOSMTestRules.java:143)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.lang.Thread.run(Thread.java:745)

Attachments (0)

Change History (3)

comment:1 Changed 3 years ago by Don-vip

Description: modified (diff)

comment:2 Changed 3 years ago by michael2402

(1) I don't really see any place in that test where the model is registered as listener to any event. I think it is just not notified of any selection/active layer changes.

(2) The selection is not set in the constructor of JosmSelectionListModel. layer2 is the active data layer after adding it. So the call to selectionChanged in the constructor is ignored.

comment:3 Changed 3 years ago by Don-vip

Resolution: fixed
Status: newclosed

Thanks! Fixed in [o32629].

Modify Ticket

Change Properties
Set your email in Preferences
Action
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.