This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 17624 - XTest unable to run JUnit test using suite()
Summary: XTest unable to run JUnit test using suite()
Status: CLOSED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: xtest (show other bugs)
Version: 3.x
Hardware: PC Windows 3.1/NT
: P1 blocker (vote)
Assignee: Martin Brehovsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-13 19:22 UTC by ssffleming
Modified: 2003-07-02 12:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ssffleming 2001-11-13 19:22:39 UTC
See Jiri S. in QA for a reproducible test case.

Test runs under netbeans JUnit module.

Does not run under XTest.
Comment 1 Martin Brehovsky 2001-11-14 16:04:13 UTC
There is a problem in the reporting part of XTest as well in our
custom junit ant task. I'll try to fix it.

On the other hand, it is HIGHLY recommended, that if possible, all
JUnit based testcases run under XTest should inherit from
org.netbeans.junit.NbTestCase class. This class adds many new features
to standard JUnit, like possibility to compare files, use working
directory, write golden file testcases, etc ...

Comment 2 ssffleming 2001-11-14 16:45:26 UTC
Thanks Martin,

Sounds good.  I talked to Martin Balin yesterday and what I
think is that we want to do what you suggest which is to tightly
integrate with XTest rather than just JUnit APIs.  Separate from
that it would seem helpful if XTest could run JUnit tests developed
by 3rd parties.  I'll let you folks consider whether you think
this should be a requirement or not.  From what you wrote it sounds
like it can be achieved.
Comment 3 Martin Brehovsky 2001-11-14 16:57:36 UTC
XTest should be able to run JUnit tests developed by others, but since
there was recently a lot of changes in the way how NetBeans extension
to JUnit was implemented, we made a bug in out junit ant task, so it
was not able to run standard JUnit tests properly. I was looking at
the code today and the fix should be integrated tomorrow.

Anyway, for your purposes it should be more convenient to integrate
more closely to XTest than to plain JUnit. Please note, that NetBeans
extension to JUnit is not a part of XTest code, but JUnit module code.
For details, see junit.netbeans.org.
Comment 4 Martin Brehovsky 2001-11-15 17:30:15 UTC
XTest framework was fixed, so it is now able to run your test. The
only thing you have to do is either:
Add suite() method to the test class e.g.:

public static Test suite() {
  TestSuite suite = new TestSuite();
  suite.addTest(new MyTestExample());
  return suite;
}

or add method beginning with test work, which runs the run() method to 
the TestHarness class, e.g.:

public void testMyStuff() {
  run();
}
Jiri S. will surely give you more details about both possible solutions.
Comment 5 Quality Engineering 2003-07-02 12:20:39 UTC
Resolved for 3.3.x or earlier, no new info since then -> verify.
Comment 6 Quality Engineering 2003-07-02 12:22:24 UTC
Resolved for 3.3.x or earlier, no new info since then -> closing.