From 75cb23903caae4d50aa474558541ec49f5dc6d66 Mon Sep 17 00:00:00 2001 From: Peter Gafert Date: Sun, 19 Jan 2025 00:40:02 +0100 Subject: [PATCH] fix user guide describing wrong default behavior of `@AnalyzeClasses` The user guide claims that without specifying anything `@AnalyzeClasses` will import the whole classpath. This is not true anymore since release 1.0, because we changed the default behavior to import the package of the annotated test class. The user guide now reflects this correctly and also mentions the option `wholeClasspath` to restore the old behavior. Signed-off-by: Peter Gafert --- docs/userguide/009_JUnit_Support.adoc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/userguide/009_JUnit_Support.adoc b/docs/userguide/009_JUnit_Support.adoc index f19c96d2c..0444b620e 100644 --- a/docs/userguide/009_JUnit_Support.adoc +++ b/docs/userguide/009_JUnit_Support.adoc @@ -73,7 +73,7 @@ For further information see <>. ==== Controlling the Import Which classes will be imported can be controlled in a declarative way through `@AnalyzeClasses`. -If no packages or locations are provided, the whole classpath will be imported. +If no packages or locations are provided, the package of the annotated test class will be imported. You can specify packages to import as strings: [source,java,options="nowrap"] @@ -116,6 +116,13 @@ production code, and only consider code that is directly supplied and does not c As explained in <>, you can write your own custom implementation of `ImportOption` and then supply the type to `@AnalyzeClasses`. +To import the whole classpath, instead of just the package of the test class, use the option + +[source,java,options="nowrap"] +---- +@AnalyzeClasses(wholeClasspath = true) +---- + ==== Controlling the Cache By default, all classes will be cached by location. This means that between different