I probably didn't cheat it too much, but my project has a very structured layout, which I really liked. This time, the presence of such a structure was indeed useful, so I do not want it to become disordered again.
To begin with, each module consists of several Java packages:
com.mycompany.mysoftware.modulename
com.mycompany.mysoftware.modulename.impl
com.mycompany.mysoftware.modulename.osgi
com.mycompany.mysoftware.modulename.test
The main code lives in .impl. Interfaces, some enumerations, and some classes of data containers that are used by other modules live in a package without a suffix. In the code .osgiand unit tests in the package .testthere is a special OSGi code ( BundleActivatoretc.).
Now I have classes that fake a module that will be used when testing others. I am wondering if I should put those from a .testmodule package commonthat already contains shared libraries for the main code, or should I have a new module testso that I can configure another dependency for Maven.
ETA . One of the problems that I am facing is that I get cyclic dependencies: if I have two modules and each module test requires faking the other, the module containing the fake depends on the module containing the interface, which is the same module that contains the unit test. So, the fake should be with the test, but this leads to a lot of duplication of code. Or, for each module, I make a fake module, but it makes me feel like it is getting out of control ...
source
share