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

  • Home
  • SEARCH
  • 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 8672587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:14:32+00:00 2026-06-12T19:14:32+00:00

I added some unit tests to a test directory (parallel to my src directory)

  • 0

I added some unit tests to a test directory (parallel to my src directory) in my project in Eclipse using the “JUnit test case” new file dialogue. I have two builders, the default Java Builder and an AntBuilder I added. The Java Builder continues to work, but the AntBuilder fails in Eclipse. When I select Project -> Build All, it displays this:

Buildfile: C:\source\machine-paint\eclipse\machine-paint\src\build.xml

clean:
      [delete] Deleting directory C:\source\machine-paint\eclipse\machine-paint\build

compile:
       [mkdir] Created dir: C:\source\machine-paint\eclipse\machine-paint\build\classes
       [javac] Compiling 33 source files to C:\source\machine-paint\eclipse\machine-paint\build\classes
       [javac] C:\source\machine-paint\eclipse\machine-paint\test\stencil\BorderWalkerTest.java:3: error: package org.junit does not exist
       [javac] import static org.junit.Assert.*;
       [javac]                        ^

and then after a few similar errors, this:

 [javac] C:\source\machine-paint\eclipse\machine-paint\test\stencil\BorderWalkerTest.java:8: error: incompatible types
       [javac]  @Test
       [javac]   ^
       [javac]   required: Annotation
       [javac]   found:    Test

Here’s my build file. At this point I’m really firing in the dark, such as adding that classpath tag to the javac command.

<?xml version="1.0" encoding="UTF-8"?>
<project name="Builder" default="jar" basedir=".">
  <target name="clean">
    <delete dir="build"/>
  </target>

  <target name="compile" depends="clean">
    <mkdir dir="build/classes" />
    <javac srcdir="." destdir="build/classes" debug="true" includeantruntime="true">
      <classpath>
        <path id="org.junit" location="c:/eclipse/plugins/org.apache.ant_1.8.3.v20120321-1730/lib/junit.jar" />
      </classpath>
    </javac>
  </target>

  <target name="jar" depends="compile">
    <jar destfile="../../stencil.jar" basedir="build/classes">
      <manifest>
        <attribute name="Main-Class" value="stencil.Main" />
      </manifest>
    </jar>
    <copy file="../../stencil.jar" tofile="../../../robotsdoart/stencils/stencil.jar" />
  </target>

  <target name="run">
    <java jar="build/jar/stencil.jar" fork="true" />
  </target>
</project>
  • 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-06-12T19:14:33+00:00Added an answer on June 12, 2026 at 7:14 pm

    Try changing the srcdir to your actual source dir so it doesn’t include the tests.

    Something like:

    <javac srcdir="src/" destdir="build/classes" debug="true" includeantruntime="true">
      <classpath>
        <path id="org.junit" location="c:/eclipse/plugins/org.apache.ant_1.8.3.v20120321-1730/lib/junit.jar" /> <!-- not sure if you need this -->
      </classpath>
    </javac>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have added some animation using jquery but it's not working: $('.test-container').click(function(){ $(this).css('background-color', 'rgb(119,
Our team is willing to unit-test a new code written under a running project
I created a new Visual Studio 2010 Test Project. <solution> <test-project> Resources test-data.csv tests.cs
I had to start writing some unit tests, using QualityTools.UnitTestFramework, for a web service
I am writing unit tests in visual studio 2010. For test some functionality, I
my unit test works, but after I added some code to get values from
I am trying to set up some unit tests for an existing c++ project.
I've got a Rails 3.2.8 project with both legacy test/unit (minitest) tests and RSpecs.
I added some columns to a table using rails and rake, but they do
I added some UI elements to the main.xml file in the res\layout folder and

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.