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 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 running OfficeFloor around tests.
Author:
Daniel Sagenschneider
  • Constructor Details

    • OfficeFloorExtension

      public OfficeFloorExtension()
  • Method Details

    • dependencyLoadTimeout

      public OfficeFloorExtension dependencyLoadTimeout(long dependencyLoadTimeout)
      Allow overriding the default timeout on loading dependencies.
      Parameters:
      dependencyLoadTimeout - Dependency load timeout.
      Returns:
      this for builder pattern with RegisterExtension Field instantiation.
    • getOfficeFloor

      public OfficeFloor getOfficeFloor()
      Description copied from interface: OfficeFloorJUnit
      Obtains the OfficeFloor.
      Specified by:
      getOfficeFloor in interface OfficeFloorJUnit
      Returns:
      OfficeFloor.
    • invokeProcess

      public void invokeProcess(String functionName, Object parameter)
      Description copied from interface: OfficeFloorJUnit
      Convenience method to invoke the ProcessState for the ManagedFunction within the default Office.
      Specified by:
      invokeProcess in interface OfficeFloorJUnit
      Parameters:
      functionName - Name of the ManagedFunction.
      parameter - Parameter to the ManagedFunction.
    • invokeProcess

      public void invokeProcess(String functionName, Object parameter, long waitTime)
      Description copied from interface: OfficeFloorJUnit
      Convenience method to invoke the ProcessState for the ManagedFunction within the default Office.
      Specified by:
      invokeProcess in interface OfficeFloorJUnit
      Parameters:
      functionName - Name of the ManagedFunction.
      parameter - Parameter to the ManagedFunction.
      waitTime - Time in milliseconds to wait for ProcessState to complete.
    • invokeProcess

      public void invokeProcess(String officeName, String functionName, Object parameter, long waitTime)
      Description copied from interface: OfficeFloorJUnit
      Convenience method to invoke the ProcessState for the ManagedFunction.
      Specified by:
      invokeProcess in interface OfficeFloorJUnit
      Parameters:
      officeName - Name of the Office containing the ManagedFunction.
      functionName - Name of the ManagedFunction.
      parameter - Parameter to the ManagedFunction.
      waitTime - Time in milliseconds to wait for ProcessState 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 interface org.junit.jupiter.api.extension.ParameterResolver
      Throws:
      org.junit.jupiter.api.extension.ParameterResolutionException
    • resolveParameter

      public 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 interface org.junit.jupiter.api.extension.ParameterResolver
      Throws:
      org.junit.jupiter.api.extension.ParameterResolutionException
    • beforeAll

      public void beforeAll(org.junit.jupiter.api.extension.ExtensionContext context) throws Exception
      Specified by:
      beforeAll in interface org.junit.jupiter.api.extension.BeforeAllCallback
      Throws:
      Exception
    • beforeEach

      public void beforeEach(org.junit.jupiter.api.extension.ExtensionContext context) throws Exception
      Specified by:
      beforeEach in interface org.junit.jupiter.api.extension.BeforeEachCallback
      Throws:
      Exception
    • afterEach

      public void afterEach(org.junit.jupiter.api.extension.ExtensionContext context) throws Exception
      Specified by:
      afterEach in interface org.junit.jupiter.api.extension.AfterEachCallback
      Throws:
      Exception
    • afterAll

      public void afterAll(org.junit.jupiter.api.extension.ExtensionContext context) throws Exception
      Specified by:
      afterAll in interface org.junit.jupiter.api.extension.AfterAllCallback
      Throws:
      Exception