Menu

Ant EMMA exception when JUNIT fork=&qu...

Anonymous
2010-01-22
2013-05-09
  • Anonymous

    Anonymous - 2010-01-22

    Hi,
    My build file.
    <target name="test" depends="">
    <junit fork="yes" haltonfailure="no" printsummary="true" showoutput="yes" haltonerror="no">
    <classpath>  
    <path  refid="test.classpath"/> 
    </classpath>
    <sysproperty key="log4j.configuration" value="${ant.home}/lib" />
    <formatter type="xml"/>  
    <!-test name="us.pa.state.uc.commonmods.financial.testsuite.FMTestSuite" haltonfailure="no" outfile="result" todir="${juint_report}"/->
    <batchtest  todir="${juint_report}">
        <fileset dir="${build}">
          <include name="**/*Test*.class"/>
          <exclude name="**/*Suite*.class"/>
          <exclude name="**/*TestCase*.class"/>
          <exclude name="**/*BusinessObjectTest*.class"/>    
        </fileset>
    </batchtest>
    <jvmarg value="-Demma.coverage.out.file=${coverage_report}/coverage.emma" /> 
    <jvmarg value="-Demma.coverage.out.merge=true"/> 
    </junit>
    </target>
    When I run my test classes using Ant Junit task with fork="false" I get following exception?

    WARNING: multiple versions of ant detected in path for junit
               jar:file:/C:/Parvez/Tools/apache-ant-1.7.1/lib/ant.jar!/org/apache/tools/ant/Project.class
           and jar:file:/C:/Program%20Files/IBM/SDP70/runtimes/base_v6/lib/ant.jar!/org/apache/tools/ant/Project.class
      EMMA: collecting runtime coverage data …
      java.net.BindException: Address already in use: NET_Bind
          at java.net.PlainSocketImpl.socketBind(Native Method)
          at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:415)
          at java.net.ServerSocket.bind(ServerSocket.java:331)
          at java.net.ServerSocket.<init>(ServerSocket.java:197)
          at java.net.ServerSocket.<init>(ServerSocket.java:109)
          at com.vladium.emma.rt.RTController.start(RTController.java:99)
          at com.vladium.emma.rt.RT.reset(RT.java:222)
          at com.vladium.emma.rt.RT.<clinit>(RT.java:540)
          at java.lang.J9VMInternals.initializeImpl(Native Method)
          at java.lang.J9VMInternals.initialize(J9VMInternals.java:194)
          at us.pa.state.uc.commonmods.financial.testsuite.FMTestSuite.$VRi(FMTestSuite.java)
          at us.pa.state.uc.commonmods.financial.testsuite.FMTestSuite.<clinit>(FMTestSuite.java)
          at java.lang.J9VMInternals.initializeImpl(Native Method)
          at java.lang.J9VMInternals.initialize(J9VMInternals.java:194)
          at java.lang.Class.forNameImpl(Native Method)
          at java.lang.Class.forName(Class.java:130)
          at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUnitTestRunner.java:237)
          at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUnitTestRunner.java:210)
          at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:532)
      Exception in thread "main" java.lang.Error: EMMA: runtime controller could not be started, aborting
          at com.vladium.emma.rt.RT.reset(RT.java:233)
          at com.vladium.emma.rt.RT.<clinit>(RT.java:540)
          at java.lang.J9VMInternals.initializeImpl(Native Method)
          at java.lang.J9VMInternals.initialize(J9VMInternals.java:194)
          at us.pa.state.uc.commonmods.financial.testsuite.FMTestSuite.$VRi(FMTestSuite.java)
          at us.pa.state.uc.commonmods.financial.testsuite.FMTestSuite.<clinit>(FMTestSuite.java)
          at java.lang.J9VMInternals.initializeImpl(Native Method)
          at java.lang.J9VMInternals.initialize(J9VMInternals.java:194)
          at java.lang.Class.forNameImpl(Native Method)
          at java.lang.Class.forName(Class.java:130)
          at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUnitTestRunner.java:237)
          at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.<init>(JUnitTestRunner.java:210)
          at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:532)
      Running us.pa.state.uc.commonmods.financial.testsuite.FMTestSuite
      Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
      Test us.pa.state.uc.commonmods.financial.testsuite.FMTestSuite FAILED (crashed)

    Thanks and regards,
    Parvez

     
  • Anonymous

    Anonymous - 2010-01-22

    Hi,
    I forgot to mention I am using spring and hibernate as component configuration and my project has 600+ test class, I don't want to load the configuration for every test class (i.e can't use fork="true").

    Thanks and regards,
    Parvez

     

Log in to post a comment.