On Mon, Aug 11, 2014 at 12:38 PM, sebb <[email protected]> wrote: > On 11 August 2014 11:17, P. Ottlinger <[email protected]> wrote: >> Hi Sebb, >> >> >> On 2014-08-11 12:09, sebb wrote: >>> >>> AFAICT the test does not detect the error. >> >> >> yes, that's why I was asking for proposals on how to test it ;-) >> >> >>> I think the problem is that the tests are run in a different environment. >>> >>> There probably needs to be an IT instead to run the code directly. >>> And this commit should probably be reverted, as it does not add anything. >> >> >> I see your point, but my commit ensures that during IT the project and its >> artifact lists is not null. > > OK, then drop the references to the JIRA, as the checks aren't relevant to it. > >> Obviously my test patch didn't catch the original NPE, but my checkin fixed >> the issue for your setup, didn't it? > > Yes, the NPE disappeared. > >> I tried some stackoverflowing but didn't find anything useful. Many people >> complain about the low testability of maven plugins. > > I suspect the issue is documentation. > [I have had a quick look, and there seems to be nothing that explains > how to build IT tests in proper detail.] > > As an experiment, I tried changing > > apache-rat-plugin/src/test/invoker/it1/invoker.properties > > to run the rat goal rather than check > > This produced the NPE when I reverted the fix. > However, the test also fails with the fix, presumably because the goal > output is different. > > I think there needs to be another IT with extra tests, but I have not > created any such items. > It should be possible to copy/adapt another IT test, but getting that > working properly might not be easy owing to the fragmented and > incomplete documentation.
I agree. It's better to have many small ITs that each test one thing. Let me have a look at the ITs in general, and adding one that catches whatever is causing problems. I've created a decent amount of Maven Plugin ITs in my day. > I may give it a try, but no promises! > >> Thanks >> Phil >> >> -- Dennis Lundberg
