On 6/9/05, Carlos Fernandez <[EMAIL PROTECTED]> wrote:
> AbstractJsfTestCase, implements a public Test suite() method.  Eclipse
> checks for this method when you tell it to run a class as a unit test.  If
> this method it exists it will use the returned Test class to determine what
> tests to run.  Since the Test returned only includes AbstractJsfTestCase -
> Eclipse chokes and throws:
> 
> junit.framework.AssertionFailedError: No tests found in
> org.apache.shale.test.base.AbstractJsfTestCase
> 

The intent wasn't that you run AbstractJsfTestCase itself as a test
case -- as it's name implies, it is an *abstract* base class.  The
convenience it brings is automatically setting up the mock environment
suitable for testing something like a ViewController implementation.

The suite() method is primarily a reminder that you need to
reimplement the method in your concrete classes.

> Granted, I can just subclass suite() in my concrete test cases . . . but I
> am lazy and would rather not do this.  Just wondering why the base test
> class implements this method, since most IDEs and ant can work just fine
> without it.
> 

I don't always use an IDE -- it's nice to have the visual clue.

> Also, why does this class not include a no-arg constructor?  Again, I am
> just lazy ;)
> 

According to the TestCase JavaDocs, you're still supposed to call
setName() if you use the TestCase no-args constructor.  It's easier to
avoid mistakes by letting the compiler catch the fact that you didn't
implement a constructor.

> BTW - the shale test classes make JSF much easier to test!  That might be an
> understatement.
> 

That is definitely the goal :-).

Craig

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

Reply via email to