-
Notifications
You must be signed in to change notification settings - Fork 44
JUnit test extensions
- IBeforeTest
- Before Test extension point schema definition
- IAfterTest
- After Test extension point schema definition
- CloseWelcomeScreenExt - Before Test Extension
- DoNotDownloadMavenIndexesExt - Before Test Extension
- SetOpenAssociatedPerspectiveExt - Before Test Extension
- CloseAllShellsExt - After Test Extension
JUnit test extensions are actions automatically invoked before or after each and every test is run. They should replace using JUnit annotations @AfterClass, @After and @BeforeClass, @Before for actions invoked for every test so there is no need to copy these action to every test source code.
JUnit extensions are implemented via IBeforeTest and IAfterTest extension points defined within org.jboss.reddeer.junit plugin.
IBeforeTest has 2 methods - runBeforeTestClass is similar to @BeforeClass (is invoked only once per test class, before requirements are fullfilled) and runBeforeTest is similar to @Before (invoked before every test method). Also, IAfterTest has 2 methods - runAfterTestClass (runs after requirements cleanup) and runAfterTest (runs after every test).
These extension points are implemented within org.jboss.reddeer.junit.extension plugin which is installed by org.jboss.reddeer.junit.extension.feature feature. This feature is mandatory and has to be installed in order to be able to use JUnit extensions defined in RedDeer.
Each JUnit Extension can be disabled via setting respective system property
Closes Welcome Screen if opened prior test is run. Can be disabled via setting this system property to false
reddeer.close.welcome.screen=false
Disables downloading maven repository indexes at Eclipse startup prior test is run. Can be disabled via setting this system property to false
reddeer.disable.maven.download.repo.index.on.startup=false
Sets Open Associated Perspective behavior. By default it disables opening of associated perspective when project is created. Requested behavior can be accomplished by setting this system property to appropriate value
reddeer.set.open.associated.perspective=[prompt|always|never]
Closes all opened shells except workbench shell when test is finished. If such a shell is closed finished test will fail but next test will run with only workbench shell opened. It's supposed that when test is finished no additional shells should be opened. Can be disabled via setting this system property to false
reddeer.close.shells=false