Anonymous - 2003-10-23

In MVC-step-by-step STEP 4

I found that unit test failed in the first part.

junit:
    [junit] Running tests.TestProductManagerDaoJdbc
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
    [junit] Testsuite: tests.TestProductManagerDaoJdbc
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec

    [junit] Null Test:  Caused an ERROR
    [junit] tests.TestProductManagerDaoJdbc
    [junit] java.lang.ClassNotFoundException: tests.TestProductManagerDaoJdbc
    [junit]     at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
    [junit]     at java.security.AccessController.doPrivileged(Native Method)
    [junit]     at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    [junit]     at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    [junit]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)

    [junit]     at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    [junit]     at java.lang.ClassLoader.loadClass(ClassLoader.java:235)

    [junit] TEST tests.TestProductManagerDaoJdbc FAILED

BUILD FAILED

After I changed  the junit target’s classpath in the build.xml

   <classpath refid="master-classpath"/>
to
  
         <classpath>
                <path location="${build.dir}"/> 
                <fileset dir="${web.dir}/WEB-INF/lib">
                    <include name="*.jar"/>
                </fileset>
                <fileset dir="${tomcat.home}/common/lib">
                    <include name="servlet.jar"/>
                </fileset>
            </classpath>

It passed test.