You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JUnit-import excludes non-test production code, dropping its call expressions #68
CallGraphProcessor treats any file that imports org.junit.* / junit.* as a test file and excludes it from analysis before the call graph is built.
A bare import is not evidence that a file is a test - every such file is silently dropped: none of its methods are registered and so every call into it from real production code resolves to nothing - no source edge, no library edge. The call simply vanishes from the graph.
This is the general form of the problem reported in issue #66 which covers only the special case where the file's own package is org.junit/junit (i.e. JUnit itself).
Root cause
CallGraphProcessor.getImports (CallGraphProcessor.java) raises the flag on the import string alone:
// To cover all type of junit packages, we added these 2 conditions.// Previously we used to maintain a list containing test packages.if (importString.toString().startsWith("org.junit")
|| importString.toString().startsWith("junit")) {
hasJUnitImport = true;
}
buildCallGraph, phase 1 (CallGraphProcessor.java), excludes the file outright when that flag is set - the import signal is ORed with the directory signal:
Activity