Class TestFramework
java.lang.Object
net.minecraftforge.eventtest.internal.TestFramework
The backend of the "curletest" event testing framework.
All tests are registered to this class, and are set up according to the needs they declare.
All bootstrap tests will be summed up into a log file when the main menu loads.
All gameplay events will be printed to the console when they fire, and written to the above log.
To register a new event test, simply create the class in the events package and add it to the list here.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean
(package private) static final org.objectweb.asm.Type
(package private) static final org.apache.logging.log4j.Logger
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
At the mark of the end of the bootstrap period, collect and log all test results.private void
Search for unfired events when the game is shutting down.Enumerate all tests that should be ran with the framework.private static org.apache.logging.log4j.core.config.LoggerConfig
getLoggerConfiguration
(@NotNull org.apache.logging.log4j.core.config.Configuration configuration, @NotNull String loggerName) private void
Set the LOGGER instance in this class to only write to logs/curletest.log.static void
testChangedState
(EventTest test) Gameplay events require to be able to notify the framework when their task is completed.
-
Field Details
-
MODID
- See Also:
-
tests
-
testNames
-
LOGGER
static final org.apache.logging.log4j.Logger LOGGER -
CURLETEST_ANNOTATION
static final org.objectweb.asm.Type CURLETEST_ANNOTATION -
bootstrapHandled
boolean bootstrapHandled
-
-
Constructor Details
-
TestFramework
public TestFramework()Pre-initialize the framework and all events.
-
-
Method Details
-
testChangedState
Gameplay events require to be able to notify the framework when their task is completed. Bootstrap events are ignored when updates occur. -
gatherEvents
Enumerate all tests that should be ran with the framework. All classes with the @TestHolder annotation are resolved and instantiated as tests.- Returns:
- all tests to run
-
collectBootstrapTests
At the mark of the end of the bootstrap period, collect and log all test results. the ScreenOpenEvent fired by TitleScreen is the last event fired without user interaction, so it is the end of the "automatic" bootstrap time. -
collectMissedTests
Search for unfired events when the game is shutting down. Summarise all test results. -
prepareLogger
private void prepareLogger()Set the LOGGER instance in this class to only write to logs/curletest.log. Log4J is annoying and requires manual initialization and preparation. -
getLoggerConfiguration
private static org.apache.logging.log4j.core.config.LoggerConfig getLoggerConfiguration(@NotNull @NotNull org.apache.logging.log4j.core.config.Configuration configuration, @NotNull @NotNull String loggerName)
-