Spot for test utility classes?

5 views
Skip to first unread message

Fr Jeremy Krieg (Home)

unread,
Sep 7, 2019, 12:35:45 PM9/7/19
to bndtoo...@googlegroups.com
Hi team,

I pray that you're all well.

I'm working on an enhancement to bnd to put file locking around the reading/writing of the launcher properties file. For proper testing, I need to be able to have another process to lock the file, so I've written a class that fires up a remote JVM and allows you to send commands to the JVM to lock/unlock files.

I'd like to use the class in tests in more than one project (in aQute.lib and in biz.aQute.launcher), so it would be nice if I could put it somewhere. However, given that the class is really only useful for testing, I don't want to put it somewhere where it will unnecessarily clutter bnd's application code.

Where is the best place in the bnd workspace to put a test utility class like this?

Blessings,
Fr Jeremy

Peter Kriens

unread,
Sep 10, 2019, 2:56:36 AM9/10/19
to bndtoo...@googlegroups.com
If you can make it a small uncoupled utility I suggest to put it in aQute.lib in a separate package.

Kind regards,

Peter Kriens

--
You received this message because you are subscribed to the Google Groups "bndtools-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bndtools-dev/CAO6F8YwbZVpsJOfcoKbOdTko3FcX6OkRC2dBEPA%3DWWdobQFzEA%40mail.gmail.com.

BJ Hargrave

unread,
Sep 10, 2019, 8:21:58 AM9/10/19
to bndtoo...@googlegroups.com
biz.aQute.bnd.tests already holds some test utility classes. I would use that since it already is for this purpose and has junit on the -buildpath. In general we do not want to put junit on a project's -buildpath.



--

BJ

Fr Jeremy Krieg (Home)

unread,
Sep 11, 2019, 1:59:35 AM9/11/19
to bndtoo...@googlegroups.com
Thanks to you both for your suggestions.

I ended up creating aQute.lib.test and putting it there. Reasoning:

* I was using it in aQute.lib.io.IOTest, and so putting it in biz.aQute.bnd.tests may have inverted the dependency tree;
* biz.aQute.bnd.tests seems to have all of its code in the test directory, which isn't visible to other projects. I guess I could have put it in the src directory under this project, but it would have been lonely. :)

Blessings,
Fr Jeremy

Reply all
Reply to author
Forward
0 new messages