Class ManagedFunctionLoaderUtil
- java.lang.Object
-
- net.officefloor.compile.test.managedfunction.ManagedFunctionLoaderUtil
-
public class ManagedFunctionLoaderUtil extends java.lang.Object
Utility class for testing aManagedFunctionSource
.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FunctionNamespaceBuilder
createManagedFunctionTypeBuilder()
Creates theFunctionNamespaceBuilder
to create the expectedFunctionNamespaceType
.static <S extends ManagedFunctionSource>
FunctionNamespaceTypeloadManagedFunctionType(java.lang.Class<S> managedFunctionSourceClass, java.lang.String... propertyNameValues)
Convenience method that loads theFunctionNamespaceType
by obtaining theClassLoader
from theManagedFunctionSource
class.static <S extends ManagedFunctionSource>
FunctionNamespaceTypeloadManagedFunctionType(java.lang.Class<S> managedFunctionSourceClass, OfficeFloorCompiler compiler, java.lang.String... propertyNameValues)
Convenience method that loads theFunctionNamespaceType
with the providedOfficeFloorCompiler
.static FunctionNamespaceType
loadManagedFunctionType(ManagedFunctionSource managedFunctionSource, java.lang.String... propertyNameValues)
Convenience method that loads theFunctionNamespaceType
by obtaining theClassLoader
from theManagedFunctionSource
class.static <S extends ManagedFunctionSource>
FunctionNamespaceTypevalidateManagedFunctionType(FunctionNamespaceBuilder expectedFunctionNamespaceType, java.lang.Class<S> managedFunctionSourceClass, java.lang.String... propertyNameValues)
Convenience method that validates theFunctionNamespaceType
loaded from the inputManagedFunctionSource
against the expectedFunctionNamespaceType
from theFunctionNamespaceBuilder
.static <S extends ManagedFunctionSource>
FunctionNamespaceTypevalidateManagedFunctionType(FunctionNamespaceBuilder expectedFunctionNamespaceType, java.lang.Class<S> managedFunctionSourceClass, OfficeFloorCompiler compiler, java.lang.String... propertyNameValues)
Convenience method that validates theFunctionNamespaceType
loaded from the inputManagedFunctionSource
against the expectedFunctionNamespaceType
from theFunctionNamespaceBuilder
.static FunctionNamespaceType
validateManagedFunctionType(FunctionNamespaceBuilder expectedFunctionNamespaceType, FunctionNamespaceType aNamespace)
Convenience method that validates theFunctionNamespaceType
loaded from the inputManagedFunctionSource
against the expectedFunctionNamespaceType
from theFunctionNamespaceBuilder
.static FunctionNamespaceType
validateManagedFunctionType(FunctionNamespaceBuilder expectedFunctionNamespaceType, ManagedFunctionSource managedFunctionSource, java.lang.String... propertyNameValues)
Convenience method that validates theFunctionNamespaceType
loaded from the inputManagedFunctionSource
against the expectedFunctionNamespaceType
from theFunctionNamespaceBuilder
.static void
validateManagedFunctionType(ManagedFunctionTypeBuilder<?,?> expectedFunction, ManagedFunctionType<?,?> actualFunction)
Validates a specificManagedFunctionType
.static <S extends ManagedFunctionSource>
PropertyListvalidateSpecification(java.lang.Class<S> managedFunctionSourceClass, java.lang.String... propertyNameLabels)
Validates theManagedFunctionSourceSpecification
for theManagedFunctionSource
.static PropertyList
validateSpecification(ManagedFunctionSource managedFunctionSource, java.lang.String... propertyNameLabels)
Validates theManagedFunctionSourceSpecification
for theManagedFunctionSource
.
-
-
-
Method Detail
-
validateSpecification
public static <S extends ManagedFunctionSource> PropertyList validateSpecification(java.lang.Class<S> managedFunctionSourceClass, java.lang.String... propertyNameLabels)
Validates theManagedFunctionSourceSpecification
for theManagedFunctionSource
.- Type Parameters:
S
-ManagedFunctionSource
type.- Parameters:
managedFunctionSourceClass
-ManagedFunctionSource
class.propertyNameLabels
- Listing of name/label pairs for theProperty
instances.- Returns:
- Loaded
PropertyList
.
-
validateSpecification
public static PropertyList validateSpecification(ManagedFunctionSource managedFunctionSource, java.lang.String... propertyNameLabels)
Validates theManagedFunctionSourceSpecification
for theManagedFunctionSource
.- Parameters:
managedFunctionSource
-ManagedFunctionSource
instance.propertyNameLabels
- Listing of name/label pairs for theProperty
instances.- Returns:
- Loaded
PropertyList
.
-
createManagedFunctionTypeBuilder
public static FunctionNamespaceBuilder createManagedFunctionTypeBuilder()
Creates theFunctionNamespaceBuilder
to create the expectedFunctionNamespaceType
.- Returns:
FunctionNamespaceBuilder
to build the expectedFunctionNamespaceType
.
-
validateManagedFunctionType
public static <S extends ManagedFunctionSource> FunctionNamespaceType validateManagedFunctionType(FunctionNamespaceBuilder expectedFunctionNamespaceType, java.lang.Class<S> managedFunctionSourceClass, java.lang.String... propertyNameValues)
Convenience method that validates theFunctionNamespaceType
loaded from the inputManagedFunctionSource
against the expectedFunctionNamespaceType
from theFunctionNamespaceBuilder
.- Type Parameters:
S
-ManagedFunctionSource
type.- Parameters:
expectedFunctionNamespaceType
-FunctionNamespaceBuilder
that has had the expectedFunctionNamespaceType
built against it.managedFunctionSourceClass
-ManagedFunctionSource
class.propertyNameValues
- Listing of name/value pairs that comprise the properties for theManagedFunctionSource
.- Returns:
- Loaded
FunctionNamespaceType
.
-
validateManagedFunctionType
public static <S extends ManagedFunctionSource> FunctionNamespaceType validateManagedFunctionType(FunctionNamespaceBuilder expectedFunctionNamespaceType, java.lang.Class<S> managedFunctionSourceClass, OfficeFloorCompiler compiler, java.lang.String... propertyNameValues)
Convenience method that validates theFunctionNamespaceType
loaded from the inputManagedFunctionSource
against the expectedFunctionNamespaceType
from theFunctionNamespaceBuilder
.- Type Parameters:
S
-ManagedFunctionSource
type.- Parameters:
expectedFunctionNamespaceType
-FunctionNamespaceBuilder
that has had the expectedFunctionNamespaceType
built against it.managedFunctionSourceClass
-ManagedFunctionSource
class.compiler
-OfficeFloorCompiler
. May benull
.propertyNameValues
- Listing of name/value pairs that comprise the properties for theManagedFunctionSource
.- Returns:
- Loaded
FunctionNamespaceType
.
-
validateManagedFunctionType
public static FunctionNamespaceType validateManagedFunctionType(FunctionNamespaceBuilder expectedFunctionNamespaceType, ManagedFunctionSource managedFunctionSource, java.lang.String... propertyNameValues)
Convenience method that validates theFunctionNamespaceType
loaded from the inputManagedFunctionSource
against the expectedFunctionNamespaceType
from theFunctionNamespaceBuilder
.- Parameters:
expectedFunctionNamespaceType
-FunctionNamespaceBuilder
that has had the expectedFunctionNamespaceType
built against it.managedFunctionSource
-ManagedFunctionSource
instance.propertyNameValues
- Listing of name/value pairs that comprise the properties for theManagedFunctionSource
.- Returns:
- Loaded
FunctionNamespaceType
.
-
validateManagedFunctionType
public static FunctionNamespaceType validateManagedFunctionType(FunctionNamespaceBuilder expectedFunctionNamespaceType, FunctionNamespaceType aNamespace)
Convenience method that validates theFunctionNamespaceType
loaded from the inputManagedFunctionSource
against the expectedFunctionNamespaceType
from theFunctionNamespaceBuilder
.- Parameters:
expectedFunctionNamespaceType
-FunctionNamespaceBuilder
that has had the expectedFunctionNamespaceType
built against it.aNamespace
- ActualFunctionNamespaceType
.- Returns:
- Loaded
FunctionNamespaceType
.
-
validateManagedFunctionType
public static void validateManagedFunctionType(ManagedFunctionTypeBuilder<?,?> expectedFunction, ManagedFunctionType<?,?> actualFunction)
Validates a specificManagedFunctionType
.- Parameters:
expectedFunction
-ManagedFunctionTypeBuilder
that has had the expectedManagedFunctionType
built against it.actualFunction
- ActualManagedFunctionType
.
-
loadManagedFunctionType
public static <S extends ManagedFunctionSource> FunctionNamespaceType loadManagedFunctionType(java.lang.Class<S> managedFunctionSourceClass, java.lang.String... propertyNameValues)
Convenience method that loads theFunctionNamespaceType
by obtaining theClassLoader
from theManagedFunctionSource
class.- Type Parameters:
S
-ManagedFunctionSource
type.- Parameters:
managedFunctionSourceClass
-ManagedFunctionSource
class.propertyNameValues
- Listing of name/value pairs that comprise the properties for theManagedFunctionSource
.- Returns:
- Loaded
FunctionNamespaceType
.
-
loadManagedFunctionType
public static <S extends ManagedFunctionSource> FunctionNamespaceType loadManagedFunctionType(java.lang.Class<S> managedFunctionSourceClass, OfficeFloorCompiler compiler, java.lang.String... propertyNameValues)
Convenience method that loads theFunctionNamespaceType
with the providedOfficeFloorCompiler
.- Type Parameters:
S
-ManagedFunctionSource
type.- Parameters:
managedFunctionSourceClass
-ManagedFunctionSource
class.compiler
-OfficeFloorCompiler
.propertyNameValues
- Listing of name/value pairs that comprise the properties for theManagedFunctionSource
.- Returns:
- Loaded
FunctionNamespaceType
.
-
loadManagedFunctionType
public static FunctionNamespaceType loadManagedFunctionType(ManagedFunctionSource managedFunctionSource, java.lang.String... propertyNameValues)
Convenience method that loads theFunctionNamespaceType
by obtaining theClassLoader
from theManagedFunctionSource
class.- Parameters:
managedFunctionSource
-ManagedFunctionSource
instance.propertyNameValues
- Listing of name/value pairs that comprise the properties for theManagedFunctionSource
.- Returns:
- Loaded
FunctionNamespaceType
.
-
-