Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I extend JUnit?

EXTEND JUnit
0
Posted

How do I extend JUnit?

1

JUnit is a testing framework intended to be customized for specialized use. Browsing the JUnit source code is an excellent way to learn its design and discover how it can be extended. Examples of JUnit extensions can be found in the junit.extensions package: * TestDecorator A decorator for Tests. You can use it as the base class for implementing new test decorators that add behavior before or after a test is run. * ActiveTestSuite A TestSuite that runs each test in a separate thread and waits until all threads have terminated. * TestSetup A TestDecorator to initialize and cleanup test fixture state once before the test is run. * RepeatedTest A TestDecorator that runs a test repeatedly. * ExceptionTestCase A TestCase that expects a particular Exception to be thrown. Kent Beck has mentioned that ExceptionTestCase likely does not provide enough to be useful; it is just as easy to write the “exception test” yourself. Refer to the Writing Tests section for guidance.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.