Re: svn commit: r1617371 - in /creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp: AbstractRatMojo.java RatReportMojo.java

2014-08-11 Thread P. Ottlinger

Hi *,

On 2014-08-12 02:17, sebb wrote:

On 11 August 2014 22:45,   wrote:

Author: pottlinger
Date: Mon Aug 11 21:45:58 2014
New Revision: 1617371

URL: http://svn.apache.org/r1617371
Log:
LHF: organized imports after refactoring.


Sorry - what does LHF mean?


LHF is 'low hanging fruits' ... sorry. I'm always using this acronym for 
simple changes withoutJira references or functional changes.


Cheers,
Phil


Build failed in Jenkins: Creadur-Rat #99

2014-08-11 Thread Apache Jenkins Server
See 

--
[...truncated 234 lines...]
at 
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.connect(HTTPConnection.java:280)
at 
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection._request(HTTPConnection.java:451)
... 35 more
ERROR: Subversion update failed
java.io.IOException: remote file operation failed: 
 at 
hudson.remoting.Channel@52d6c4b:ubuntu-5
at hudson.FilePath.act(FilePath.java:910)
at hudson.FilePath.act(FilePath.java:887)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:936)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:871)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1414)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:671)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:580)
at hudson.model.Run.execute(Run.java:1676)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:529)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:231)
Caused by: java.io.IOException
at 
hudson.scm.subversion.UpdateUpdater$TaskImpl.perform(UpdateUpdater.java:211)
at 
hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:161)
at 
hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:1030)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:1011)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:987)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2462)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at 
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: hudson.scm.subversion.UpdaterException: failed to perform svn update
... 14 more
Caused by: org.tmatesoft.svn.core.SVNException: svn: E175002: OPTIONS 
/repos/asf/creadur/rat/trunk failed
at 
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:388)
at 
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:373)
at 
org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:361)
at 
org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:707)
at 
org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:627)
at 
org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:102)
at 
org.tmatesoft.svn.core.internal.io.dav.DAVRepository.openConnection(DAVRepository.java:1020)
at 
org.tmatesoft.svn.core.internal.io.dav.DAVRepository.getRepositoryUUID(DAVRepository.java:148)
at 
org.tmatesoft.svn.core.internal.wc16.SVNBasicDelegate.createRepository(SVNBasicDelegate.java:339)
at 
org.tmatesoft.svn.core.internal.wc16.SVNBasicDelegate.createRepository(SVNBasicDelegate.java:328)
at 
org.tmatesoft.svn.core.internal.wc16.SVNUpdateClient16.update(SVNUpdateClient16.java:482)
at 
org.tmatesoft.svn.core.internal.wc16.SVNUpdateClient16.doUpdate(SVNUpdateClient16.java:364)
at 
org.tmatesoft.svn.core.internal.wc16.SVNUpdateClient16.doUpdate(SVNUpdateClient16.java:274)
at 
org.tmatesoft.svn.core.internal.wc2.old.SvnOldUpdate.run(SvnOldUpdate.java:27)
at 
org.tmatesoft.svn.core.internal.wc2.old.SvnOldUpdate.run(SvnOldUpdate.java:11)
at 
org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:20)
at 
org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1238)
at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
at 
org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:311)
at 
org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:291)
at 
org.tmatesoft.svn.core.wc.SVNUpdateClient.doUpdate(SVNUpdateClient.java:387)
at 
hudson.scm.subversion.UpdateUpdater$TaskImpl.perform(UpdateUpdater.java:157)
... 13 more
Caused by: svn: E175002: OPTIONS /repos/asf/creadur/rat/trunk failed
at 
or

Re: svn commit: r1617370 - in /creadur/rat/trunk: ./ apache-rat-plugin/ apache-rat-plugin/src/main/java/org/apache/rat/mp/ apache-rat-plugin/src/test/java/org/apache/rat/mp/

2014-08-11 Thread sebb
On 11 August 2014 22:40,   wrote:
> Author: pottlinger
> Date: Mon Aug 11 21:40:26 2014
> New Revision: 1617370
>
> URL: http://svn.apache.org/r1617370
> Log:
> Refactoring mojo tests.
>
> -Replaced the way the MavenProject injected to a non-deprecated way (to get 
> rid of the warning during the build).
> -Updated mavenInvokerPluginVersion and extracted it as a pom-property.
> -Extracted some RAT mojo integration test methods into a separate 
> RatTestHelpers in order to find integration tests more easily after RAT-168 
> and the NPE when trying to forge 0.11.
>

[]

> ==
> --- 
> creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java
>  (original)
> +++ 
> creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java
>  Mon Aug 11 21:40:26 2014
> @@ -198,9 +198,9 @@ public abstract class AbstractRatMojo ex
> private boolean excludeSubProjects;
>
> /**
> -* Holds the maven-internal project to allow resolution of artifact 
> properties during mojo runs.
> -*/
> -   @Component
> +* Holds the maven-internal project to allow resolution of artifact 
> properties during mojo runs.
> +*/
> +   @Parameter(property = "project", required = true, readonly = true)

So the NPE was caused by using

  @Parameter(name = "project",

i.e. the wrong attribute name?

> private MavenProject project;
>
> /**


[]


Re: svn commit: r1617371 - in /creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp: AbstractRatMojo.java RatReportMojo.java

2014-08-11 Thread sebb
On 11 August 2014 22:45,   wrote:
> Author: pottlinger
> Date: Mon Aug 11 21:45:58 2014
> New Revision: 1617371
>
> URL: http://svn.apache.org/r1617371
> Log:
> LHF: organized imports after refactoring.

Sorry - what does LHF mean?

>
> Modified:
> 
> creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java
> 
> creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatReportMojo.java
>
> Modified: 
> creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java
> URL: 
> http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java?rev=1617371&r1=1617370&r2=1617371&view=diff
> ==
> --- 
> creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java
>  (original)
> +++ 
> creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/AbstractRatMojo.java
>  Mon Aug 11 21:45:58 2014
> @@ -34,7 +34,6 @@ import javax.xml.transform.TransformerCo
>  import org.apache.maven.plugin.AbstractMojo;
>  import org.apache.maven.plugin.MojoExecutionException;
>  import org.apache.maven.plugin.MojoFailureException;
> -import org.apache.maven.plugins.annotations.Component;
>  import org.apache.maven.plugins.annotations.Parameter;
>  import org.apache.maven.project.MavenProject;
>  import org.apache.rat.Defaults;
>
> Modified: 
> creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatReportMojo.java
> URL: 
> http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatReportMojo.java?rev=1617371&r1=1617370&r2=1617371&view=diff
> ==
> --- 
> creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatReportMojo.java
>  (original)
> +++ 
> creadur/rat/trunk/apache-rat-plugin/src/main/java/org/apache/rat/mp/RatReportMojo.java
>  Mon Aug 11 21:45:58 2014
> @@ -19,6 +19,18 @@ package org.apache.rat.mp;
>   * under the License.
>   */
>
> +import java.io.File;
> +import java.io.FileWriter;
> +import java.io.IOException;
> +import java.io.PrintWriter;
> +import java.io.StringWriter;
> +import java.io.Writer;
> +import java.util.HashMap;
> +import java.util.Iterator;
> +import java.util.Locale;
> +import java.util.Map;
> +import java.util.ResourceBundle;
> +
>  import org.apache.maven.artifact.Artifact;
>  import org.apache.maven.artifact.factory.ArtifactFactory;
>  import org.apache.maven.artifact.repository.ArtifactRepository;
> @@ -46,20 +58,6 @@ import org.apache.maven.reporting.MavenR
>  import org.apache.rat.Defaults;
>  import org.codehaus.doxia.sink.Sink;
>
> -import java.io.File;
> -import java.io.FileWriter;
> -import java.io.IOException;
> -import java.io.PrintWriter;
> -import java.io.StringWriter;
> -import java.io.Writer;
> -import java.util.Collections;
> -import java.util.HashMap;
> -import java.util.Iterator;
> -import java.util.List;
> -import java.util.Locale;
> -import java.util.Map;
> -import java.util.ResourceBundle;
> -
>
>  /**
>   * Generates a report with Rat's output.
>
>


Re: svn commit: r1617205 - /creadur/rat/trunk/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java

2014-08-11 Thread P. Ottlinger
Hi Sebb, hi Dennis,

thanks for your help in identifying that RAT's testing can be improved.

Am 11.08.2014 um 14:15 schrieb sebb:
>> 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.
> Great - maybe we can a README to the IT tree to explain how to add new tests?
> Also point to the Maven docs that describe the layout and processing.
> 
> For example, I can see that there are test/ and test/invoker
> sub-folders that relate to each other.
> However, it is not clear how the shared files under test/ and
> test/invoker should be used.
> In particular, the files under java - are these used for all it tests?
> If so. how does one allow for different test conditions?
> 
>>> >> I may give it a try, but no promises!
> I added it4_RAT-168
> 
> But note that it2 and it3 don't seem to be run currently - RAT-169
> It would be good to fix that.

Following your discussion I've extracted some static testHelper methods
in order to be able to see tests more clearly.

Hope this is okay and we can continue to create a new 0.11 RC.

What do you think?

Phil



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r1617205 - /creadur/rat/trunk/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java

2014-08-11 Thread sebb
On 11 August 2014 13:15, sebb  wrote:
> On 11 August 2014 12:59, Dennis Lundberg  wrote:
>> On Mon, Aug 11, 2014 at 12:38 PM, sebb  wrote:
>>> On 11 August 2014 11:17, P. Ottlinger  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.
>
> +1
>
>> 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.
>
> Great - maybe we can a README to the IT tree to explain how to add new tests?
> Also point to the Maven docs that describe the layout and processing.
>
> For example, I can see that there are test/ and test/invoker
> sub-folders that relate to each other.

Looks like test/invoker/it1 and test/it1 have nothing to do with each other.
They just happen to have the same name

> However, it is not clear how the shared files under test/ and
> test/invoker should be used.

test/invoker seems to be used for the IT tests only, not JUnit tests.

> In particular, the files under java - are these used for all it tests?

The java file specifically targets it[1-3]/pom.xml in separate test methods

> If so. how does one allow for different test conditions?

They are checked in the relevant test method.

>>> I may give it a try, but no promises!
>
> I added it4_RAT-168
>
> But note that it2 and it3 don't seem to be run currently - RAT-169
> It would be good to fix that.

Not a problem - they are part of RatCheckMojoTest

>>>
 Thanks
 Phil


>>
>>
>>
>> --
>> Dennis Lundberg


[jira] [Commented] (RAT-168) Tests don't check CLI usage

2014-08-11 Thread Sebb (JIRA)

[ 
https://issues.apache.org/jira/browse/RAT-168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14092878#comment-14092878
 ] 

Sebb commented on RAT-168:
--

URL: http://svn.apache.org/r1617307
Log:
RAT-168 Tests don't check CLI usage
Parallel unit test is not needed/used

Removed:
creadur/rat/trunk/apache-rat-plugin/src/test/it4_RAT-168/

> Tests don't check CLI usage
> ---
>
> Key: RAT-168
> URL: https://issues.apache.org/jira/browse/RAT-168
> Project: Apache Rat
>  Issue Type: Bug
>Affects Versions: 0.11
>Reporter: Sebb
> Fix For: 0.11
>
>
> The unit/IT tests clearly don't test the Maven CLI functionality.
> mvn apache-rat:rat is currently failing with an NPE, even on the RAT project 
> itself.
> To show this, do the following:
> {noformat}
> mvn or mvn clean install
>  mvn -o org.apache.rat:apache-rat-plugin::0.12-SNAPSHOT:rat 
> (change the version as required)
> {noformat}
> Note that the -o is essential, otherwise Maven will try to download the 
> current snapshot



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Resolved] (RAT-169) IT tests it2 and it3 don't appear to be run

2014-08-11 Thread Sebb (JIRA)

 [ 
https://issues.apache.org/jira/browse/RAT-169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sebb resolved RAT-169.
--

Resolution: Not a Problem

The tests are run, but they are run by RatCheckMojoTest.java.

Thus they don't appear in the output as separate integration tests

> IT tests it2 and it3 don't appear to be run
> ---
>
> Key: RAT-169
> URL: https://issues.apache.org/jira/browse/RAT-169
> Project: Apache Rat
>  Issue Type: Bug
>Affects Versions: 0.11
>Reporter: Sebb
>
> The Maven build output does not show that the it2 and it3 tests have been run.
> I suspect this is because there are no it2/it3 folders under the invoker 
> folder.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Re: svn commit: r1617205 - /creadur/rat/trunk/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java

2014-08-11 Thread sebb
On 11 August 2014 12:59, Dennis Lundberg  wrote:
> On Mon, Aug 11, 2014 at 12:38 PM, sebb  wrote:
>> On 11 August 2014 11:17, P. Ottlinger  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.

+1

> 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.

Great - maybe we can a README to the IT tree to explain how to add new tests?
Also point to the Maven docs that describe the layout and processing.

For example, I can see that there are test/ and test/invoker
sub-folders that relate to each other.
However, it is not clear how the shared files under test/ and
test/invoker should be used.
In particular, the files under java - are these used for all it tests?
If so. how does one allow for different test conditions?

>> I may give it a try, but no promises!

I added it4_RAT-168

But note that it2 and it3 don't seem to be run currently - RAT-169
It would be good to fix that.

>>
>>> Thanks
>>> Phil
>>>
>>>
>
>
>
> --
> Dennis Lundberg


Re: [VOTE] Release Apache Rat 0.11

2014-08-11 Thread sebb
On 11 August 2014 13:03, Dennis Lundberg  wrote:
> Hi,
>
> Sorry I forgot to add this URL to the VOTE mail:
> http://maven.apache.org/guides/development/guide-testing-releases.html

The profile entry could use a property to define the 

In the case of Nexus, we know most of the URL already, so the URL
could be defined using 2 properties:

rat.rc.nexus.id=1000
rat.rc.url=https://repository.apache.org/content/repositories/orgapachecreadur-${rat.nexus.id}

One can then easily define part or all of the URL.

[Prop Names could of course be changed]

>
> On Sun, Aug 10, 2014 at 9:25 PM, sebb  wrote:
>> I should state that I installed 0.11 locally from the tag.
>>
>> My Maven foo is a bit rusty; I'm not sure how to define the staging
>> repo so I can use the plugin directly from the RC build area
>>
>> Earlier experimentation appeared to show that getProject() was returning 
>> null.
>>
>> On 10 August 2014 20:22, sebb  wrote:
>>> -1
>>> I'm seeing an NPE when running "mvn apache-rat: rat
>>> -Dcommons.rat.version=0.11" against commons-csv and commons-compress.
>>>
>>> Other times I have seen messages such as
>>>
>>> Warning:  org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property
>>> 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is
>>> not recognized.
>>>
>>>
>>>
>>> On 8 August 2014 13:31, Dennis Lundberg  wrote:
 Hi,

 We solved 14 issues:
 https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12324979&projectId=12310750

 Staging repo:
 https://repository.apache.org/content/repositories/orgapachecreadur-1000
 https://repository.apache.org/content/repositories/orgapachecreadur-1000/org/apache/rat/apache-rat/0.11/apache-rat-0.11-src.zip

 Source release checksum:
 apache-rat-0.11-src.zip sha1: c90def02faa7161ad8c61e7ddf00ff3641fbddca

 Staging site:
 http://creadur.staging.apache.org/rat/

 Note: the downloads page is non-functional for 2 reasons: the version
 numbers have not yet been updated; the new release is not yet at the
 dist location. I will take care of these if the vote passes.

 Tag:
 http://svn.apache.org/repos/asf/creadur/rat/tags/apache-rat-project-0.11/

 Everyone is encouraged to vote, express their opinions and jump in if
 they find anything wrong with the release. Only PMC votes are binding
 on Apache, and for this candidate to become an official Apache
 Software Foundation release 3 +1's are required and more +1's than
 -1's.

 This vote is open for at least 72 hours,

 [ ] +1
 [ ] +0
 [ ] -1

 --
 Dennis Lundberg
>
>
>
> --
> Dennis Lundberg


Re: svn commit: r1617205 - /creadur/rat/trunk/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java

2014-08-11 Thread Dennis Lundberg
On Mon, Aug 11, 2014 at 12:38 PM, sebb  wrote:
> On 11 August 2014 11:17, P. Ottlinger  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.]

Here's an overview of the different strategies for testing Maven
Plugins, for future reference:
http://maven.apache.org/guides/development/guide-testing-releases.html

Over at the Maven project we do most of the testing of Maven Plugin as
integration tests using maven-invoker-plugin.

> 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 may give it a try, but no promises!
>
>> Thanks
>> Phil
>>
>>



-- 
Dennis Lundberg


Re: [VOTE] Release Apache Rat 0.11

2014-08-11 Thread Dennis Lundberg
Hi,

Sorry I forgot to add this URL to the VOTE mail:
http://maven.apache.org/guides/development/guide-testing-releases.html


On Sun, Aug 10, 2014 at 9:25 PM, sebb  wrote:
> I should state that I installed 0.11 locally from the tag.
>
> My Maven foo is a bit rusty; I'm not sure how to define the staging
> repo so I can use the plugin directly from the RC build area
>
> Earlier experimentation appeared to show that getProject() was returning null.
>
> On 10 August 2014 20:22, sebb  wrote:
>> -1
>> I'm seeing an NPE when running "mvn apache-rat: rat
>> -Dcommons.rat.version=0.11" against commons-csv and commons-compress.
>>
>> Other times I have seen messages such as
>>
>> Warning:  org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property
>> 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is
>> not recognized.
>>
>>
>>
>> On 8 August 2014 13:31, Dennis Lundberg  wrote:
>>> Hi,
>>>
>>> We solved 14 issues:
>>> https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12324979&projectId=12310750
>>>
>>> Staging repo:
>>> https://repository.apache.org/content/repositories/orgapachecreadur-1000
>>> https://repository.apache.org/content/repositories/orgapachecreadur-1000/org/apache/rat/apache-rat/0.11/apache-rat-0.11-src.zip
>>>
>>> Source release checksum:
>>> apache-rat-0.11-src.zip sha1: c90def02faa7161ad8c61e7ddf00ff3641fbddca
>>>
>>> Staging site:
>>> http://creadur.staging.apache.org/rat/
>>>
>>> Note: the downloads page is non-functional for 2 reasons: the version
>>> numbers have not yet been updated; the new release is not yet at the
>>> dist location. I will take care of these if the vote passes.
>>>
>>> Tag:
>>> http://svn.apache.org/repos/asf/creadur/rat/tags/apache-rat-project-0.11/
>>>
>>> Everyone is encouraged to vote, express their opinions and jump in if
>>> they find anything wrong with the release. Only PMC votes are binding
>>> on Apache, and for this candidate to become an official Apache
>>> Software Foundation release 3 +1's are required and more +1's than
>>> -1's.
>>>
>>> This vote is open for at least 72 hours,
>>>
>>> [ ] +1
>>> [ ] +0
>>> [ ] -1
>>>
>>> --
>>> Dennis Lundberg



-- 
Dennis Lundberg


Re: svn commit: r1617205 - /creadur/rat/trunk/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java

2014-08-11 Thread Dennis Lundberg
On Mon, Aug 11, 2014 at 12:38 PM, sebb  wrote:
> On 11 August 2014 11:17, P. Ottlinger  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


[jira] [Created] (RAT-169) IT tests it2 and it3 don't appear to be run

2014-08-11 Thread Sebb (JIRA)
Sebb created RAT-169:


 Summary: IT tests it2 and it3 don't appear to be run
 Key: RAT-169
 URL: https://issues.apache.org/jira/browse/RAT-169
 Project: Apache Rat
  Issue Type: Bug
Affects Versions: 0.11
Reporter: Sebb


The Maven build output does not show that the it2 and it3 tests have been run.

I suspect this is because there are no it2/it3 folders under the invoker folder.



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Resolved] (RAT-168) Tests don't check CLI usage

2014-08-11 Thread Sebb (JIRA)

 [ 
https://issues.apache.org/jira/browse/RAT-168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sebb resolved RAT-168.
--

   Resolution: Fixed
Fix Version/s: 0.11
 Assignee: (was: Philipp Ottlinger)

URL: http://svn.apache.org/r1617255
Log:
RAT-168 Tests don't check CLI usage
Added basic test to check rat goal

Added:
creadur/rat/trunk/apache-rat-plugin/src/test/invoker/it4_RAT-168/

creadur/rat/trunk/apache-rat-plugin/src/test/invoker/it4_RAT-168/invoker.properties
creadur/rat/trunk/apache-rat-plugin/src/test/invoker/it4_RAT-168/pom.xml

creadur/rat/trunk/apache-rat-plugin/src/test/invoker/it4_RAT-168/verify.groovy
creadur/rat/trunk/apache-rat-plugin/src/test/it4_RAT-168/
creadur/rat/trunk/apache-rat-plugin/src/test/it4_RAT-168/pom.xml


> Tests don't check CLI usage
> ---
>
> Key: RAT-168
> URL: https://issues.apache.org/jira/browse/RAT-168
> Project: Apache Rat
>  Issue Type: Bug
>Affects Versions: 0.11
>Reporter: Sebb
> Fix For: 0.11
>
>
> The unit/IT tests clearly don't test the Maven CLI functionality.
> mvn apache-rat:rat is currently failing with an NPE, even on the RAT project 
> itself.
> To show this, do the following:
> {noformat}
> mvn or mvn clean install
>  mvn -o org.apache.rat:apache-rat-plugin::0.12-SNAPSHOT:rat 
> (change the version as required)
> {noformat}
> Note that the -o is essential, otherwise Maven will try to download the 
> current snapshot



--
This message was sent by Atlassian JIRA
(v6.2#6252)


Re: svn commit: r1617205 - /creadur/rat/trunk/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java

2014-08-11 Thread sebb
On 11 August 2014 11:17, P. Ottlinger  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 may give it a try, but no promises!

> Thanks
> Phil
>
>


Re: svn commit: r1617205 - /creadur/rat/trunk/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java

2014-08-11 Thread P. Ottlinger

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.


Obviously my test patch didn't catch the original NPE, but my checkin 
fixed the issue for your setup, didn't it?


I tried some stackoverflowing but didn't find anything useful. Many 
people complain about the low testability of maven plugins.


Thanks
Phil




Re: svn commit: r1617205 - /creadur/rat/trunk/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java

2014-08-11 Thread sebb
On 11 August 2014 06:46,   wrote:
> Author: pottlinger
> Date: Mon Aug 11 05:46:11 2014
> New Revision: 1617205
>
> URL: http://svn.apache.org/r1617205
> Log:
> RAT-168 Tests don't check CLI usage
>
> -Ensuring that project itself and its list of remote ArtifactRepos are 
> notNull in integration tests.

AFAICT the test does not detect the error.

I tried reverting to the @Parameter annotation and the test still succeeded.

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.

> Modified:
> 
> creadur/rat/trunk/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java
>
> Modified: 
> creadur/rat/trunk/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java
> URL: 
> http://svn.apache.org/viewvc/creadur/rat/trunk/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java?rev=1617205&r1=1617204&r2=1617205&view=diff
> ==
> --- 
> creadur/rat/trunk/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java
>  (original)
> +++ 
> creadur/rat/trunk/apache-rat-plugin/src/test/java/org/apache/rat/mp/RatCheckMojoTest.java
>  Mon Aug 11 05:46:11 2014
> @@ -177,6 +177,9 @@ public class RatCheckMojoTest extends Ab
>  }
>  };
>  setVariableValueToObject( mojo, "project", project );
> +assertNotNull("RAT-168: Problem in test setup - you are missing a 
> project in your mojo.", project);
> +assertNotNull("RAT-168: The mojo is missing its MavenProject, which 
> will result in an NPE during rat runs.", mojo.getProject());
> +assertNotNull("RAT-168: No artifactRepos found, which will result in 
> an NPE during rat runs.", project.getRemoteArtifactRepositories());
>  if (mojo instanceof RatReportMojo)
>  {
>  setVariableValueToObject( mojo, "localRepository", 
> newArtifactRepository() );
>
>