Class ProcedureLoaderUtil
- java.lang.Object
-
- net.officefloor.activity.procedure.ProcedureLoaderUtil
-
public class ProcedureLoaderUtil extends java.lang.Object
Utility to test theProcedureLoader
.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ProcedureTypeBuilder
createProcedureTypeBuilder(java.lang.String procedureName, java.lang.Class<?> parameterType)
Creates theProcedureTypeBuilder
.static Procedure[]
listProcedures(java.lang.Class<?> clazz)
ListProcedure
instances for aClass
.static Procedure[]
listProcedures(java.lang.String resource)
ListProcedure
instances for a resource.static ProcedureSource
loadProcedureSource(java.lang.Class<? extends ProcedureSourceServiceFactory> serviceFactoryClass)
static ProcedureSource
loadProcedureSource(java.lang.Class<? extends ProcedureSourceServiceFactory> serviceFactoryClass, OfficeFloorCompiler compiler)
static ProcedureType
loadProcedureType(java.lang.String resource, java.lang.Class<? extends ProcedureSourceServiceFactory> serviceFactoryClass, java.lang.String procedureName, java.lang.String... propertyNameValuePairs)
Loads theProcedureType
for theProcedure
.static ProcedureType
loadProcedureType(java.lang.String resource, java.lang.Class<? extends ProcedureSourceServiceFactory> serviceFactoryClass, java.lang.String procedureName, OfficeFloorCompiler compiler, java.lang.String... propertyNameValuePairs)
Loads theProcedureType
for theProcedure
.static ProcedureType
loadProcedureType(java.lang.String resource, java.lang.String procedureName)
static ProcedureLoader
newProcedureLoader()
Creates theProcedureLoader
for currentClassLoader
.static ProcedureLoader
newProcedureLoader(OfficeFloorCompiler compiler)
Creates theProcedureLoader
for theClassLoader
.static Procedure
procedure(java.lang.String procedureName, java.lang.Class<? extends ProcedureSourceServiceFactory> serviceFactoryClass, ProcedureProperty... properties)
Convenience creation ofProcedure
for testing.static Procedure
procedure(java.lang.String procedureName, java.lang.Class<? extends ProcedureSourceServiceFactory> serviceFactoryClass, OfficeFloorCompiler compiler, ProcedureProperty... properties)
Convenience creation ofProcedure
for testing.static Procedure
procedure(java.lang.String procedureName, java.lang.String serviceName, ProcedureProperty... properties)
Convenience creation ofProcedure
for testing.static Procedure
procedure(java.lang.String procedureName, ProcedureProperty... properties)
Convenience creation of defaultProcedure
for testing.static ProcedureProperty
property(java.lang.String name)
Convenience creation ofProcedureProperty
.static ProcedureProperty
property(java.lang.String name, java.lang.String label)
Convenience creation ofProcedureProperty
.static void
validateProcedures(java.lang.Class<?> clazz, Procedure... expectedProcedures)
Validates theProcedure
instances.static void
validateProcedures(java.lang.String resource, Procedure... expectedProcedures)
Validates theProcedure
instances.static void
validateProcedures(Procedure[] actualProcedures, Procedure... expectedProcedures)
Validates the listing ofProcedure
instances.static ProcedureType
validateProcedureType(ProcedureTypeBuilder expectedProcedureType, java.lang.String resource, java.lang.Class<? extends ProcedureSourceServiceFactory> serviceFactoryClass, java.lang.String procedureName, java.lang.String... propertyNameValuePairs)
Validates theProcedureType
.static ProcedureType
validateProcedureType(ProcedureTypeBuilder expectedProcedureType, java.lang.String resource, java.lang.String procedureName, java.lang.String... propertyNameValuePairs)
Validates theProcedureType
via defaultProcedureSource
.static ProcedureType
validateProcedureType(ProcedureTypeBuilder expectedProcedureType, ProcedureType actualType)
Validates theProcedureType
.
-
-
-
Method Detail
-
listProcedures
public static Procedure[] listProcedures(java.lang.Class<?> clazz)
ListProcedure
instances for aClass
.
-
listProcedures
public static Procedure[] listProcedures(java.lang.String resource)
ListProcedure
instances for a resource.
-
procedure
public static Procedure procedure(java.lang.String procedureName, java.lang.Class<? extends ProcedureSourceServiceFactory> serviceFactoryClass, ProcedureProperty... properties)
Convenience creation ofProcedure
for testing.- Parameters:
procedureName
- Name ofProcedure
.serviceFactoryClass
-ProcedureSourceServiceFactory
.properties
-ProcedureProperty
instances.- Returns:
Procedure
.
-
procedure
public static Procedure procedure(java.lang.String procedureName, java.lang.Class<? extends ProcedureSourceServiceFactory> serviceFactoryClass, OfficeFloorCompiler compiler, ProcedureProperty... properties)
Convenience creation ofProcedure
for testing.- Parameters:
procedureName
- Name of theProcedure
.serviceFactoryClass
-Class
ofProcedureSourceServiceFactory
.compiler
-OfficeFloorCompiler
.properties
-ProcedureProperty
instances.- Returns:
Procedure
.
-
procedure
public static Procedure procedure(java.lang.String procedureName, ProcedureProperty... properties)
Convenience creation of defaultProcedure
for testing.- Parameters:
procedureName
- Name of theProcedure
.properties
-ProcedureProperty
instances.- Returns:
Procedure
.
-
procedure
public static Procedure procedure(java.lang.String procedureName, java.lang.String serviceName, ProcedureProperty... properties)
Convenience creation ofProcedure
for testing.- Parameters:
procedureName
- Name of theProcedure
.serviceName
- Service name.properties
-ProcedureProperty
instances.- Returns:
Procedure
.
-
property
public static ProcedureProperty property(java.lang.String name)
Convenience creation ofProcedureProperty
.- Parameters:
name
- Property name.- Returns:
ProcedureProperty
.
-
property
public static ProcedureProperty property(java.lang.String name, java.lang.String label)
Convenience creation ofProcedureProperty
.- Parameters:
name
- Property name.label
- Label for the property.- Returns:
ProcedureProperty
.
-
validateProcedures
public static void validateProcedures(java.lang.Class<?> clazz, Procedure... expectedProcedures)
Validates theProcedure
instances.- Parameters:
clazz
-Class
.expectedProcedures
- ExpectedProcedure
instances.- Throws:
java.lang.Exception
- If fails to validate.
-
validateProcedures
public static void validateProcedures(java.lang.String resource, Procedure... expectedProcedures)
Validates theProcedure
instances.- Parameters:
resource
- Resource.expectedProcedures
- ExpectedProcedure
instances.- Throws:
java.lang.Exception
- If fails to validate.
-
validateProcedures
public static void validateProcedures(Procedure[] actualProcedures, Procedure... expectedProcedures)
Validates the listing ofProcedure
instances.
-
loadProcedureType
public static ProcedureType loadProcedureType(java.lang.String resource, java.lang.Class<? extends ProcedureSourceServiceFactory> serviceFactoryClass, java.lang.String procedureName, java.lang.String... propertyNameValuePairs)
Loads theProcedureType
for theProcedure
.- Parameters:
resource
- Resource.serviceFactoryClass
-ProcedureSourceServiceFactory
Class
.procedureName
- Name ofProcedure
.propertyNameValuePairs
- Name/value pairs forPropertyList
.- Returns:
ProcedureType
.
-
loadProcedureType
public static ProcedureType loadProcedureType(java.lang.String resource, java.lang.Class<? extends ProcedureSourceServiceFactory> serviceFactoryClass, java.lang.String procedureName, OfficeFloorCompiler compiler, java.lang.String... propertyNameValuePairs)
Loads theProcedureType
for theProcedure
.- Parameters:
resource
- Resource.serviceFactoryClass
-ProcedureSourceServiceFactory
Class
.procedureName
- Name ofProcedure
.compiler
-OfficeFloorCompiler
.propertyNameValuePairs
- Name/value pairs forPropertyList
.- Returns:
ProcedureType
.
-
loadProcedureType
public static ProcedureType loadProcedureType(java.lang.String resource, java.lang.String procedureName)
- Parameters:
resource
- Resource.procedureName
- Name ofProcedure
.- Returns:
ProcedureType
.
-
createProcedureTypeBuilder
public static ProcedureTypeBuilder createProcedureTypeBuilder(java.lang.String procedureName, java.lang.Class<?> parameterType)
Creates theProcedureTypeBuilder
.- Parameters:
procedureName
- Name of theProcedureType
.parameterType
-Parameter
type for theProcedureType
. May benull
if noParameter
.- Returns:
ProcedureTypeBuilder
.
-
validateProcedureType
public static ProcedureType validateProcedureType(ProcedureTypeBuilder expectedProcedureType, java.lang.String resource, java.lang.Class<? extends ProcedureSourceServiceFactory> serviceFactoryClass, java.lang.String procedureName, java.lang.String... propertyNameValuePairs)
Validates theProcedureType
.- Parameters:
expectedProcedureType
- ExpectedProcedureType
viaProcedureTypeBuilder
.resource
- Resource.serviceFactoryClass
-ProcedureSourceServiceFactory
Class
.procedureName
- Name ofProcedure
.propertyNameValuePairs
- Name/value pairs forPropertyList
.- Returns:
ProcedureType
.
-
validateProcedureType
public static ProcedureType validateProcedureType(ProcedureTypeBuilder expectedProcedureType, java.lang.String resource, java.lang.String procedureName, java.lang.String... propertyNameValuePairs)
Validates theProcedureType
via defaultProcedureSource
.- Parameters:
expectedProcedureType
- ExpectedProcedureType
viaProcedureTypeBuilder
.resource
- Resource.procedureName
- Name ofProcedure
.propertyNameValuePairs
- Name/value pairs forPropertyList
.- Returns:
ProcedureType
.
-
validateProcedureType
public static ProcedureType validateProcedureType(ProcedureTypeBuilder expectedProcedureType, ProcedureType actualType)
Validates theProcedureType
.- Parameters:
expectedProcedureType
- ExpectedProcedureType
viaProcedureTypeBuilder
.actualType
- ActualProcedureType
.- Returns:
ProcedureType
.
-
newProcedureLoader
public static ProcedureLoader newProcedureLoader()
Creates theProcedureLoader
for currentClassLoader
.- Returns:
ProcedureLoader
.
-
newProcedureLoader
public static ProcedureLoader newProcedureLoader(OfficeFloorCompiler compiler)
Creates theProcedureLoader
for theClassLoader
.- Parameters:
compiler
-OfficeFloorCompiler
.- Returns:
ProcedureLoader
.
-
loadProcedureSource
public static ProcedureSource loadProcedureSource(java.lang.Class<? extends ProcedureSourceServiceFactory> serviceFactoryClass)
- Parameters:
serviceFactoryClass
-ProcedureSourceServiceFactory
Class
.- Returns:
- Loaded
ProcedureSource
.
-
loadProcedureSource
public static ProcedureSource loadProcedureSource(java.lang.Class<? extends ProcedureSourceServiceFactory> serviceFactoryClass, OfficeFloorCompiler compiler)
- Parameters:
serviceFactoryClass
-ProcedureSourceServiceFactory
Class
.compiler
-OfficeFloorCompiler
.- Returns:
- Loaded
ProcedureSource
.
-
-