Modify

Opened 3 years ago

Closed 3 years ago

#20085 closed defect (fixed)

Mapillary test failures with openjdk11

Reported by: Don-vip Owned by: taylor.smock
Priority: normal Milestone:
Component: Plugin mapillary Version:
Keywords: test java11 junit Cc:

Description

See jenkins/job/JOSM-Plugins/jdk=JDK11/lastCompletedBuild/testReport/

36 test failures, all from Mapillary plugin, but only with Java 11.

Worked fine before these changes:

    TEST: Junit4 -> JUnit 5 migration

    Signed-off-by: Taylor Smock <tsmock@fb.com> (détails)
    by taylor.smock
    FIXUP: JOSM-20040, fix restartless uninstall

    Several classes had to be modified to avoid NPE's, and the actual code
    to destroy menu items now has to account for null objects.

    Signed-off-by: Taylor Smock <tsmock@fb.com> (détails)
    by taylor.smock

Attachments (1)

20085.patch (4.5 KB ) - added by taylor.smock 3 years ago.
JUnit to JUnitLauncher for plugins

Download all attachments as: .zip

Change History (5)

comment:1 by mdk, 3 years ago

It looks like all tests have the same reason to fail:

Invalid test class 'org.openstreetmap.josm.plugins.mapillary.utils.api.<test class>':
  1. The class org.openstreetmap.josm.plugins.mapillary.utils.api.<test class> is not public.
  2. Test class should have exactly one public constructor
  3. No runnable methods

in reply to:  1 comment:2 by taylor.smock, 3 years ago

I need to make some modifications to build-common.xml, I think.

Issue:
build-common.xml is still using junit for running unit tests, and the ant junit task supports JUnit 3 and JUnit 4, but not JUnit 5.

Solution:
Switch to junitlauncher which supports JUnit 4 and JUnit 5 (and maybe JUnit 3 through the JUnit 4 support, I'll check with eventbus -- SubscriberTest.java seems to use JUnit 3). turnrestrictions also uses JUnit 3 in AllEditorTests.

by taylor.smock, 3 years ago

Attachment: 20085.patch added

JUnit to JUnitLauncher for plugins

comment:3 by Don-vip, 3 years ago

In 35642/osm:

see #16567 - see #20085 - JUnit to JUnitLauncher for plugins (patch by taylor.smock)

comment:4 by taylor.smock, 3 years ago

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain taylor.smock.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.