Class EventTest
java.lang.Object
net.minecraftforge.eventtest.internal.EventTest
- Direct Known Subclasses:
- EntityJoinedWorldTest
The basis of the Event regression testing framework.
 Allows each bootstrap event to be queried in turn to see whether the event passed.
 For gameplay events, a callback is set for when the respective event is fired.
 Test cases should be in a subclass of this, annotated with TestHolder.
 If the test is for an event that fires in Bootstrap, set the field in constructor.
 Register the event handler in the registerEvents method, which will be fired automatically.
 Use the pass / fail / error methods in this class to tell the Framework what the result of the test is.
- Author:
- Curle
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumEncodes information about how the test progressed.
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidHelper method - combines setting error state with detail message.protected voidHelper method - combines setting failure state with detail message.protected StringProvide extra detail about the error.A summarised view of the test result.booleanprotected voidpass()Helper method - sets the test pass flag.abstract voidRegister event handlers for this event.
- 
Field Details- 
testResult
- 
errorDetail
- 
bootstrapprotected boolean bootstrap
 
- 
- 
Constructor Details- 
EventTestpublic EventTest()
 
- 
- 
Method Details- 
getTestResultA summarised view of the test result. For passes: "PASS" For failures: "FAIL - ($errorDetail)"- Returns:
- test result
 
- 
getEnhancedDetailProvide extra detail about the error. Pass-through of errorDetail is default, but some events require something more robust.- Returns:
- information to be shown in case of a test failure
 
- 
isBootstrappublic boolean isBootstrap()- Returns:
- whether or not this event should be monitored while the game is loading to the main menu.
 
- 
registerEventspublic abstract void registerEvents()Register event handlers for this event. Trade-off between "magic annotations" and verbosity should be evaluated.
- 
failHelper method - combines setting failure state with detail message.- Parameters:
- reason- extra detail about why the failure occurred
 
- 
passprotected void pass()Helper method - sets the test pass flag.
- 
errorHelper method - combines setting error state with detail message.- Parameters:
- reason- extra detail about why the error occured.
 
 
-