Class ControllerTest
java.lang.Object
org.tentackle.app.AbstractApplication
org.tentackle.pdo.junit.TestApplication
org.tentackle.fx.rdc.junit.FxRdcTestApplication
org.tentackle.fx.rdc.junit.ControllerTest
- All Implemented Interfaces:
org.tentackle.app.Application, org.tentackle.pdo.DomainContextProvider, org.tentackle.session.SessionProvider
JUnit 5 test to verify that all controllers can be loaded and bound.
Opens a session in case some controllers need it.
Simply extend this class and put that in a test source folder.
Opens a session in case some controllers need it.
Simply extend this class and put that in a test source folder.
Each controller is loaded and its injections are validated. Unless the controller's
FxControllerService.binding() is NO, all its bindable members must be bound.
Controllers annotated with test = false are skipped.
Example:
public class TestControllers extends ControllerTest {}
- Author:
- harald
-
Nested Class Summary
Nested classes/interfaces inherited from class FxRdcTestApplication
FxRdcTestApplication.FxExtension -
Field Summary
Fields inherited from class org.tentackle.app.AbstractApplication
DISABLE_MODIFICATION_TRACKER, DISABLE_SECURITY_MANAGER, ENABLE_STATISTICS, LOCALE, SCRIPTING -
Constructor Summary
ConstructorsConstructorDescriptionCreates the controller test w/o package prefix.ControllerTest(String packagePrefix) Creates the controller test. -
Method Summary
Modifier and TypeMethodDescriptionvoidtestControllers(org.junit.jupiter.api.TestReporter reporter) Loads and verifies all controllers.Methods inherited from class FxRdcTestApplication
getFxTimeout, runFx, setDomainContext, setFxTimeout, startFx, unregisterMethods inherited from class TestApplication
createDatabaseTables, getUser, populateDatabase, setUpClass, startup, tearDownClassMethods inherited from class org.tentackle.app.AbstractApplication
activateStatistics, applyProperties, cleanup, configure, configureModificationTracker, configurePreferences, configureSecurityManager, createDomainContext, createSession, createSessionInfo, filterName, filterVersion, finishStartup, getCommandLine, getCreationTime, getDomainContext, getName, getProperties, getProperty, getPropertyAsChars, getPropertyAsCharsIgnoreCase, getPropertyIgnoreCase, getSession, getSessionInfo, getVersion, initialize, initializeScripting, isInteractive, isPropertySet, isServer, isSystemExitNecessaryToStop, logStackdump, logStatistics, preloadCaches, setProperties, setSessionInfo, start, stop, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.tentackle.app.Application
register, start, stopMethods inherited from interface org.tentackle.pdo.DomainContextProvider
isWithinContext, isWithinContext, on, on, op, op
-
Constructor Details
-
ControllerTest
Creates the controller test.- Parameters:
packagePrefix- optional prefix of the controller class names, null or empty if all
-
ControllerTest
public ControllerTest()Creates the controller test w/o package prefix.
-
-
Method Details
-
testControllers
@Test public void testControllers(org.junit.jupiter.api.TestReporter reporter) Loads and verifies all controllers.- Parameters:
reporter- the test reporter
-