Thanks for that.  That sounds a lot like TestNG's groups, which is a good
thing.  :)

Thanks again.  I'll check this out.
Ed

On Fri, Nov 18, 2011 at 5:19 PM, Kristian Rosenvold <
[email protected]> wrote:

> FWIW, surefire 2.11-SNAPSHOT supports the use of JUnit @Categories, which
> I believe a lot of users should be looking at for
> including/excluding tests, since it allows you to tag at the class/method
> level and apply multiple include/exclude filters, which means you can
> cross-cut a much more specific selection on your test-base.
>
> As long as you use junit 4.8 and the surefire 4.7 provider, you can use
> the groups the excludedGroups parameter.
>
> Kristian
>
>
>
> Den 17.11.2011 14:46, skrev Benson Margulies:
>
>> Note that I ported this into the formal documentation of the POM as well.
>>
>> On Thu, Nov 17, 2011 at 2:03 AM, Anders Hammar<[email protected]>  wrote:
>>
>>> Try the merge process config explained here:
>>> http://www.sonatype.com/**people/2011/01/maven-how-to-**
>>> merging-plugin-configuration-**in-complex-projects/<http://www.sonatype.com/people/2011/01/maven-how-to-merging-plugin-configuration-in-complex-projects/>
>>>
>>> /Anders
>>>
>>> On Thu, Nov 17, 2011 at 05:52, Ed Hillmann<[email protected]**>
>>>  wrote:
>>>
>>>> Hi.  I have a test which takes a long time to run.  What I'd like to do
>>>> is
>>>> exclude this test (written in JUnit) from the normal test phase, and
>>>> only
>>>> run it when a specific profile is defined.  So, in my pom, I configure
>>>> the
>>>> surefire plugin with an excludes element, which contains the exclude
>>>> child
>>>> element containing the name of the Test to skip.  And, it works great.
>>>>
>>>>            <plugin>
>>>>                <groupId>org.apache.maven.**plugins</groupId>
>>>>                <artifactId>maven-surefire-**plugin</artifactId>
>>>>                <configuration>
>>>>                    <systemPropertyVariables>
>>>>
>>>> <CUSTOM_HOME>${project.**basedir}/src/main/config</**CUSTOM_HOME>
>>>>                    </systemPropertyVariables>
>>>>
>>>> <argLine>-Djava.library.path=$**{jniLpSolverLibPath}</argLine>
>>>>                    <excludes>
>>>>                        <exclude>**/UseCaseUnitTest.**java</exclude>
>>>>                    </excludes>
>>>>                </configuration>
>>>>            </plugin>
>>>>        </plugins>
>>>>    </build>
>>>>
>>>> Now, I've added a profile to the POM file, which is the same as the
>>>> default
>>>> setting, but instead the excluded tag is empty.  However, the test is
>>>> always excluded.  No matter how I configure the profile, it always skips
>>>> over the test because it always picks up the original excludes
>>>> definition.
>>>> I've tried defining this in or out of an execution in the profile.
>>>>
>>>>        <profile>
>>>>            <id>tests.allTests</id>
>>>>            <build>
>>>>                <plugins>
>>>>                    <plugin>
>>>>                        <groupId>org.apache.maven.**plugins</groupId>
>>>>                        <artifactId>maven-surefire-**plugin</artifactId>
>>>>                        <configuration>
>>>>                            <excludes/>
>>>>                        </configuration>
>>>>                    </plugin>
>>>>                </plugins>
>>>>            </build>
>>>>        </profile>
>>>>
>>>> This goes against, well, every page and blog entry which tells you this
>>>> should happen.  I'm using version 2.10 of the surefire plugin on mvn
>>>> 3.0.3.  Am I doing something wrong?  Or has this stopped working?  My
>>>> guess
>>>> is I'm doing something not quite right, but I don't know what to do to
>>>> correct this.
>>>>
>>>> Thanks for any help,
>>>> Ed
>>>>
>>>>  ------------------------------**------------------------------**
>>> ---------
>>> To unsubscribe, e-mail: 
>>> users-unsubscribe@maven.**apache.org<[email protected]>
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>>  ------------------------------**------------------------------**
>> ---------
>> To unsubscribe, e-mail: 
>> users-unsubscribe@maven.**apache.org<[email protected]>
>> For additional commands, e-mail: [email protected]
>>
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> users-unsubscribe@maven.**apache.org<[email protected]>
> For additional commands, e-mail: [email protected]
>
>

Reply via email to