[prev in list] [next in list] [prev in thread] [next in thread] 

List:       maven-user
Subject:    Re: mvn test -Dtest=...TestClass shows the wrong error
From:       Andrew Pennebaker <apennebaker () 42six ! com>
Date:       2013-11-26 16:01:54
Message-ID: CAC7GPxZ67q2DaeKmo1O4fPshxnBWi0AGd_eDM_Yhtq8A0yA42Q () mail ! gmail ! com
[Download RAW message or body]


Not quite. I want a specific error message printed when a user specifies a
test class to run, and the class does not exist.

I updated my surefire version to 2.12 and got the same behavior as before.


On Mon, Nov 25, 2013 at 4:28 PM, Robert Scholte <rfscholte@apache.org>wrote:

> IIUC this has been fixed with version 2.12 by adding the
> failIfNoSpecifiedTests[1]
>
> Robert
>
> [1] http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#
> failIfNoSpecifiedTests
>
>
> Op Mon, 25 Nov 2013 16:07:53 +0100 schreef Andrew Pennebaker <
> apennebaker@42six.com>:
>
>  If I try to run a single test class with:
>>
>> mvn test -Dtest=namespace1.TestClass
>>
>> But TestClass is really in namespace1.namespace2, then Maven reports:
>>
>> Failed to execute goal
>> org.apache.maven.plugins:maven-surefire-plugin:2.9:test (default-test) on
>> project p1: No tests were executed!  (Set -DfailIfNoTests=false to ignore
>> this error.)
>>
>> Which is misleading. In fact, there is no class namespace1.TestClass.
>> Would
>> be nice if the message for this edge case were changed to something like:
>>
>> No such class: namespace1.TestClass.
>>
>> The current error message had me scratching my head for a while--TestClass
>> *does* have @Test methods!--before I realized I had forgotten to go one
>>
>> level deeper in my namespace.
>>
>> --
>> Cheers,
>>
>> Andrew Pennebaker
>> apennebaker@42six.com
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Cheers,

Andrew Pennebaker
apennebaker@42six.com


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic