facebook

How to Run a JUnit test within a Web Project

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #228399 Reply

    Annie Xie
    Member

    I have a web project configured in MyEclipse and deployed to Weblogic server. The web project uses Spring framework. I also wrote a Spring Junit Test class to test the classes within the web project. To run this JUnitTest class, I selected “Run as JUnit” and got error message “Launching (Error: Test type does not exist)”. I have junit.jar included in my web project’s library. Why do I get this error? Do I need to create a separate Java Project and run it as a Java project? Or do I need some other stuff that’s specific for Spring?

    #228444 Reply

    Riyad Kalla
    Member

    Where does the type “Test” come from? If it comes from the junit.jar file, then just make sure it is in your java build path under the libraries tab somewhere.

    And no you don’t need to create a new project, running a JUnit test is the same thing as running a normal file anywhere in Eclipse, wether it be a Java Project, Web Project, etc.

    #228468 Reply

    Annie Xie
    Member

    Actually I figured out myself. It was a silly mistake, I didn’t add the test source directory into my web project’s build path

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: How to Run a JUnit test within a Web Project

You must be logged in to post in the forum log in