title: problem running JUnit tests with Ant in Eclipse. Beginner question
body: <p>I'm learning these days how to use ant to run automated test folowing this <a href="http://www.vogella.de/articles/ApacheAnt/article.html" rel="nofollow">tutorial</a>.</p>
  
  <p>I have JUnit in the classpath of my project. All seem to work fine and I can include it in my classes:</p>
  
  <pre><code>import junit.framework.TestCase; //line20
  
  public class SimpleLattice1DTest extends TestCase{
   ...
  }
  </code></pre>
  
  <p>My build.xml is:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;project name="Ant-Test" default="compile" basedir="."&gt;
      &lt;!-- Sets variables which can later be used. --&gt;
      &lt;!-- The value of a property is accessed via ${} --&gt;
      &lt;property name="src.dir" location="." /&gt;
      &lt;property name="build.dir" location="build" /&gt;
      &lt;property name="dist.dir" location="dist" /&gt;
      &lt;property name="docs.dir" location="docs" /&gt;
      &lt;property name="test.dir" location="jlife/tests" /&gt;
      &lt;property name="test.report.dir" location="test/report" /&gt;  
  
      &lt;!-- Deletes the existing build, docs and dist directory--&gt;
      &lt;target name="clean"&gt;
          &lt;delete dir="${build.dir}" /&gt;
          &lt;delete dir="${docs.dir}" /&gt;
          &lt;delete dir="${dist.dir}" /&gt;
      &lt;/target&gt;
  
      &lt;!-- Creates the  build, docs and dist directory--&gt;
      &lt;target name="makedir"&gt;
          &lt;mkdir dir="${build.dir}" /&gt;
          &lt;mkdir dir="${docs.dir}" /&gt;
          &lt;mkdir dir="${dist.dir}" /&gt;
  
          &lt;mkdir dir="${test.report.dir}" /&gt;
  
  
      &lt;/target&gt;
  
      &lt;!-- Compiles the java code (including the usage of library for JUnit --&gt;
      &lt;target name="compile" depends="clean, makedir"&gt;
          &lt;javac srcdir="${src.dir}" destdir="${build.dir}"&gt;
          &lt;/javac&gt;
  
      &lt;/target&gt;
  
      &lt;!-- Creates Javadoc --&gt;
      &lt;target name="docs" depends="compile"&gt;
          &lt;javadoc packagenames="src" sourcepath="${src.dir}" destdir="${docs.dir}"&gt;
              &lt;!-- Define which files / directory should get included, we include all --&gt;
              &lt;fileset dir="${src.dir}"&gt;
                  &lt;include name="**" /&gt;
              &lt;/fileset&gt;
          &lt;/javadoc&gt;
      &lt;/target&gt;
  
      &lt;!--Creates the deployable jar file  --&gt;
      &lt;target name="jar" depends="compile"&gt;
          &lt;jar destfile="${dist.dir}\CoreTest.jar" basedir="${build.dir}"&gt;
              &lt;manifest&gt;
                  &lt;attribute name="Main-Test" value="test.CoreTest" /&gt;
              &lt;/manifest&gt;
          &lt;/jar&gt;
      &lt;/target&gt;
  
  
      &lt;!-- Run the JUnit Tests --&gt;
          &lt;!-- Output is XML, could also be plain--&gt;
          &lt;target name="junit" depends="compile"&gt;
              &lt;junit printsummary="on" fork="true" haltonfailure="yes"&gt;
  
                  &lt;formatter type="xml" /&gt;
                  &lt;batchtest todir="${test.report.dir}"&gt;
                      &lt;fileset dir="${src.dir}"&gt;
                          &lt;include name="**/*Test*.java" /&gt;
                      &lt;/fileset&gt;
                  &lt;/batchtest&gt;
              &lt;/junit&gt;
          &lt;/target&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>When i run it into eclipse I get the following error:</p>
  
  <blockquote>
    <p>[javac] C:\Documents and
    Settings\noname\Documenti\JLife_git\JLife_git\JLife\src\jlife\tests\SimpleLattice1DTest.java:20:
    package junit.framework does not exist
        [javac] import junit.framework.TestCase;</p>
  </blockquote>
  
  <p>I suppose there's something wrong with it, but I have no idea. Could someone put me in the right direction?</p>