Skip to content

eitanp461/fast-and-furious-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fast-and-furious-testing

A guide on using JUnit categories using maven-failsafe-plugin

Maven failsafe plugin can run JUnit categories.

The API says that "Only classes/methods/etc decorated with one of the groups specified here will be included in test run"

And indeed running

	mvn verify -Pfast

Runs both MyFastTest and MyFastAndFuriousTest.

But it turns out you can use group additivity to run a test class/method that has a all of the listed groups.

A use case example is running a test annotated with a category that includes {Sanity.class, Slow.class} in a custom Maven profile.

This can be achieved by combining profiles with "AND". See this project's pom.xml

Running

	mvn verify -Pfast-and-furious

Runs only MyFastAndFuriousTest since it has both annotations.

About

A guide on using JUnit categories using maven-failsafe-plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages