The documentation for Reflections gives the first line on how to use Reflections:
Reflections reflections = new Reflections("com.my.project");
Except i don't know the name of the package. This is a piece of library code that should just be able to scan everything in the current package.
What is the Reflections equivalent of the .NET:
//Find all methods in all classes tagged with @Test annotation,
//and add them to a list.
List<MethodInfo> testMethods = new ArrayList<>();
//Enumerate all assemblies in the current application domain
for (Assembly a : AppDomain.currentDomain.getAssemblies()) {
//Look at each type (i.e. class) in the assembly
for (Type t : a.getTypes()) {
...
}
}
in other words, the "current" package? Or in the parlance of .NET
AppDomain.currentDomain
Edit:
- Is it a duplicate? No.
- Is it not a programming question? No
- Does it need details or clarity? No
- Does it need more focus? No
- Is it opinion based? No
Bonus Reading
- Get all methods with a particular annotation in a package (explains what a package is)
- How to find annotated methods in a given package? (explains what a package is)
And the final straw: