Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5842763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:03:39+00:00 2026-05-22T12:03:39+00:00

I’ve been trying in vain to get ant to execute some tests written in

  • 0

I’ve been trying in vain to get ant to execute some tests written in junit. Any advice would be much appreciated. I’m pretty new to both ant and Java so please be patient.

As a quick summary, what i’m doing is trying to get ant to execute a very simple test, the classpath looks ok considering the output from ant -debug. I’m getting a null test error for a test who’s class file is explicitly mentioned in the classpath. Also, i’m getting a ZipException, i dont know what that’s about.

Here’s a testcase i’m trying to run:

package testmanagment;
import junit.framework.*;

public abstract class EasyTest extends TestCase
{

    public EasyTest(String name)
    {
        super(name);
    }

    protected void setUp()
    {}

    protected void testSeeMee() throws Exception
    {
        assertTrue(true);
    }

    protected void testSeeMeetoo() throws Exception
    {
        assertTrue(true);
    }   
}

There are a few tests in the package, this one was just to see why everything was failing. it fails with ZipException.

and here’s a little bit of my make file:

  <property name="src" value="src/"/> 
     <property name="build" value="build/"/>  
     <property name="test" value="${build}test/"/>
     <property name="testreportsdir" value="${test}reports/"/>
     <property name="classdir" value="${build}classes/"/>
     <property name="lib" value="lib/"/> 

    <path id="files-classpath">  
        <fileset dir="lib/" >  
            <include name="*.jar"/>  
        </fileset>  
    </path> 

    <path id="tests-classpath">
        <path refid="files-classpath"/>
        <pathelement location="${classdir}/"/>
    </path>

    <path id="tests-runpath">
        <path refid="tests-classpath"/>
        <fileset dir="${test}/">
            <include name="*.class"/>
            <include name="**/*.class"/>
            <include name="testmanagment/*.class"/>
            <include name="*.*"/>
            <include name="**/*.*"/>
            <include name="testmanagment/*.*"/>
        </fileset>
        </path>

blah blah blah

    <target name="test" depends="compile_tests">
        <junit haltonfailure="true"  printsummary="false">
            <classpath refid="tests-runpath"/>
            <formatter type="brief" usefile="false"/>
            <test name="testmanagment.EasyTest"/>
            <test name="testmanagment.TestUser"/>
            <test name="testmanagment.TestTest"/>
                </junit>
    </target>

ant compiles everything fine, and looks to put everything in the right places. but it cant seem to find my tests… here’s a little piece of what ant spat out when i ran it with the -debug option.

 [junit] Using CLASSPATH /host/Users/Sheena/Desktop/School/Software dev/lab_project/lib/junit-4.8.1.jar:/host/Users/Sheena/Desktop/School/Software dev/lab_project/lib/sqlitejdbc-v056.jar:/host/Users/Sheena/Desktop/School/Software dev/lab_project/build/classes:/host/Users/Sheena/Desktop/School/Software dev/lab_project/build/test/testmanagment/EasyTest.class:/host/Users/Sheena/Desktop/School/Software dev/lab_project/build/test/testmanagment/TestTest.class:/host/Users/Sheena/Desktop/School/Software dev/lab_project/build/test/testmanagment/TestUser.class:/usr/share/ant/lib/junit.jar:/usr/share/java/ant-launcher-1.7.1.jar:/usr/share/ant/lib/ant.jar:/usr/share/ant/lib/ant-junit.jar
Class org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter loaded from parent loader (parentFirst)
Finding class testmanagment.EasyTest
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource testmanagment/EasyTest.class from /host/Users/Sheena/Desktop/School/Software dev/lab_project/build/test/testmanagment/EasyTest.class
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource testmanagment/EasyTest.class from /host/Users/Sheena/Desktop/School/Software dev/lab_project/build/test/testmanagment/TestTest.class
Ignoring Exception java.util.zip.ZipException: error in opening zip file reading resource testmanagment/EasyTest.class from /host/Users/Sheena/Desktop/School/Software dev/lab_project/build/test/testmanagment/TestUser.class
    [junit] Testsuite: testmanagment.EasyTest
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
    [junit] 
    [junit] Null Test:  Caused an ERROR

sorry about the ugly output there, it’s all i have to work with for now.

it looks very much like the testcases are in the classpath, so i dont know what’s happening… Maybe it’s something to do with the ZipException but i dont know…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:03:39+00:00Added an answer on May 22, 2026 at 12:03 pm

    You added EasyTest.class as a JAR file to the classpath. This doesn’t work. Class files aren’t JAR archives, so the classloader throws an error when it tries to load classes from it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.