Menu

Lesson4 Junit ClassNotFound exception

yuvald
2011-02-04
2013-04-09
  • yuvald

    yuvald - 2011-02-04

    Hello.
    First of all I loved the tutorial. Many thanks. I hit a brick wall trying to follow the 4th lesson.

    I followed the instructions and when I try and run the PersonTest as a Junit test I get the following exception:
    Class not found org.totalbeginner.tutorial?.PersonTest
    java.lang.ClassNotFoundException: org.totalbeginner.tutorial?.PersonTest
    … (Don't think that the full stack is needed here).

    I searched the web and this forum and all I could gather is that I might miss something in the classpath.
    I entered the run configuration for junit->PersonTest -> classpath(tab) user entries and added PersonTest.class jar.
    Unfortunately, it did not solve the issue.

    I'm using:
    Eclipse IDE for Java Developers
    Version: Helios Service Release 1
    Build id: 20100917-0705

    Thank you in advance
    Yuval

     
  • yuvald

    yuvald - 2011-02-05

    Managed to solve when I followed http://www.vogella.de/articles/JUnit/article.html#unittesting
    I can't tell which part I got wrong the first time though.
    Maybe missed the reference of the junit to the test directory.
    Is it a good troubleshooting step to put everything in the same folder?
    thanks.
    Yuval

     

Log in to post a comment.