havapa / testability-explorer

Automatically exported from code.google.com/p/testability-explorer
Apache License 2.0
0 stars 0 forks source link

Maven Plugin does not find classes from dependencies when analyzing (Missing from Classpath?) #28

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Build a Maven Project with a base class
2. Build a Maven Project with a class that extends a class from the first
project, or uses a class from the first project
3. Run Testability Explorer using the Maven plugin on the Second project. 

What is the expected output? What do you see instead?
Expected: The Testability Report for the second project will include all
classes from the second project, and will presumably include transitive
costs from dependencies on classes in the first project.
Observed: Testability Explorer cannot find classes from the first project
for analysis, causing scores to be ignored, if the are a dependency, or
preventing analysis of a class in the second project if it extends a class
in the first project.
Trace Output:
------------------------------------------------------------------------
[INFO] Building Unnamed -
com.defect.example:consumer-project:jar:0.0.1-SNAPSHOT
[INFO]    task-segment:
[com.google.testability-explorer:maven2-testability-plugin:1.3.1-SNAPSHOT:testab
ility]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing 2-testability:testability
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [2-testability:testability]
WARNING: class not found: com.defect.example.BaseClass
WARNING: can not analyze class 'com.defect.example.consumer.ExtenderClass'
since class 'com/defect/example/BaseClass' was not found.
------------------------------------------------------------------------

What version of the product are you using? On what operating system?
- 1.3.1-SNAPSHOT, Windows XP

Please provide any additional information below.
- Providing source as part of the first project's deployment does not
resolve the issue. 
- Attached is two simple projects with an aggregator, that demonstrates the
issue when Testability explorer is run on the consumer-project. 

Original issue reported on code.google.com by TylerGoo...@gmail.com on 12 May 2009 at 6:39

Attachments:

GoogleCodeExporter commented 8 years ago
I've made a fix.

Original comment by cedric.l...@gmail.com on 18 Jun 2009 at 3:06

Attachments:

GoogleCodeExporter commented 8 years ago
Hey Cedric,

I tried running with your patch applied.  It does get all the classes in the
classpath for analysis which is good, but unfortunately now all the classes in 
the
classpath are also in the report.  So if I have a project that has 10 classes, 
and
depends upon a framework with 500 classes, my 10 get swamped in the report.

I'm wondering if we could use an additional WhiteList implementation set up as a
decorator to the main WhiteList which is based on the classes in the output 
directory
of the module, to limit our reporting to just those files in the current module.

Original comment by TylerGoo...@gmail.com on 14 Jul 2009 at 7:48

GoogleCodeExporter commented 8 years ago
Hello Tyler,
Glad to know it worked for you. You're right, all classes are being analyzed. I 
was 
thinking about an "automatic whitelist" feature to analyze only classes in 
Maven's 
source path (typically src/main/java).

Original comment by cedric.l...@gmail.com on 14 Jul 2009 at 8:15

GoogleCodeExporter commented 8 years ago
Here's an updated patch that can be applied to the new Guice-based source (as 
of r442).

Original comment by pja...@gmail.com on 7 Aug 2009 at 8:23

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the help, all.

@pjanes, I applied your patch in
http://code.google.com/p/testability-explorer/source/detail?r=456
There's an issue on HEAD where the html report takes forever to run, so the 
plugin
isn't exactly working. I'm going to scale back the analysis work to determine 
the
cost contribution from each issue.

Original comment by aeagle22206 on 18 Aug 2009 at 7:56