#22504 closed enhancement (fixed)
[PATCH] Circularize selected ways
Reported by: | qeef | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 22.12 |
Component: | Core | Version: | |
Keywords: | Cc: |
Description
Dear JOSM developers,
I would like to contribute the code (in the patch set that follows) to the
JOSM. However, I am unable to run the test -- ant test command returns:
BUILD FAILED
/home/jiri/josm/build.xml:507: The following error occurred while executing this line:
/home/jiri/josm/build.xml:448: Problem: failed to create task or type junitlauncher
Cause: the class org.apache.tools.ant.taskdefs.optional.junitlauncher.confined.JUnitLauncherTask was not found.
This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
-/usr/share/ant/lib
-/home/jiri/.ant/lib
-a directory added on the command line with the -lib argument
ant-optional is installed, but I could not find ant-optinal.jar:
$ dpkg -l | grep ant-optional
ii ant-optional 1.10.9-4 all Java based build tool like make - optional libraries
$ find / -name *ant-opt* 2>/dev/null
/var/cache/apt/archives/ant-optional_1.10.9-4_all.deb
/var/lib/dpkg/info/ant-optional.md5sums
/var/lib/dpkg/info/ant-optional.list
/usr/share/doc/ant-optional
tested with:
# java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1~deb9u1-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
and with:
# java -version
openjdk version "11.0.16" 2022-07-19
OpenJDK Runtime Environment (build 11.0.16+8-post-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Debian-1deb11u1, mixed mode, sharing)
Have anyone encountered similar issues? Could anyone review the patch without
me running the tests, please?
Attachments (5)
Change History (10)
by , 2 years ago
Attachment: | 0001-Separate-move-nodes-command-code.patch added |
---|
by , 2 years ago
Attachment: | 0002-Add-circularize-selected-ways-code.patch added |
---|
by , 2 years ago
Attachment: | 0001-Add-circularize-selected-ways-unit-test.patch added |
---|
by , 2 years ago
Attachment: | 0002-Separate-move-nodes-command-code.patch added |
---|
by , 2 years ago
Attachment: | 0003-Add-circularize-selected-ways-code.patch added |
---|
comment:2 by , 2 years ago
Dear taylor.smock, thank you, I can run ant test now.
You'd be surprised how easy it is to break something accidentally.
Unfortunately no, I would not.
I am sharing the second round of the patches, including the simple tests. I am fine with extending the tests if needed. Thanks.
comment:3 by , 2 years ago
Milestone: | → 22.12 |
---|
A couple notes, which I'm fixing locally:
- Don't do
assertTrue(false)
. Instead, usefail("message")
. - You don't always have to specify the generic argument (example:
new HashSet<Node>()
could have beennew HashSet<>()
). This is due to the method being called defining that argument asSet<Node> fixNodes
. But, since it was a new empty set,Collections.emptySet()
should have been used.
Hi qeef:
org.apache.tools.ant.taskdefs.optional.junitlauncher.confined.JUnitLauncherTask
is not available in the standard repos, IIRC. I think they just whitelist the specific jar files that they want forant
,ant-optional
, etc. And the packagers haven't whitelisted the JUnitLauncherTask jar.Anyway, you can download the full
ant
package at https://ant.apache.org/ .If you do run tests, please make certain you aren't running integration tests -- the imagery integration test will take hours. Without them, it will be ~20 minutes. Which is long for unit tests.
I usually use something like
Notes on a quick readthrough of the patch:
skip_this_way
to camel case (e.g.skipThisWay
). This is just a style thing.I would like to see some tests -- since it doesn't look like you are needing to ask the user something, it should be fairly trivial. You'd be surprised how easy it is to break something accidentally.
EDIT: Debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=967933 -- fixed 2022-07-11, so probably not yet in Ubuntu/Debian stable.