This document lists changes made to the NetBeans JUnit Extensions API.
Fuller descriptions of all changes can be found below (follow links).
Not all deprecations are listed here, assuming that the deprecated APIs continue to essentially work. For a full deprecation list, please consult the Javadoc.
NbTestCase.logRoot
to collect messages from just some code
@RandomlyFails
MockServices
MockServices
These API specification versions may be used to indicate that a module requires a certain API feature in order to function. For example, if you see here a feature you need which is labelled 1.20, your manifest should contain in its main attributes the line:
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.nbjunit > 1.20
NbTestCase.logRoot
to collect messages from just some code
@RandomlyFails
MockServices
MockServices
org.netbeans.junit.Log
org.netbeans.junit.MockServices
MockServices
MockServices
org.netbeans.junit.NbModuleSuite
org.netbeans.junit.NbTestCase
NbTestCase.logRoot
to collect messages from just some code
org.netbeans.junit.RandomlyFails
@RandomlyFails
NbModuleSuite
; made by: sdedic
NbModuleSuite loads org.hamcrest
from the same
classloader as org.junit
classes to prevent LinkageErrors.
NbTestCase
; made by: hectorespert
Add support for JUnit @Ignore annotation on NbTestCase test case extension.
NbModuleSuite
; made by: jlahoda
Adding a way to set parent classloader on which the NB platform should start.
NbModuleSuite
; made by: jtulach; issues:
#197066
System.getProperty("branding.token") recognized and influences branding used during the test.
NbModuleSuite
; made by: jtulach; issues:
#185291
Now there is a way to disable not explicitly enabled modules.
NbModuleSuite
; made by: jglick; issues:
#197720
You may now call suite()
directly on a Configuration
object.
NbTestCase.logRoot
to collect messages from just some code
NbTestCase
; made by: jglick; issues:
#197572
Overridable method to avoid excessive logging of uninteresting components.
NbModuleSuite
; made by: tomwheeler; issues:
#197065
NbModuleSuite.Configuration now has a
addStartupArgument
method which allows one to append one or more command line
arguments which will be used to start the application.
Arguments which must be passed directly to the JVM should
still be specified in the test.run.args
property.
NbModuleSuite
; made by: jtulach; issues:
#155444
Do you need to fail the test when some wrong message or exception is logged? Easy now with Configuration.failOnMessage(Level.WARNING) and Configuration.failOnException(Level.INFO).
NbModuleSuite
; made by: jtulach
One can decide to not enable autoload modules by calling Configuration.honorAutoEager(true).
NbModuleSuite
; made by: jtulach
One can decide to not include modules on classpath in the test by calling Configuration.enableClasspathModules(false).
NbModuleSuite
; made by: jtulach; issues:
#153624
It is now possible to easily enable modules in one cluster due to Configuration.enableModules method.
NbModuleSuite
; made by: jtulach; issues:
#153624
Semantics of Configuration.clusters method has been extended. It can now be called multiple times to accumulate the results.
NbModuleSuite
; made by: mrkam
Enhanced version of assertInstances(String msg, String... types) added.
@RandomlyFails
RandomlyFails
; made by: jglick; issues:
#137069
New annotation added to easily mark tests which occasionally fail for no particular reason.
NbModuleSuite
; made by: mrkam
NbModuleSuite.Configuration now has reuseUserDir(boolean) method which enables test suite to reuse userdir from previous suite run.
NbModuleSuite
; made by: jsedek
NbModuleSuite.Configuration now has addTest(java.lang.Class) method which allows to add Test implementation classes into configuration and execution of the NbModuleSuite.
NbModuleSuite
; made by: jtulach
NbModuleSuite now has emptyConfiguration() method which returns empty, ready to be configured configuration.
NbModuleSuite
; made by: jtulach
NbModuleSuite.Configuration now has addTest(clazz, tests) method which allows to add multiple test classes into single configuration and execution of the NbModuleSuite.
NbModuleSuite
; made by: jtulach
Shura requested few new methods to simplify creation of
NbModuleSuite
's. Added, allModules
and
another variant of create
to complement the general
customization with NbModuleSuite.Configuration
.
NbModuleSuite
; made by: jtulach
It always used to be hard to setup the right environment for test
execution. In case this NetBeans this is even harder. The module
system is ready to work without classpath isolation, however
not every feature is available and not every
behavior remains the same
That is why there is now the new NbModuleSuite
support class that allows to really start the whole NetBeans
Runtime Container, satisfy all the dependencies and only then
load the testing class and execute it.
Log
; made by: jtulach
Methods enableInstances
and
assertInstances
added to Log
class to
simplify writing memory leaks tests integrated with
timers/counters infastructure.
NbTestCase
; made by: rmatous
Not persistent implementation of java.util.prefs.Preferences
is installed in place of the platform-specific default implementation for running tests.
See document
Preferences in NetBeans
to learn more.
MockServices
MockServices
; made by: jtulach
The MockServices class now supports closer cooperation
with Lookup
. By default, clients listening to
Lookup.Result
changes will be notified about
change in its content whenever one calls MockServices.setServices
.
MockServices
MockServices
; made by: jglick
Added new utility to help unit tests create mock implementations of global services for lookup.
NbTestCase
Log
; made by: jtulach; issues:
#35067
An excelent tool to emulate race condition, deadlock or any other non-deterministic behaviour created in the form of Log.controlFlow method.
NbTestCase
Log
; made by: jtulach; issues:
#35067
Added two ways how to enable logging in a test case. One can either overwrite NbTestCase.logLevel method and return the right level to capture in the test and then all the messages logged with the level and greater will be sent to NbTestCase.getLog() stream which is placed in working directory.
Or one can directly call
Log.enable
to capture all the logging into a CharSequence
which can be later queried for its content, usually by calling its.toString()
method.