Improve test_class documentation
PiperOrigin-RevId: 232394883
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaTestRule.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaTestRule.java
index 5f60b9a..261bbc7 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaTestRule.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaTestRule.java
@@ -83,9 +83,11 @@
</p>
<p>
This attribute specifies the name of a Java class to be run by
- this test. It is rare to need to set this. If this argument is omitted, the Java class
- whose name corresponds to the <code>name</code> of this
- <code>java_test</code> rule will be used.
+ this test. It is rare to need to set this. If this argument is omitted,
+ it will be inferred using the target's <code>name</code> and its
+ source-root-relative path. If the test is located outside a known
+ source root, Bazel will report an error if <code>test_class</code>
+ is unset.
</p>
<p>
For JUnit3, the test class needs to either be a subclass of