Package net.officefloor.test
Class OfficeFloorExtension
- java.lang.Object
-
- net.officefloor.test.OfficeFloorExtension
-
- All Implemented Interfaces:
OfficeFloorJUnit
,org.junit.jupiter.api.extension.AfterAllCallback
,org.junit.jupiter.api.extension.AfterEachCallback
,org.junit.jupiter.api.extension.BeforeAllCallback
,org.junit.jupiter.api.extension.BeforeEachCallback
,org.junit.jupiter.api.extension.Extension
,org.junit.jupiter.api.extension.ParameterResolver
public class OfficeFloorExtension extends java.lang.Object implements OfficeFloorJUnit, org.junit.jupiter.api.extension.ParameterResolver, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.BeforeEachCallback, org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.AfterAllCallback
Extension
for runningOfficeFloor
around tests.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description OfficeFloorExtension()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterAll(org.junit.jupiter.api.extension.ExtensionContext context)
void
afterEach(org.junit.jupiter.api.extension.ExtensionContext context)
void
beforeAll(org.junit.jupiter.api.extension.ExtensionContext context)
void
beforeEach(org.junit.jupiter.api.extension.ExtensionContext context)
OfficeFloorExtension
dependencyLoadTimeout(long dependencyLoadTimeout)
Allow overriding the default timeout on loading dependencies.OfficeFloor
getOfficeFloor()
Obtains theOfficeFloor
.void
invokeProcess(java.lang.String functionName, java.lang.Object parameter)
void
invokeProcess(java.lang.String functionName, java.lang.Object parameter, long waitTime)
void
invokeProcess(java.lang.String officeName, java.lang.String functionName, java.lang.Object parameter, long waitTime)
Convenience method to invoke theProcessState
for theManagedFunction
.java.lang.Object
resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
boolean
supportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext)
-
-
-
Method Detail
-
dependencyLoadTimeout
public OfficeFloorExtension dependencyLoadTimeout(long dependencyLoadTimeout)
Allow overriding the default timeout on loading dependencies.- Parameters:
dependencyLoadTimeout
- Dependency load timeout.- Returns:
this
for builder pattern withRegisterExtension
Field
instantiation.
-
getOfficeFloor
public OfficeFloor getOfficeFloor()
Description copied from interface:OfficeFloorJUnit
Obtains theOfficeFloor
.- Specified by:
getOfficeFloor
in interfaceOfficeFloorJUnit
- Returns:
OfficeFloor
.
-
invokeProcess
public void invokeProcess(java.lang.String functionName, java.lang.Object parameter)
Description copied from interface:OfficeFloorJUnit
- Specified by:
invokeProcess
in interfaceOfficeFloorJUnit
- Parameters:
functionName
- Name of theManagedFunction
.parameter
- Parameter to theManagedFunction
.
-
invokeProcess
public void invokeProcess(java.lang.String functionName, java.lang.Object parameter, long waitTime)
Description copied from interface:OfficeFloorJUnit
- Specified by:
invokeProcess
in interfaceOfficeFloorJUnit
- Parameters:
functionName
- Name of theManagedFunction
.parameter
- Parameter to theManagedFunction
.waitTime
- Time in milliseconds to wait forProcessState
to complete.
-
invokeProcess
public void invokeProcess(java.lang.String officeName, java.lang.String functionName, java.lang.Object parameter, long waitTime)
Description copied from interface:OfficeFloorJUnit
Convenience method to invoke theProcessState
for theManagedFunction
.- Specified by:
invokeProcess
in interfaceOfficeFloorJUnit
- Parameters:
officeName
- Name of theOffice
containing theManagedFunction
.functionName
- Name of theManagedFunction
.parameter
- Parameter to theManagedFunction
.waitTime
- Time in milliseconds to wait forProcessState
to complete.
-
supportsParameter
public boolean supportsParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws org.junit.jupiter.api.extension.ParameterResolutionException
- Specified by:
supportsParameter
in interfaceorg.junit.jupiter.api.extension.ParameterResolver
- Throws:
org.junit.jupiter.api.extension.ParameterResolutionException
-
resolveParameter
public java.lang.Object resolveParameter(org.junit.jupiter.api.extension.ParameterContext parameterContext, org.junit.jupiter.api.extension.ExtensionContext extensionContext) throws org.junit.jupiter.api.extension.ParameterResolutionException
- Specified by:
resolveParameter
in interfaceorg.junit.jupiter.api.extension.ParameterResolver
- Throws:
org.junit.jupiter.api.extension.ParameterResolutionException
-
beforeAll
public void beforeAll(org.junit.jupiter.api.extension.ExtensionContext context) throws java.lang.Exception
- Specified by:
beforeAll
in interfaceorg.junit.jupiter.api.extension.BeforeAllCallback
- Throws:
java.lang.Exception
-
beforeEach
public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) throws java.lang.Exception
- Specified by:
beforeEach
in interfaceorg.junit.jupiter.api.extension.BeforeEachCallback
- Throws:
java.lang.Exception
-
afterEach
public void afterEach(org.junit.jupiter.api.extension.ExtensionContext context) throws java.lang.Exception
- Specified by:
afterEach
in interfaceorg.junit.jupiter.api.extension.AfterEachCallback
- Throws:
java.lang.Exception
-
afterAll
public void afterAll(org.junit.jupiter.api.extension.ExtensionContext context) throws java.lang.Exception
- Specified by:
afterAll
in interfaceorg.junit.jupiter.api.extension.AfterAllCallback
- Throws:
java.lang.Exception
-
-