Error in Emma using ant

scmuser created the topic: Error in Emma using ant

Hi,

During offline mode, I am getting folllowing error using EMMA and ant…

taskdef A class needed by class com.vladium.emma.emmajavaTask cannot be found: org/apache/tools/ant/taskdefs/Java

Any Help?

Tagged :

Ant script with EMMA code-coverage

scmuser created the topic: Ant script with EMMA code-coverage

Ant script with EMMA code-coverage so it can find runtime coverage data?

<taskdef resource="emma_ant.properties">
    <classpath>            
        <pathelement location="lib/emma.jar" />
        <pathelement location="lib/emma_ant.jar" />
    </classpath>
</taskdef>
 
<target name="compile">
    <mkdir dir="build"/> <!-- vytvori adresar build -->
    <mkdir dir="build/classes"/>
    <mkdir dir="build/test"/>
    <javac destdir="build/classes" srcdir="src" debug="true" /> <!-- prelozi zdrojove kody -->
    <javac destdir="build/test" srcdir="test"> <!-- prelozi testy -->
        <classpath> <!-- pro prelozeni testu je potreba junit a prelozena aplikace -->
            <pathelement location="lib/junit-4.5.jar" />
            <pathelement location="build/classes" />
        </classpath>
    </javac>
</target>
 
<target name="build" depends="compile">
    <jar destfile="tetris.jar" basedir="build/classes"> <!-- zabali aplikaci do jaru -->
        <manifest>
            <attribute name="Main-Class" value="tetris.Main"/>
            <attribute name="Class-Path" value="lib/mysql-connector-java-5.1.6-bin.jar lib/derbyclient.jar"/>
        </manifest>
    </jar>
</target>
 
<target name="jar" depends="build"></target>
 
<target name="run" depends="compile">
    <java classname="tetris.Main" classpath="build/classes">  <!-- spusti aplikaci -->
        <classpath>
            <pathelement location="lib/mysql-connector-java-5.1.6-bin.jar" />
            <pathelement location="lib/derbyclient.jar" />
        </classpath>
    </java>
</target>
 
<target name="instrument" depends="compile">
    <mkdir dir="build/instrumented"/>
 
    <emma verbosity="verbose"> <!-- vytvori tridy upravene pro sledovani coverage -->
        <instr instrpath="build/classes"
                destdir="build/instrumented"
                metadatafile="build/metadata.emma"
                merge="true" />
    </emma>
</target>
 
<target name="test" depends="instrument">
    <mkdir dir="reports" />
    <mkdir dir="reports/junit" />
 
    <junit printsummary="yes" haltonfailure="no" fork="true"> <!-- pusti JUnit testy -->
        <classpath>
            <pathelement location="build/test" />
            <pathelement location="build/classes" />
            <pathelement location="build/instrumented" />
            <pathelement location="lib/junit-4.5.jar" />
            <pathelement location="lib/emma.jar" />
            <pathelement location="lib/emma_ant.jar" />
        </classpath>
 
        <formatter usefile="false" type="brief" />
        <formatter type="plain"/>
 
        <batchtest fork="yes" todir="reports/junit"> <!-- reporty budou v adresari reports/junit -->
            <fileset dir="test">
                <include name="**/TetrisSuite.java"/>
            </fileset>
        </batchtest>
        <jvmarg value="-Demma.coverage.out.file=build/coverage.emma"/>
        <jvmarg value="-Demma.coverage.out.merge=true" />
    </junit>
 
    <emma enabled="true" verbosity="verbose"> <!-- vygeneruje report emmy -->
        <report sourcepath="src">
            <fileset dir="build" includes="*.emma" />
 
            <html outfile="reports/coverage.html" />
        </report>
    </emma>
</target>
 
<target name="clean">
    <delete dir="build"/> <!-- smaze adresar build -->
    <delete dir="reports"/>
    <delete file="tetris.jar"/>
</target>

processing input file […NetBeansProjects/Tetris3/build/metadata.emma] …
loaded 25 metadata entries
1 file(s) read and merged in 5 ms
nothing to do: no runtime coverage data found in any of the data files

Tagged :

Jar instrumentation using Emma

scmuser created the topic: jar instrumentation using Emma
Hi,

I am just referring following url emma.sourceforge.net/faq.html#q.runtime.appservers

and trying to instrument jar directly instead of class files.

Is there any different process for instrumenting jar files?

scmuser replied the topic: Re:jar instrumentation using Emma

I found some useful info below….

<emma enabled="${emma.enabled}" >
      <instr mode="fullcopy"
             outdir="${out.instr.dir}"
             merge="no"
             filter="${emma.filter}"
      >
        <instrpath>
          <fileset dir="${out.dir}" includes="**/*.jar" />
        </instrpath>
      </instr>
    </emma>
Tagged :

Instrument Jar file issues

scmuser created the topic: Instrument Jar file issues

Hi,

i am instrumenting jar file using following script…

<emma enabled="${emma.enabled}" >
          <instr mode="overwrite" instrpath="${jar.location}"
             destdir="${inst.jar.location}"    
             metadatafile="${inst.jar.location}/metadata.emma"
             merge="no" >
        <instrpath>
          <fileset dir="${jar.location}" includes="**/*.jar" />
        </instrpath>

But
I am getting following error during execution….

[instr] processing instrumentation path …
[instr] package [org/w3c/dom] contains classes [DOMException] without full debug info
[instr] package [org/w3c/tidy] contains classes [AttrCheckImpl$CheckAlign] without full debug info
[instr] package [org/xml/sax] contains classes [HandlerBase] without full debug info
[instr] package [com/businessobjects/adv_ivcdzview] contains classes [ApplyQueries] without full debug info
[echo] build.fail is The following error occurred while executing this line:

java.lang.IllegalStateException: CONSTANT_info: invalid tag value [60]

Any Help on this?

Tagged :

Constant_info: invalid tag value

scmuser created the topic: CONSTANT_info: invalid tag value

Hi,

While Doing Instrumentation of jar file, I got following Error…Any help?

[instr] processing instrumentation path ...
    [instr] package [org/w3c/dom] contains classes [DOMException] without full debug info
    [instr] package [org/w3c/tidy] contains classes [AttrCheckImpl$CheckAlign] without full debug info
    [instr] package [org/xml/sax] contains classes [HandlerBase] without full debug info
    [instr] package [com/businessobjects/adv_ivcdzview] contains classes [ApplyQueries] without full debug info
     [echo] build.fail is The following error occurred while executing this line:
     [echo] build_body.xml:1675: java.lang.IllegalStateException: CONSTANT_info: invalid tag value [60]
Tagged :

Com.vladium.emma.EMMARuntimeException

scmuser created the topic: com.vladium.emma.EMMARuntimeException

Hi,
I have J2EE application. Whenever I am trying to instrument my jar file, I am getting following Error…

Any Help on this

com.vladium.emma.EMMARuntimeException: com.vladium.emma.EMMARuntimeException

Tagged :

Instrument class files from all subdirectory

rajeshkumar created the topic: instrument class files from all subdirectory

Hi, is there any possibilities to instrument classes from all sub-directory instead of single class directory? Any sample code?

Regards, Rajesh
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Java.lang.NoClassDefFoundError: com/vladium/emma/rt/RT

rajeshkumar created the topic: “java.lang.NoClassDefFoundError: com/vladium/emma/rt/RT”

I got sometime following error while using emma…

“java.lang.NoClassDefFoundError: com/vladium/emma/rt/RT”

Solution can be found in…

devnet.jetbrains.net/thread/275232
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :

Ant Example code for Emma Instrumentation and reports

rajeshkumar created the topic: Ant Example code for Emma Instrumentation and reports

In-place instrument a certain subset of already compiled classes using overwrite mode and several coverage filters:

<emma enabled="${emma.enabled}" >
      <instr instrpathref="${out.dir}/classes"
             mode="overwrite"
      >
        <!-- always exclude every class with a "Test" in the name: -->
        <filter excludes="*Test*" />
        <!-- don't instrument everything in "${out.dir}/classes",
             only the stuff I am working on now: -->
        <filter file="myincludes.txt" />
        <!-- additional ANT command line hook: -->
        <filter value="${emma.filter}" />
      </instr>
    </emma>

Don’t overwrite compiled classes that later need to go into official release jars (stay in copy mode). However, use incremental instrumentation for fast personal testing:

<emma enabled="${emma.enabled}" >
          <instr instrpathref="${out.dir}/classes"
                 outdir="${out.dir}/classes-instrumented"
                 merge="yes"
                 filter="${emma.filter}"
          />
    </emma>
 

Take all jars already produced by the product build and make test (coverage-enabled) copies of them:

    <emma enabled="${emma.enabled}" >
          <instr mode="fullcopy"
                 outdir="${out.instr.dir}"
                 merge="no"
                 filter="${emma.filter}"
          >
            <instrpath>
              <fileset dir="${out.dir}" includes="**/*.jar" />
            </instrpath>
          </instr>
    </emma>
 <copy todir="${dist}">
      <fileset dir="${src}"
               includes="**/images/*"
               excludes="**/*.gif"
      />
    </copy>
<copy todir="${dist}">
      <fileset dir="${src}">
        <include name="**/images/*"/>
        <exclude name="**/*.gif"/>
      </fileset>
    </copy>
 

Groups all files in directory ${server.src} that are Java source files and don’t have the text Test in their name.

<fileset dir="${server.src}" casesensitive="yes">
      <include name="**/*.java"/>
      <exclude name="**/*Test*"/>
</fileset>

Groups the same files as the above example, but also establishes a PatternSet that can be referenced in other elements, rooted at a different directory.

<fileset dir="${server.src}" casesensitive="yes">
      <patternset id="non.test.sources">
        <include name="**/*.java"/>
        <exclude name="**/*Test*"/>
      </patternset>
</fileset>
 

Groups all files in directory ${client.src}, using the same patterns as the above example.

<fileset dir="${client.src}" >
  	<patternset refid="non.test.sources"/>
</fileset>

Groups the same files as the top example, but using the selector.

<fileset dir="${server.src}" casesensitive="yes">
  <filename name="**/*.java"/>
  <filename name="**/*Test*" negate="true"/>
</fileset>

Groups the same files as the previous example using a combination of the selector and the selector container.

<fileset dir="${server.src}" casesensitive="yes">
  <filename name="**/*.java"/>
  <not>
    <filename name="**/*Test*"/>
  </not>
</fileset>

Selects all files in src/main

<fileset dir="src" includes="main/" />
 
     	<emma enabled="${emma.enabled}" >
          <instr mode="overwrite" 
          	 instrpath="${jar.location}"
                 destdir="${inst.jar.location}"	
                 metadatafile="${inst.jar.location}/metadata.emma"
                 merge="no" >
            	<instrpath>
              		<fileset dir="${jar.location}" includes="elance-services.jar,web-classes.jar,applet.jar,application-ejb.jar" />
            	</instrpath>
 
         </instr>
      	</emma>
 
 
      	<emma enabled="${emma.enabled}" >
	          <instr mode="fullcopy" 
	          	 instrpath="${jar.location}"
	          	 outdir="${inst.jar.location}"
 
	                 metadatafile="${inst.jar.location}/metadata.emma"
	                 merge="no" >
	            	<instrpath>
	              		<fileset dir="${jar.location}" includes="elance-services.jar,web-classes.jar,applet.jar,application-ejb.jar" />
	            	</instrpath>
 
	         </instr>
      	</emma>
 

Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :