(Answer) (Category) FAQ-O-Matic : (Category) JBuilder 6 General :
I have some JUnit test cases for an application. When I pull up the test's context menu, JBuilder doesn't offer the 'run test' or 'debug test' items. Tests I create with the New Test wizard do get these items, so why don't mine?
This is a known issue I've already reported. It's working as Borland designed, so I suspect it ended up as a low priority feature request rather than a bug.

JUnit's own test runners use reflection to decide what is a test and what is not, and they look for test*() and suite() method signatures, not the class/interface parentage. So, anything which provides a suite() method is treated as a suite(), regardless of the classes it extends or the interfaces it implements.

JBuilderTestRunner demands that a test extend TestCase or Test. (I forget which.) This same logic is used when building the context menus, so only classes which extend the correct parent are viewed as test cases.

I think this is bad design. Even JUnit's own test cases fail to meet JBuilderTestRunner's parentage assumptions, and they don't appear as Tests in the context menu, either.

So, for my own bastard test cases, I just create a main() class in each one that invokes a JUnit Test Runner. I usually use something like this:

  public static void main( String[] argv ) {
    junit.textui.TestRunner.main( new String[]{"com.aravox.cocoa.MainTest"} );
  }

This is the main class from com.aravox.cocoa.MainTest.java. It lets me just use the context menu's Run command from the context menu to run the tests via the text runner. Output goes into the message pane.

2002-Jan-05 10:37am gyles19@visi.com

[Append to This Answer]
2002-Jan-05 10:37am
Previous: (Answer) I have both JBuilder5 and JBuilder6 on my machine. MobileSet is installed and running on JB5, but I installed it for JB6, it won't activate.
Next: (Answer) JB6's CVS Checkin/Checkout isn't updating jpx files. Is this a bug, or a feature?
This document is: http://www.visi.com/~gyles19/cgi-bin/fom.cgi?file=321
[Search] [Appearance]
This is a Faq-O-Matic 2.709.
This FAQ administered by gyles19@visi.com.

Other JBuilder Links

Java Community
Java Tools
Code Central
JB OpenTools
Community
Recent
Threads
Borland Chat
Chat FAQ
Feature Matrices
3.0 |  3.5 |  4.0
5.0 |  6.0 |  7.0
Shop for
JBuilder
JBuilder
Downloads
and reg keys
Report Piracy
Online Manuals
4.0 |  5.0 |  6.0
7.0
Borland
DevSupport's
Bug/RFE Form

Quality Central Client
JB Patches &
Updates
JBuilder FAQs TIs
JBuilder
Newsgroups
Tamaracka's
News Archive
Mr. Haki's
JBuilder Machine
JGuru's
JBuilder FAQ
Sun's Bug
Parade
Netring Home - About - Privacy
The
JBuilder Netring Logo
The Borland JBuilder Netring by JBuilder FAQ-O-Matic
[ Join Now | List Sites | Random | << Prev | Next >> ]
[ Previous 5 Sites | Skip Previous | Skip Next | Next 5 Sites ]