Thanks for the info; however, though the test compiles with no issues and
creates a "HelloWorldTest.class" file in the same directory as the
"HelloWorldTest.java" file, I keep getting an error when I try to run the
test, which states that if can't find the class HelloWorldTest (though it is
there in the same directory).

Here is my "HelloWorldTest.java" file:
package helloworld;

import junit.framework.TestCase;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;

public class HelloWorldTest extends TestCase {

  public void testHelloWorld() throws Exception {

    HelloWorld hello_world = new HelloWorld();
    String result = hello_world.execute();

    assertTrue("Expected a success result!",
      ActionSupport.SUCCESS.equals(result));

    assertTrue("Expected the default message!",
      HelloWorld.MESSAGE.equals(hello_world.getMessage()));
    }
}

I just changed the package name from tutorial to helloworld for my own
purposes, and compiled the file by putting the JUnit 4 jar in the classpath,
which built fine.  I'm not sure what could be wrong with the test?

Here's the output from the command line:
JUnit version 4.3.1
Could not find class: helloworld.HelloWorldTest

Time: 0

OK (0 tests)

Any ideas?

Thanks a million.

Session A. Mwamufiya
Carnegie Mellon University
MBA | Tepper School of Business
MSE (software eng.) | School of Computer Science
T: (412) 508-5455 | [EMAIL PROTECTED]

-----Original Message-----
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Saturday, June 09, 2007 2:54 PM
To: Struts Users Mailing List
Subject: Re: running the test in the HelloWorld tutorial

On 6/9/07, Session Mwamufiya <[EMAIL PROTECTED]> wrote:

>  I currently build my java files with a .bat files that simply
> calls on javac and places the class files where I want them.

That's the info I was looking for. :)

Are you already able to compile the test?  (That will tell me you've
already downloaded JUnit and put it on the classpath, because the test
says 'import junit.framework.TestCase;')

To run the test from the command line (or batch file) take a look at
this JUnit FAQ:  http://junit.sourceforge.net/doc/faq/faq.htm#tests_1

I've never done this, but (with the appropriate things on the classpath,)
try:

   java org.junit.runner.JUnitCore tutorial.HelloWorldTest

> I would prefer to keep things as simple as this, because trying to
understand
> Maven would be adding yet another layer of complexity.

Agreed.

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to