Skip to content

Commit

Permalink
fix user guide describing wrong default behavior of @AnalyzeClasses (
Browse files Browse the repository at this point in the history
…#1406)

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.

Resolves: #1401
  • Loading branch information
codecholeric authored Jan 18, 2025
2 parents f11ffa5 + 75cb239 commit 477144a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/userguide/009_JUnit_Support.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ For further information see <<Controlling the Cache>>.
==== 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"]
Expand Down Expand Up @@ -116,6 +116,13 @@ production code, and only consider code that is directly supplied and does not c
As explained in <<The Core API>>, 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
Expand Down

0 comments on commit 477144a

Please sign in to comment.