FAQ

[Ant-user] Junit4 ant 1.6.2

Kirtane, Shobhana Vijay
Sep 27, 2007 at 10:36 pm
Hi all,

When I include junit.jar(junit4.4) in classpath in this way : EXPORT
CLASSPATH = /....:junit.jar , my test cases work fine.No problem here

When I set the junit.jar in classpath in build.xml it fails out
Could not create task or type of type: classpath.
Ant could not find the task or a class this task relies upon

The output from ant -diagnostics :

ant -diagnostics
------- Ant diagnostics report -------
Apache Ant version 1.6.2 compiled on August 5 2004

-------------------------------------------
Implementation Version (JDK1.2+ only)
-------------------------------------------
core tasks : null
optional tasks : 1.6.2
---
-------------------------------------------
ANT_HOME/lib jar listing
-------------------------------------------
......
junit.jar (164046 bytes)
ant-junit.jar (92792 bytes)

-------------------------------------------
Tasks availability
-------------------------------------------
jdepend : Missing dependency jdepend.xmlui.JDepend
junit : Missing dependency junit.framework.Test

java.runtime.version : 1.5.0_10-b03

ant.home: /local/weblogic922/weblogic92/server (Using the ant which
comes with weblogic 9.2.2)


Any suggestions to overcome this issue ?

Thanks
Shobhana
reply

Search Discussions

4 responses

  • Anderson, Rob (Global Trade) at Sep 28, 2007 at 12:08 am
    Please post the related portion of your build.xml.

    -Rob A
    -----Original Message-----
    From: Kirtane, Shobhana Vijay
    Sent: Thursday, September 27, 2007 3:36 PM
    To: user@ant.apache.org
    Subject: Junit4 ant 1.6.2

    Hi all,

    When I include junit.jar(junit4.4) in classpath in this way
    : EXPORT CLASSPATH = /....:junit.jar , my test cases work
    fine.No problem here

    When I set the junit.jar in classpath in build.xml it fails
    out Could not create task or type of type: classpath.
    Ant could not find the task or a class this task relies upon

    The output from ant -diagnostics :

    ant -diagnostics
    ------- Ant diagnostics report -------
    Apache Ant version 1.6.2 compiled on August 5 2004

    -------------------------------------------
    Implementation Version (JDK1.2+ only)
    -------------------------------------------
    core tasks : null
    optional tasks : 1.6.2
    ---
    -------------------------------------------
    ANT_HOME/lib jar listing
    -------------------------------------------
    ......
    junit.jar (164046 bytes)
    ant-junit.jar (92792 bytes)

    -------------------------------------------
    Tasks availability
    -------------------------------------------
    jdepend : Missing dependency jdepend.xmlui.JDepend junit :
    Missing dependency junit.framework.Test

    java.runtime.version : 1.5.0_10-b03

    ant.home: /local/weblogic922/weblogic92/server (Using the ant
    which comes with weblogic 9.2.2)


    Any suggestions to overcome this issue ?

    Thanks
    Shobhana






    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
    For additional commands, e-mail: user-help@ant.apache.org
  • Kirtane, Shobhana Vijay at Sep 28, 2007 at 12:12 am
    Here is the snippet from build.xml

    <path id="tests_run.path">
    <pathelement
    location="${build.home}/dbms_testcases/dbm_junit.jar"/>
    <pathelement location="${jdbms.home}/jar/junit.jar"/>
    ....
    </path>

    <target name="run-test"
    depends="prepare-run-test,compile-tests,ensure-test-name">
    <echo message="Running TestCase ${test}. Report will be generated
    at build/dbms_testcases/testReport/index.html"/>
    <classpath refid="${tests_run.path}"/>
    <echo level="info" message="Classpath = ${CLASSPATH}"/>
    <junit haltonfailure="no" fork="yes" printsummary="withOutAndErr">

    ....
    </junit>

    This same thing worked when I had junit 3.8.1

    Thanks for your response
    Shobhana


    -----Original Message-----
    From: Anderson, Rob (Global Trade)
    Sent: Thursday, September 27, 2007 5:08 PM
    To: Ant Users List
    Subject: RE: Junit4 ant 1.6.2

    Please post the related portion of your build.xml.

    -Rob A
    -----Original Message-----
    From: Kirtane, Shobhana Vijay
    Sent: Thursday, September 27, 2007 3:36 PM
    To: user@ant.apache.org
    Subject: Junit4 ant 1.6.2

    Hi all,

    When I include junit.jar(junit4.4) in classpath in this way
    : EXPORT CLASSPATH = /....:junit.jar , my test cases work fine.No
    problem here

    When I set the junit.jar in classpath in build.xml it fails out Could
    not create task or type of type: classpath.
    Ant could not find the task or a class this task relies upon

    The output from ant -diagnostics :

    ant -diagnostics
    ------- Ant diagnostics report ------- Apache Ant version 1.6.2
    compiled on August 5 2004

    -------------------------------------------
    Implementation Version (JDK1.2+ only)
    -------------------------------------------
    core tasks : null
    optional tasks : 1.6.2
    ---
    -------------------------------------------
    ANT_HOME/lib jar listing
    -------------------------------------------
    ......
    junit.jar (164046 bytes)
    ant-junit.jar (92792 bytes)

    -------------------------------------------
    Tasks availability
    -------------------------------------------
    jdepend : Missing dependency jdepend.xmlui.JDepend junit :
    Missing dependency junit.framework.Test

    java.runtime.version : 1.5.0_10-b03

    ant.home: /local/weblogic922/weblogic92/server (Using the ant which
    comes with weblogic 9.2.2)


    Any suggestions to overcome this issue ?

    Thanks
    Shobhana






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


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
    For additional commands, e-mail: user-help@ant.apache.org
  • Jan Materne at Sep 28, 2007 at 6:19 am
    JUnit4.x is a very new version while Ant 1.6.2 is a very old one.
    You should update to Ant 1.7.0 which has JUnit4 support.

    JUnit's APIs changed a little bit ...


    Jan

    -----Ursprüngliche Nachricht-----
    Von: Kirtane, Shobhana Vijay
    Gesendet: Freitag, 28. September 2007 02:11
    An: Ant Users List
    Betreff: RE: Junit4 ant 1.6.2

    Here is the snippet from build.xml

    <path id="tests_run.path">
    <pathelement
    location="${build.home}/dbms_testcases/dbm_junit.jar"/>
    <pathelement location="${jdbms.home}/jar/junit.jar"/>
    ....
    </path>

    <target name="run-test"
    depends="prepare-run-test,compile-tests,ensure-test-name">
    <echo message="Running TestCase ${test}. Report will be generated
    at build/dbms_testcases/testReport/index.html"/>
    <classpath refid="${tests_run.path}"/>
    <echo level="info" message="Classpath = ${CLASSPATH}"/>
    <junit haltonfailure="no" fork="yes"
    printsummary="withOutAndErr">

    ....
    </junit>

    This same thing worked when I had junit 3.8.1

    Thanks for your response
    Shobhana


    -----Original Message-----
    From: Anderson, Rob (Global Trade)
    Sent: Thursday, September 27, 2007 5:08 PM
    To: Ant Users List
    Subject: RE: Junit4 ant 1.6.2

    Please post the related portion of your build.xml.

    -Rob A
    -----Original Message-----
    From: Kirtane, Shobhana Vijay
    Sent: Thursday, September 27, 2007 3:36 PM
    To: user@ant.apache.org
    Subject: Junit4 ant 1.6.2

    Hi all,

    When I include junit.jar(junit4.4) in classpath in this way
    : EXPORT CLASSPATH = /....:junit.jar , my test cases work fine.No
    problem here

    When I set the junit.jar in classpath in build.xml it fails out Could
    not create task or type of type: classpath.
    Ant could not find the task or a class this task relies upon

    The output from ant -diagnostics :

    ant -diagnostics
    ------- Ant diagnostics report ------- Apache Ant version 1.6.2
    compiled on August 5 2004

    -------------------------------------------
    Implementation Version (JDK1.2+ only)
    -------------------------------------------
    core tasks : null
    optional tasks : 1.6.2
    ---
    -------------------------------------------
    ANT_HOME/lib jar listing
    -------------------------------------------
    ......
    junit.jar (164046 bytes)
    ant-junit.jar (92792 bytes)

    -------------------------------------------
    Tasks availability
    -------------------------------------------
    jdepend : Missing dependency jdepend.xmlui.JDepend junit :
    Missing dependency junit.framework.Test

    java.runtime.version : 1.5.0_10-b03

    ant.home: /local/weblogic922/weblogic92/server (Using the ant which
    comes with weblogic 9.2.2)


    Any suggestions to overcome this issue ?

    Thanks
    Shobhana






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


    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
    For additional commands, e-mail: user-help@ant.apache.org
    ---------------------------------------------------------------------
    To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
    For additional commands, e-mail: user-help@ant.apache.org
  • Kirtane, Shobhana Vijay at Sep 28, 2007 at 9:35 pm
    Thank You for your reply. I am getting this after I have apache ant 1.7 and junit 4.4
    junitvmwatcher705893407.properties

    [echo] Running TestCase TestJunit4. Report will be generated at build/dbms_testcases/testReport/index.html
    [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.317 sec
    [junit] java.io.FileNotFoundException: /local/skirtane/dbms_2006_1/jdbms/junitvmwatcher705893407.properties (No such file or directory)
    [junit] at java.io.FileInputStream.open(Native Method)
    [junit] at java.io.FileInputStream.<init>(FileInputStream.java:106)

    I have junit 4.4 and ant 1.7

    Any suggestions ?

    Thanks
    Shobhana

    -----Original Message-----
    From: Jan.Materne@rzf.fin-nrw.de
    Sent: Thursday, September 27, 2007 11:19 PM
    To: user@ant.apache.org
    Subject: AW: Junit4 ant 1.6.2

    JUnit4.x is a very new version while Ant 1.6.2 is a very old one.
    You should update to Ant 1.7.0 which has JUnit4 support.

    JUnit's APIs changed a little bit ...


    Jan

    -----Ursprüngliche Nachricht-----
    Von: Kirtane, Shobhana Vijay
    Gesendet: Freitag, 28. September 2007 02:11
    An: Ant Users List
    Betreff: RE: Junit4 ant 1.6.2

    Here is the snippet from build.xml

    <path id="tests_run.path">
    <pathelement
    location="${build.home}/dbms_testcases/dbm_junit.jar"/>
    <pathelement location="${jdbms.home}/jar/junit.jar"/>
    ....
    </path>

    <target name="run-test"
    depends="prepare-run-test,compile-tests,ensure-test-name">
    <echo message="Running TestCase ${test}. Report will be generated
    at build/dbms_testcases/testReport/index.html"/>
    <classpath refid="${tests_run.path}"/>
    <echo level="info" message="Classpath = ${CLASSPATH}"/>
    <junit haltonfailure="no" fork="yes"
    printsummary="withOutAndErr">

    ....
    </junit>

    This same thing worked when I had junit 3.8.1

    Thanks for your response
    Shobhana


    -----Original Message-----
    From: Anderson, Rob (Global Trade)
    Sent: Thursday, September 27, 2007 5:08 PM
    To: Ant Users List
    Subject: RE: Junit4 ant 1.6.2

    Please post the related portion of your build.xml.

    -Rob A
    -----Original Message-----
    From: Kirtane, Shobhana Vijay
    Sent: Thursday, September 27, 2007 3:36 PM
    To: user@ant.apache.org
    Subject: Junit4 ant 1.6.2

    Hi all,

    When I include junit.jar(junit4.4) in classpath in this way
    : EXPORT CLASSPATH = /....:junit.jar , my test cases work fine.No
    problem here

    When I set the junit.jar in classpath in build.xml it fails out Could
    not create task or type of type: classpath.
    Ant could not find the task or a class this task relies upon

    The output from ant -diagnostics :

    ant -diagnostics
    ------- Ant diagnostics report ------- Apache Ant version 1.6.2
    compiled on August 5 2004

    -------------------------------------------
    Implementation Version (JDK1.2+ only)
    -------------------------------------------
    core tasks : null
    optional tasks : 1.6.2
    ---
    -------------------------------------------
    ANT_HOME/lib jar listing
    -------------------------------------------
    ......
    junit.jar (164046 bytes)
    ant-junit.jar (92792 bytes)

    -------------------------------------------
    Tasks availability
    -------------------------------------------
    jdepend : Missing dependency jdepend.xmlui.JDepend junit :
    Missing dependency junit.framework.Test

    java.runtime.version : 1.5.0_10-b03

    ant.home: /local/weblogic922/weblogic92/server (Using the ant which
    comes with weblogic 9.2.2)


    Any suggestions to overcome this issue ?

    Thanks
    Shobhana






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


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


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

Related Discussions

Discussion Navigation
viewthread | post