You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Lis Maria <li...@gmail.com> on 2011/03/15 06:37:51 UTC

Emma Configuration in Ant

Hello..

I am trying to add emma configurations into my Hybris ant build scripts. The
issue i face is, the junit that runs on the instrumented classes fails,
because of which i do not think the report emma generates is correct.  ant
version is 1.8 and emma version is 2.1. The junit jar i use is of version4.9

'Class not found exception' is what junits throws when they run on the
instrumented class files . Any help much appreciated.

Thanks,
Lis Thomas

Re: Emma Configuration in Ant

Posted by Mark Salter <ma...@talktalk.net>.
On 15/03/2011 11:53, Lis Maria wrote:
>     [junit] de/hybris/platform/persistence/AbstractTypeInitializer
>     [junit] java.lang.NoClassDefFoundError:
I guess you are missing a jar from your classpath that holds the Hybris
persistence code that your unit tests need?

HTH

-- 
Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Emma Configuration in Ant

Posted by Lis Maria <li...@gmail.com>.
This is one fo the exception i get


[instr] processing instrumentation path ...
    [instr] instrumentation path processed in 183 ms
    [instr] [13 class(es) instrumented, 0 resource(s) copied]
    [instr] metadata merged into
[/opt/hybris/bin/rules/emma/metadata.emma] {in 149 ms}
    [junit] Testsuite: cocmscockpit.GeneratedTypeInitializer
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
    [junit]
    [junit] Null Test: 	Caused an ERROR
    [junit] de/hybris/platform/persistence/AbstractTypeInitializer
    [junit] java.lang.NoClassDefFoundError:
de/hybris/platform/persistence/AbstractTypeInitializer
    [junit] 	at java.lang.ClassLoader.defineClass1(Native Method)
    [junit] 	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
    [junit] 	at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
    [junit] 	at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    [junit] 	at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    [junit] 	at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    [junit] 	at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    [junit] 	at java.security.AccessController.doPrivileged(Native Method)
    [junit] 	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    [junit] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    [junit] 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    [junit] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    [junit] 	at java.lang.Class.forName0(Native Method)
    [junit] 	at java.lang.Class.forName(Class.java:169)
    [junit] Caused by: java.lang.ClassNotFoundException:
de.hybris.platform.persistence.AbstractTypeInitializer
    [junit] 	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    [junit] 	at java.security.AccessController.doPrivileged(Native Method)
    [junit] 	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    [junit] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    [junit] 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    [junit] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

And i get this for all the classes too

Thanks,
Lis


On Tue, Mar 15, 2011 at 5:20 PM, Mark Salter <ma...@talktalk.net>wrote:

> On 15/03/2011 11:40, Lis Maria wrote:
> > It is nt emma eror that i get , but it says classnotfound exception for
> any
> > class it executes in the junit section
> The actual and full Exception you are seeing but we are not would be a
> useful piece of information to help guide you.
>
> 8)
>
> --
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Re: Emma Configuration in Ant

Posted by Mark Salter <ma...@talktalk.net>.
On 15/03/2011 11:40, Lis Maria wrote:
> It is nt emma eror that i get , but it says classnotfound exception for any
> class it executes in the junit section
The actual and full Exception you are seeing but we are not would be a
useful piece of information to help guide you.

8)

-- 
Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Emma Configuration in Ant

Posted by Lis Maria <li...@gmail.com>.
Hi Manas,

It is nt emma eror that i get , but it says classnotfound exception for any
class it executes in the junit section

<target name="emma-coverage" description="generates emma coverage report">

        <mkdir dir="${instrumented.dir}"/>
        <emma enabled="true">
            <instr instrpathref="emma.coverage.classes"
                     destdir="${instrumented.dir}"
                     metadatafile="${coverage.dir}/metadata.emma"
                     merge="true">
                   <filter value="${emma.filter}" />
             </instr>
        </emma>
        <mkdir dir="/opt/hybris/bin/rules/junit" />
        <junit printsummary="no" haltonfailure="no" fork="true"
failureproperty="tests.failed" errorproperty="tests.failed">
   <classpath>
    <pathelement location="${instrumented.dir}" />
    <pathelement
location="/opt/hybris/bin/platform/apache-ant-1.8.1/lib/junit-4.9b2.jar" />
    <pathelement
location="/opt/hybris/bin/platform/apache-ant-1.8.1/lib/emma-2.1.5320/emma.jar"
/>
    <pathelement
location="/opt/hybris/bin/platform/apache-ant-1.8.1/lib/emma-2.1.5320/emma_ant.jar"
/>
    <path refid="emma.lib" />
   </classpath>
   <formatter usefile="false" type="brief" />
   <formatter type="plain"/>
   <batchtest fork="yes" todir="/opt/hybris/bin/rules/junit">
                <fileset dir="${instrumented.dir}" includes="**/*.class"/>
   </batchtest>
   <jvmarg
value="-Demma.coverage.out.file=/opt/hybris/bin/rules/emma/coverage.emma"/>
   <jvmarg value="-Demma.coverage.out.merge=false" />
  </junit>
        <emma enabled="true" >
              <report sourcepath="/opt/hybris/bin/custom" >
              <fileset dir="/opt/hybris/bin/rules/emma" >
              <include name="*.emma" />
              </fileset>
                     <xml outfile="/opt/hybris/bin/rules/emma/coverage.xml"
                     depth="package"
              />
              </report>
              </emma>
</target>

Thanks,
Lis
On Tue, Mar 15, 2011 at 3:15 PM, Manas Panda <ma...@gmail.com> wrote:

> Is it EMMA class not found error ? If yes then add emma.jar to the class
> path while running your Junit cases .
>
> HTH
>
> On Tue, Mar 15, 2011 at 11:07 AM, Lis Maria <li...@gmail.com> wrote:
>
> > Hello..
> >
> > I am trying to add emma configurations into my Hybris ant build scripts.
> > The
> > issue i face is, the junit that runs on the instrumented classes fails,
> > because of which i do not think the report emma generates is correct.
>  ant
> > version is 1.8 and emma version is 2.1. The junit jar i use is of
> > version4.9
> >
> > 'Class not found exception' is what junits throws when they run on the
> > instrumented class files . Any help much appreciated.
> >
> > Thanks,
> > Lis Thomas
> >
>

Re: Emma Configuration in Ant

Posted by Manas Panda <ma...@gmail.com>.
Is it EMMA class not found error ? If yes then add emma.jar to the class
path while running your Junit cases .

HTH

On Tue, Mar 15, 2011 at 11:07 AM, Lis Maria <li...@gmail.com> wrote:

> Hello..
>
> I am trying to add emma configurations into my Hybris ant build scripts.
> The
> issue i face is, the junit that runs on the instrumented classes fails,
> because of which i do not think the report emma generates is correct.  ant
> version is 1.8 and emma version is 2.1. The junit jar i use is of
> version4.9
>
> 'Class not found exception' is what junits throws when they run on the
> instrumented class files . Any help much appreciated.
>
> Thanks,
> Lis Thomas
>