Emma Problem

22 views
Skip to first unread message

Terence Statt

unread,
Jun 2, 2008, 1:48:18 AM6/2/08
to 308clas...@googlegroups.com, John Dalbey
Hi:
I'm not sure if Jim made any more progress with Emma, but I am getting this error with it.  I looked up online how to instrument a .jar file and on the class tutorial and the commands are slightly different but produce the same error.
Here are the two commands that I tried:

C:\BlueJ\lib\extensions>java -cp emma-2.0.5312\lib\emma.jar;.;.\Fixstyle.jar emma instr -ip .\F
ixstyle.jar -m overwrite
C:\BlueJ\lib\extensions>java -cp emma-2.0.5312\lib\emma.jar emma instr -m overwrite -cp ./Fixst
yle.jar

(Yeah, ignore the line wrapping, its windows command line which has a set of like 80 characters long and you can't expand it.  Sorry)
Below is the same error message that I get.  Does anyone know how to stop this or get around this?  Maybe this enough for someone to take it since I took it this far and continue.

EMMA: processing instrumentation path ...
EMMA: package [org/apache/log4j/jmx] contains classes [AbstractDynamicMBean] without full debug
 info
EMMA: package [org/apache/log4j/net] contains classes [DefaultEvaluator] without full debug inf
o
EMMA: package [org/apache/log4j/xml] contains classes [XMLLayout] without full debug info
EMMA: package [] contains classes [Fixstyle] without full debug info
EMMA: package [de/hunsicker/io] contains classes [Copy] without full debug info
EMMA: package [de/hunsicker/jalopy] contains classes [Jalopy$SpyAppender] without full debug in
fo
EMMA: package [de/hunsicker/jalopy/language] contains classes [Annotation] without full debug i
nfo
EMMA: package [de/hunsicker/jalopy/language/antlr] contains classes [InternalJavaLexer] without
 full debug info
EMMA: package [de/hunsicker/jalopy/plugin] contains classes [AbstractAppender] without full deb
ug info
EMMA: package [de/hunsicker/jalopy/prefs] contains classes [Key] without full debug info
EMMA: package [de/hunsicker/jalopy/printer] contains classes [AbstractPrinter] without full deb
ug info
EMMA: package [de/hunsicker/jalopy/storage] contains classes [Convention$Key] without full debu
g info
EMMA: package [de/hunsicker/jalopy/swing] contains classes [AbstractSettingsPage$1] without ful
l debug info
EMMA: package [de/hunsicker/jalopy/swing/syntax] contains classes [DefaultSyntaxDocument$Docume
ntHandler] without full debug info
EMMA: package [de/hunsicker/swing] contains classes [DirectoryPanel] without full debug info
EMMA: package [de/hunsicker/swing/util] contains classes [PopupSupport$1] without full debug in
fo
EMMA: package [de/hunsicker/util] contains classes [ChainingRuntimeException] without full debu
g info
EMMA: package [de/hunsicker/util/concurrent] contains classes [FutureResult$1] without full deb
ug info
EMMA: package [edu/calpoly/twain/Fixstyle] contains classes [DefaultLoader$1] without full debu
g info
EMMA: EMMA classes appear to be included on the instrumentation
EMMA: path: this is not a correct way to use EMMA
[EMMA v2.0, build 5312]
emma instr: could not rename temporary file [C:\BlueJ\lib\extensions\Fixstyleemma32662.et] to [
C:\BlueJ\lib\extensions\Fixstyle.jar]: make sure the original file is not locked and can be del
eted
Exception in thread "main" com.vladium.emma.EMMARuntimeException: could not rename temporary fi
le [C:\BlueJ\lib\extensions\Fixstyleemma32662.et] to [C:\BlueJ\lib\extensions\Fixstyle.jar]: ma
ke sure the original file is not locked and can be deleted
        at com.vladium.emma.instr.InstrProcessorST.handleArchiveEnd(InstrProcessorST.java:375)
        at com.vladium.util.IPathEnumerator$Factory$PathEnumerator.enumerate(IPathEnumerator.ja
va:114)
        at com.vladium.emma.instr.InstrProcessorST._run(InstrProcessorST.java:715)
        at com.vladium.emma.Processor.run(Processor.java:54)
        at com.vladium.emma.instr.instrCommand.run(instrCommand.java:163)
        at emma.main(emma.java:40)

--
Terence Statt
510-557-5318
Csk...@gmail.com

John Dalbey

unread,
Jun 2, 2008, 10:00:55 AM6/2/08
to Terence Statt, 308clas...@googlegroups.com, John Dalbey
>
> Hi:
> I'm not sure if Jim made any more progress with Emma, but I am getting this
> error with it. I looked up online how to instrument a .jar file and on the
> class tutorial and the commands are slightly different but produce the same
> error.

Here's my initial response (I may have more later)...

I'm reasonably confident you DON'T want to instrument the
entire jar that contains Jalopy. We aren't interested in
coverage of Jalopy, only coverage of code you wrote.

I think it would be better to instrument just the
class files you wrote, before they get included
in the jar file.

--Mr. Dalbey

Terence Statt

unread,
Jun 2, 2008, 11:39:48 AM6/2/08
to John Dalbey, 308clas...@googlegroups.com, John Dalbey
Hi:
That makes sense, but when I instrument them and then try to add them to the already built jar by using winrar to replace the .class files with the .class files that emma created, the extension is no longer seen by BlueJ.  So, instead I left the .class files where they were and tried to run just unit test on the classes.  I set it up so it was -cp emmaClass;Fixstyle.jar so it should pull the emma classes first.  However, whatever emma did to the classes, junit cannot work because it cannot instantiate an Undo class which is one of the classes that emma modified.  I got the success message and everything when instrumenting just emma on our classes and got a blank coverage file that was created waiting to be filled.  However, whatever emma did to the class files, they don't work anymore.
--
Terence

John Dalbey

unread,
Jun 2, 2008, 1:51:52 PM6/2/08
to Terence Statt, 308clas...@googlegroups.com
Terence Statt wrote:
> That makes sense, but when I instrument them and then try to add them to
> the already built jar by using winrar to replace the .class files with
> the .class files that emma created, the extension is no longer seen by
> BlueJ.
> So, instead I left the .class files where they were and tried to
> run just unit test on the classes. I set it up so it was -cp
> emmaClass;Fixstyle.jar so it should pull the emma classes first.
By "emma classes first" I hope you mean your instrumented classes.

> However, whatever emma did to the classes, junit cannot work because it
> cannot instantiate an Undo class which is one of the classes that emma
> modified. I got the success message and everything when instrumenting
> just emma on our classes and got a blank coverage file that was created
> waiting to be filled. However, whatever emma did to the class files,
> they don't work anymore.

I don't know if you realize this, but when your instrumented classes
try to execute, they will need access to the emma.jar file.

If the instrumented classes can't access emma.jar, nothing happens,
and BlueJ won't recognize your extension.

--Mr. Dalbey


Reply all
Reply to author
Forward
0 new messages