#23219 closed task (worksforme)
Document unit testing for plugin authors
| Reported by: | gaben | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Wiki content | Version: | |
| Keywords: | unit test testng junit | Cc: |
Description
I developed a plugin for JOSM some time ago. It's written in Kotlin and utilizes TestNG. However, I recently realized it might not work at all because everything was prepared with JUnit in mind.
Can someone help me figure out how it's possible to test plugins, possibly with TestNG? I'm not committed to TestNG; it would just be nice to have so I wouldn't need to rewrite what I currently have.
After all, I couldn't find documentation for plugin authors on writing unit tests, let it be TestNG or JUnit. I'm happy to create the pages, but I currently lack the knowledge. Just today, I discovered that there is a josm-unittest.jar lib for this purpose...
Attachments (0)
Change History (4)
comment:2 by , 2 years ago
I moved the project to JUnit 5. It took me a day, but it was worth it. Now automagically everything started working :D Thank you!
comment:3 by , 2 years ago
| Resolution: | → worksforme |
|---|---|
| Status: | new → closed |
We have a short section on wiki:DevelopersGuide/DevelopingPlugins#Automatedtesting about automated testing, which pretty much comes down to "look at these examples".
comment:4 by , 2 years ago
Hmm, I missed that section. Anyway, I added a sentence about my findings.



The
josm-unittest.jaris specifically distributed for that purpose, yes.The following classes should be used in order:
-Djunit.jupiter.extensions.autodetection.enabled=true-- just annotate the class with them)