Guava: Addition of test size annotations (@SmallTest, @MediumTest, @LargeTest)

Created on 31 Oct 2014  路  6Comments  路  Source: google/guava

_Original issue created by benjamin.j.mccann on 2013-07-10 at 06:52 PM_


It would be great to put test size annotations in guava-testlib (https://code.google.com/p/guava-libraries/source/browse/#git%2Fguava-testlib%2Fsrc%2Fcom%2Fgoogle%2Fcommon%2Ftesting)

These annotations allow splitting tests up by size (i.e. whether they have external dependencies, how long they take to run, etc.) For more information see the Google testing blog post (http://googletesting.blogspot.com/2010/12/test-sizes.html).

These annotations are already included in Android (see android.test.suitebuilder.annotation.SmallTest). It would be great to make them available to the rest of the Java world and very easy since the source is already there. I've attached the files I'd like to see added, which I took from the Android source simply changing the package name and copyright notice.

package=testing type=addition

All 6 comments

_Original comment posted by [email protected] on 2013-07-10 at 07:35 PM_


_(No comment entered for this change.)_


Owner: [email protected]

_Original comment posted by [email protected] on 2013-07-10 at 08:11 PM_


This sort of seems like it ought to be independent of Guava?

_Original comment posted by benjamin.j.mccann on 2013-07-10 at 08:16 PM_


I'm not sure why you say that? It seems like it'd fit well with guava-testlib (not the main guava project). There are lots of things there that are test oriented common code like https://github.com/google/guava/blob/master/guava-testlib/src/com/google/common/testing/TearDown.java

_Original comment posted by benjamin.j.mccann on 2014-07-16 at 08:48 AM_


Any thoughts on this one? This library class is used extensively within Google, so it's very sad to see it missing from Guava.

Maven and Gradle both have the ability to run Junit classes with category annotations. But right now each project has to create their own annotations. It'd be great to have a set of standard ones to rely on.

I too want to have this functionality. People who do UI automation testing would like to have an indicator of how long a test is expected to run when it works properly.

Agreed with Louis that this should be separate from Guava

Was this page helpful?
0 / 5 - 0 ratings

Related issues

terence1984 picture terence1984  路  3Comments

cowwoc picture cowwoc  路  3Comments

gissuebot picture gissuebot  路  5Comments

thecoop picture thecoop  路  4Comments

gissuebot picture gissuebot  路  5Comments