|
| 1 | +# Guava Testlib: Google Testing Libraries for Java |
| 2 | + |
| 3 | +Guava testlib is a set of Java classes for more convenient |
| 4 | +unit testing. |
| 5 | + |
| 6 | +## Adding Guava Testlib to your build |
| 7 | + |
| 8 | +Guava testlib's Maven group ID is `com.google.guava` and its artifact ID is `guava-testlib`. |
| 9 | + |
| 10 | +To add a dependency on Guava testlib using Maven, use the following: |
| 11 | + |
| 12 | +```xml |
| 13 | +<dependency> |
| 14 | + <groupId>com.google.guava</groupId> |
| 15 | + <artifactId>guava-testlib</artifactId> |
| 16 | + <version>27.1-jre</version> |
| 17 | + <scope>test</scope> |
| 18 | +</dependency> |
| 19 | +``` |
| 20 | + |
| 21 | +To add a dependency using Gradle: |
| 22 | + |
| 23 | +```gradle |
| 24 | +dependencies { |
| 25 | + test 'com.google.guava:guava-testlib:27.1-jre' |
| 26 | +} |
| 27 | +``` |
| 28 | + |
| 29 | +## Links |
| 30 | + |
| 31 | +- [GitHub project](https://github.com/google/guava) |
| 32 | +- [Issue tracker: Report a defect or feature request](https://github.com/google/guava/issues/new) |
| 33 | +- [StackOverflow: Ask "how-to" and "why-didn't-it-work" questions](https://stackoverflow.com/questions/ask?tags=guava+java) |
| 34 | +- [guava-discuss: For open-ended questions and discussion](http://groups.google.com/group/guava-discuss) |
| 35 | + |
| 36 | +## IMPORTANT WARNINGS |
| 37 | + |
| 38 | +1. APIs marked with the `@Beta` annotation at the class or method level |
| 39 | +are subject to change. They can be modified in any way, or even |
| 40 | +removed, at any time. If your code is a library itself (i.e. it is |
| 41 | +used on the CLASSPATH of users outside your own control), you should |
| 42 | +not use beta APIs, unless you [repackage] them. **If your |
| 43 | +code is a library, we strongly recommend using the [Guava Beta Checker] to |
| 44 | +ensure that you do not use any `@Beta` APIs!** |
| 45 | + |
| 46 | +[Guava Beta Checker]: https://github.com/google/guava-beta-checker |
| 47 | + |
| 48 | +<!-- References --> |
| 49 | + |
| 50 | +[repackage]: https://github.com/google/guava/wiki/UseGuavaInYourBuild#what-if-i-want-to-use-beta-apis-from-a-library-that-people-use-as-a-dependency |
| 51 | + |
0 commit comments