Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

EclEmma coverage runs fail when package-info.java is present #21

Closed
AndreasBrieg opened this issue Nov 7, 2012 · 2 comments
Closed
Labels

Comments

@AndreasBrieg
Copy link

In Eclipse I tried to run all JUnit tests for the src/test/java directory of a maven project. I get the error message "Error while analyzing package fragment root java at F//target/classes (code 5007).". The system could not find the file package-info.class.

The stacktrace is:

org.eclipse.core.runtime.CoreException: File not found: <project-root-dir>\target\classes\<package>\package-info.class.
    at org.eclipse.core.internal.filesystem.Policy.error(Policy.java:55)
    at org.eclipse.core.internal.filesystem.local.LocalFile.openInputStream(LocalFile.java:371)
    at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:797)
    at org.eclipse.core.internal.resources.File.getContents(File.java:289)
    at com.mountainminds.eclemma.internal.core.analysis.ResourceTreeWalker.walkResource(ResourceTreeWalker.java:60)
    at com.mountainminds.eclemma.internal.core.analysis.ResourceTreeWalker.walkResource(ResourceTreeWalker.java:74)
    at com.mountainminds.eclemma.internal.core.analysis.ResourceTreeWalker.walkResource(ResourceTreeWalker.java:74)
    at com.mountainminds.eclemma.internal.core.analysis.ResourceTreeWalker.walkResource(ResourceTreeWalker.java:74)
    at com.mountainminds.eclemma.internal.core.analysis.ResourceTreeWalker.walkResource(ResourceTreeWalker.java:74)
    at com.mountainminds.eclemma.internal.core.analysis.ResourceTreeWalker.walkResource(ResourceTreeWalker.java:74)
    at com.mountainminds.eclemma.internal.core.analysis.ResourceTreeWalker.walkResource(ResourceTreeWalker.java:74)
    at com.mountainminds.eclemma.internal.core.analysis.ResourceTreeWalker.walk(ResourceTreeWalker.java:50)
    at com.mountainminds.eclemma.internal.core.analysis.PackageFragementRootAnalyzer.analyzeInternal(PackageFragementRootAnalyzer.java:63)
    at com.mountainminds.eclemma.internal.core.analysis.PackageFragementRootAnalyzer.analyze(PackageFragementRootAnalyzer.java:46)
    at com.mountainminds.eclemma.internal.core.analysis.SessionAnalyzer.processPackageFragmentRoot(SessionAnalyzer.java:100)
    at com.mountainminds.eclemma.internal.core.analysis.SessionAnalyzer.processSession(SessionAnalyzer.java:80)
    at com.mountainminds.eclemma.internal.core.JavaCoverageLoader$LoadSessionJob.run(JavaCoverageLoader.java:81)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.io.FileNotFoundException: <project-root-dir>\target\classes\<package>\package-info.class (Das System kann die angegebene Datei nicht finden)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at org.eclipse.core.internal.filesystem.local.LocalFile.openInputStream(LocalFile.java:362)
    ... 16 more

Seems like the ResourceTreeWalker should ignore package-info.

@AndreasBrieg
Copy link
Author

I'm using Indigo with EclEmma 2.2.0.

Further system information:

eclipse.buildId=M20120208-0800
java.version=1.7.0_07
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product -clean

@marchof
Copy link
Member

marchof commented Nov 7, 2012

I don't think this is an issue with package-info.class (I have several project with such files).

It is probably refresh issue. If you run Maven in the same workspace than Eclipse will see outdated resources. Please try to refresh your projects (F5) before you run EclEmma.

@marchof marchof closed this as completed Nov 7, 2012
@jacoco jacoco locked and limited conversation to collaborators Jan 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants