Warren Goldman | 17 May 2011 21:30

emma stopped working within eclipse

Clicking on the emma run icon gets me a popup;
The chosen operation is not currently available

Show View coverage gets me;
Could not create the view: Plug-in com.mountainminds.eclemma.ui was unable to 
load class com.mountainminds.eclemma.internal.ui.coverageview.CoverageView.

Details on this are;
java.lang.UnsupportedClassVersionError: Bad version number in .class file
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
	at 
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClas
sLoader.java:188)
	at 
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManage
r.java:580)
	at 
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathMana
ger.java:550)
	at 
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(Classpat
hManager.java:481)
	at 
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoa
der(ClasspathManager.java:469)
	at 
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathMan
ager.java:449)
	at 
(Continue reading)

Michael Giroux | 23 Mar 2006 23:55
Picon

Verbose XML report option

There is a question in the JUnit mailing list about generating a crossreference of JUnit test cases with lines of code that are covered.  It occurred to me that this could be done w/ Emma if the XML report included a list of lines that were covered. I wanted to point the user to Emma, but before I did, I wanted to verify that this might be possible.

I'm looking at the ReportGenerator.java module in com.vladium.emma.report.xml, and I'm sure that given enough time, I could figure out how to extend it to produce a verbose report including line coverage.

It would be much faster if there was a document that described the format of the EC file and/or the format of the data being delt with in the ReportGenerator.

Does such a document exist?  I've been poking around the CVS but do not see one yet.

Michael Giroux
vlad | 8 Jan 2005 18:51
Favicon

EMMA-users mailing list to be disabled


It appears that most of EMMA related discussion is taking place via EMMA SourceForge forums (http://sourceforge.net/forum/?group_id=108932). Furthermore, viruses and spammers have become aware of the post address for EMMA-users. Due to limitations of GNU mailman software, I have to visit the admin pages frequently to manually clear the pending post queue from spam and viral submissions.

Given the above, I am going to close the list shortly. Please continue to use EMMA SourceForge  forums instead. You can get to them via EMMA's SourceForge project site or EMMA web site (note that SourceForge users can configure forums to send them posts by email). EMMA-announce list will continue to operate as long as the spam problem is not as severe.

Regards.
Vlad.
vlad | 28 Dec 2004 02:29
Favicon

Re: Thanks


Marty,

        Thanks for giving EMMA a try. Regarding Eclipse integration, there is an RFE logged for that but at the moment I don't even have a guess when it would be implemented.

I have been an Eclipse user for a long time but I also happily run EMMA from command line or ANT and don't seem to need anything else. Proper integration likely means much more than just running ANT tasks from within Eclipse (although if that does not work, I would be happy to log that as an issue): things like highlighing coverage directly in Eclipse file views, etc.

Vlad.


Please respond to emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

Sent by:        emma-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

To:        emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
cc:        

Subject:        [EMMA-users] Thanks

To the team behind Emma,

Thanks a bunch.  I downloaded Emma and was instrumenting in 20 minutes.  I
couldn't believe how easy it was.  This is the first code coverage tool
that didn't feel painfully "heavy" (and I have tried quite a few).

Now one question: has anyone integrated Emma into Eclipse in some form?
Or is there any advice for integrating Emaa into an Ant file that is going
to run under Eclipse?

Thanks.


--Marty



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
EMMA-users mailing list
EMMA-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/emma-users


Martin Wegner | 23 Dec 2004 03:34
Picon
Favicon

Thanks

To the team behind Emma,

Thanks a bunch.  I downloaded Emma and was instrumenting in 20 minutes.  I
couldn't believe how easy it was.  This is the first code coverage tool
that didn't feel painfully "heavy" (and I have tried quite a few).

Now one question: has anyone integrated Emma into Eclipse in some form? 
Or is there any advice for integrating Emaa into an Ant file that is going
to run under Eclipse?

Thanks.

--Marty

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
vlad | 21 Dec 2004 03:53
Favicon

Re: Re: Maven plugin


Hi Stefan,
        Looks like you've got it sorted. I'll let Dilum comment on what the best fix is supposed to be (he tells me there is a typo in maven plugin docs).

As a side comment, I suggest you use SourceForge EMMA forums for future discussions. This mailing list somehow never took off in a big way and is now dominated by virus and spam requests. (This does not show in the archives, but I had to disable posts by nonsubscribers and now have to remove pending spam requests almost on a daily basis. I am going to disable this list entirely very soon.)

Cheers,
Vlad.


Please respond to emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

Sent by:        emma-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

To:        emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
cc:        

Subject:        [EMMA-users] Re: Maven plugin

Hi again,

I looked into the jelly code (plugin.jelly file), and after using the
ant report directly from ant (which is really brilliant in easy of use
and reporting quality) I think I know what to change in the maven plugin
to gain access to the source files in the report. In line 154 I changed

<ant:report sourcepath="${maven.compile.source}">

to

<ant:report sourcepath="${maven.emma.src}">

(which I set to the directory where my source files are located ...
there must be a more elegant way, but I do not know much about the built
in properties in maven ...) and now it works fine. (BTW:
maven.compile.source is the property to specify the version for which
the java code is written, so I had to set it to 1.5).

Best regards,

Stefan Hedtfeld.

Solgrims wrote:

> Hi,
>
> I've just started to use emma via the maven plugin and I must say:
> that's a great tool! I've used clover and jcoverage before (where
> clover is also great but more expensive ;-), but after upgrading my
> projects one by one to JDK 5.0 those failed to work. And it's good to
> see there are tools which don't get confused by new language features.
>
> Two things I wanted to give you feedback about.
>
> 1. Maven is usually configured to have a repository in
> [USERHOME]/.maven/repository. But you may also configure it to have
> it's repository at [MAVENHOME]/.maven/repository (which ist the way I
> do it, actually). The maven-emma-plugin insists to have the repository
> under the USERHOME, so I had to create that (actually I still had a
> repository the, but that was some leftover garbage ... blame me for
> not cleaning up). After putting the jars there, too, everything worked
> fine. By the way: I'd like to be dependent of a special version (e.g.
> 2.0.4217), but that really is a minor issue.
>
> 2. The report generated by "maven emma:report" states on the class
> reporting level (where the different methods of a single class are
> listed) that "[source file 'de.mypackage.MyClass.java' not found in
> sourcepath]". Is there a property missing which I should have set? (I
> simply followed the instructions given in the net where to copy the
> jars, adding the dependencies and the run the goal.)
>
> Regards,
>
> Stefan Hedtfeld.
>



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
EMMA-users mailing list
EMMA-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/emma-users


Solgrims | 15 Dec 2004 23:03
Picon

Maven plugin

Hi,

I've just started to use emma via the maven plugin and I must say: 
that's a great tool! I've used clover and jcoverage before (where clover 
is also great but more expensive ;-), but after upgrading my projects 
one by one to JDK 5.0 those failed to work. And it's good to see there 
are tools which don't get confused by new language features.

Two things I wanted to give you feedback about.

1. Maven is usually configured to have a repository in 
[USERHOME]/.maven/repository. But you may also configure it to have it's 
repository at [MAVENHOME]/.maven/repository (which ist the way I do it, 
actually). The maven-emma-plugin insists to have the repository under 
the USERHOME, so I had to create that (actually I still had a repository 
the, but that was some leftover garbage ... blame me for not cleaning 
up). After putting the jars there, too, everything worked fine. By the 
way: I'd like to be dependent of a special version (e.g. 2.0.4217), but 
that really is a minor issue.

2. The report generated by "maven emma:report" states on the class 
reporting level (where the different methods of a single class are 
listed) that "[source file 'de.mypackage.MyClass.java' not found in 
sourcepath]". Is there a property missing which I should have set? (I 
simply followed the instructions given in the net where to copy the 
jars, adding the dependencies and the run the goal.)

Regards,

Stefan Hedtfeld.

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
vlad | 23 Sep 2004 19:32
Favicon

RE: User instrumentation


Yes, you are correct. There are two levels of optimization applied: one by the bytecode compiler and the other one by the JIT compiler.

So, I correct my earlier statement: the DEBUG and assert guards don't look similar at the bytecode level. However, in the end they are optimized away at the native code level just the same. And I do believe the assert guards use a static final constant effectively (massaged by the classloader).

Vlad.


Please respond to emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

Sent by:        emma-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

To:        emma-users-5NWGOfrQmncRDUWM+popnw@public.gmane.orgforge.net
cc:        

Subject:        RE: [EMMA-users] User instrumentation

But, an observation:
 
If I write your example below & compile with javac, the line number table entries & bytecodes for the contents of that if() statement are never written to the .class file by javac.
 
But I'll hedge and say that perhaps different compilers behave differently. ;)
 
- Paul
 



From: emma-users-admin-5NWGOfrQmnd4wTydcyPnfg@public.gmane.orgceforge.net [mailto:emma-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of vlad-+F+d0juzi95BDgjK7y7TUQ@public.gmane.org
Sent: Thursday, September 23, 2004 9:57 AM
To: emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: RE: [EMMA-users] User instrumentation
 

Nope, I disagree (about the Boolean.getBoolean("something") part)

The assertion checks indeed check a static final constant and for all intents and purposes it looks like it is initialized to a compile-time constant. The trick for enabling/disabling them is that the classloader massages that field at class loading time. That's why assertion API is somewhat tied into classloading....

So, to the JIT compiler the assertion guard fields don't look any different than my DEBUG example earlier.

Vlad.

Please respond to emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

Sent by:        emma-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

To:        emma-users-5NWGOfrQmncRDUWM+popnw@public.gmane.orgforge.net
cc:        

Subject:        RE: [EMMA-users] User instrumentation

*grin*.

Sure.  But (I'm annoying, I know) -- we're not talking about static final X = false --- we're talking about static final X = Boolean.getBoolean("something").
 
This obviously isn't handled by javac at bytecode generation time.  But, my understanding is that the JIT compiler does indeed handle it – that the hotspot guys triple checked that it really does work when they added the assertion language feature in 1.4.
 
- Paul
 


 


From: emma-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:emma-users-admin <at> lists.sourceforge.net] On Behalf Of vlad-+F+d0juzi95BDgjK7y7TUQ@public.gmane.org
Sent: Thursday, September 23, 2004 9:38 AM
To: emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: RE: [EMMA-users] User instrumentation
 

The compiler hasn't been including bytecode for any branch that is provably unreachable via static analysis since v1.0. That's how a poor man's version of conditional compilation works in Java:

private static final DEBUG = false;

if (DEBUG)
{
... this bytecode will not emitted ...
}

In v1.4 (or 1.3, can't remember now) of the compiler they even started doing this for boolean expressions that involve local variables and not just static final fields init'ed to compile-time expressions. Finally, my (esoteric) coding style of declaring just about everything final is paying off :)....

Vlad.

Please respond to emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

Sent by:        emma-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

To:        emma-users-5NWGOfrQmncRDUWM+popnw@public.gmane.orgforge.net
cc:        

Subject:        RE: [EMMA-users] User instrumentation

I believe, under the covers, assertions are simply implemented with a private static final boolean inside each class.  When it's set to false, the JIT compiler doesn't bother including code for the if() branch.

I doubt there is any need for a JSR for this - it could be done just as easily with a -Demma.enabled=false on the command line.

- Paul

-----Original Message-----
From: emma-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:emma-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Michael.Giroux <at> Bull.com

Sent: Thursday, September 23, 2004 9:12 AM
To: emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: RE: [EMMA-users] User instrumentation

> Well the same class files are also used by the
> appserver when we are through with unit testing.
> Rebuilding them with WSAD is really timeconsuming so
> I'd rather not instrument them separately.
>
> Deepu.

I'm starting to see a potential for a new JSR.

With Java assertions, it is possible to embed debug code that has a zero
impact on production environments because the java -da/-ea switch can be
used to disable or enable assertion code. The assertion support allows for
assertions to be enabled/disabled at an individual package and/or class.

It would be handy if assertions had some form of "type" and could be
enabled/disabled within a package by "type".  This would allow EMMA to
insert instrumentation as assert statements with a defined "type".  Type
could be specified in the form of package names, or perhaps numeric values
as is done with the logging apis.  Subsequently, the class file could be
executed with -da for production, -ea:package[types] for code coverage.

Michael

-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
EMMA-users mailing list
EMMA-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/emma-users

vlad | 23 Sep 2004 00:25
Favicon

Re: Output file locking does not save from OutOfMemoryError.


I have doubts whether this code is reliable. Depends on how atomic directory creation/deletion is made by the JVM. The Tracker issue for this problem is probably the best place to continue this discussion. My plans were to use J2SE 1.4 locking when it's supported and default to using a UDP port as a machine-global lock otherwise.

Vlad.


Please respond to emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

Sent by:        emma-users-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

To:        emma-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
cc:        

Subject:        [EMMA-users] Output file locking does not save from OutOfMemoryError.

This what I tried in DataFactory:

   /*
    * input checked by the caller
    */
   private static void persist (final IMergeable data, final byte type,
final File file)
       throws IOException
   {
       final Logger log = Logger.getLogger ();

       final File lock=new File(file.getPath()+".lock");
       final long start=System.currentTimeMillis();

       log.info ("locking "+lock.getAbsolutePath()+" for writing...");
       while (!lock.mkdirs() &&
(System.currentTimeMillis()-start)<MAX_DELAY) {
         try {
           Thread.sleep(100);
         }
         catch (InterruptedException ex) {
         }
       }
       try {
         if (lock.exists()) {
           lock.deleteOnExit();
           log.info ("locked in
"+(System.currentTimeMillis()-start)+"ms.");
         }
         else {
           log.warning ("lock failed - timeout");
         }
         persist_(data, type, file);
       }
       finally {
         lock.delete();
         log.info ("Unlocked "+lock.getAbsolutePath());
       }
   }
   /*
    * input checked by the caller
    */
   private static void persist_ (final IMergeable data, final byte
type, final File file)
       throws IOException
   {
....

But the result is still the same - OutOfMemoryError.

- Alexey.



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
EMMA-users mailing list
EMMA-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/emma-users


Alexey N. Solofnenko | 22 Sep 2004 22:05

Output file locking does not save from OutOfMemoryError.

This what I tried in DataFactory:

    /*
     * input checked by the caller
     */
    private static void persist (final IMergeable data, final byte type, 
final File file)
        throws IOException
    {
        final Logger log = Logger.getLogger ();

        final File lock=new File(file.getPath()+".lock");
        final long start=System.currentTimeMillis();

        log.info ("locking "+lock.getAbsolutePath()+" for writing...");
        while (!lock.mkdirs() && 
(System.currentTimeMillis()-start)<MAX_DELAY) {
          try {
            Thread.sleep(100);
          }
          catch (InterruptedException ex) {
          }
        }
        try {
          if (lock.exists()) {
            lock.deleteOnExit();
            log.info ("locked in 
"+(System.currentTimeMillis()-start)+"ms.");
          }
          else {
            log.warning ("lock failed - timeout");
          }
          persist_(data, type, file);
        }
        finally {
          lock.delete();
          log.info ("Unlocked "+lock.getAbsolutePath());
        }
    }
    /*
     * input checked by the caller
     */
    private static void persist_ (final IMergeable data, final byte 
type, final File file)
        throws IOException
    {
....

But the result is still the same - OutOfMemoryError.

- Alexey.

-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
Deepu Roy | 22 Sep 2004 18:23
Picon
Favicon

User instrumentation

Hi,
Is there a feature in EMMA that allows me to
instrument a class file before EMMA instruments it. I
need to instrument classes to implement Serializable
so that I can save the instance states when running
tests. I also need to know the coverage of my tests.
Is there any way that I can make Emma use the classes
I instrumented for its instrumentation without
actually overwriting the .class files on disk.
Something like a decorator maybe?

Thanks,
Deepu.

		
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail

-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php

Gmane