Class ManagedObjectLoaderUtil
- java.lang.Object
-
- net.officefloor.compile.test.managedobject.ManagedObjectLoaderUtil
-
public class ManagedObjectLoaderUtil extends java.lang.Object
Utility class for testing theManagedObjectSource
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ManagedObjectLoaderUtil.CollectMetaDataContextManagedObjectSource
ManagedObjectSource
to enable obtaining theAbstractAsyncManagedObjectSource.MetaDataContext
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ManagedObjectTypeBuilder
createManagedObjectTypeBuilder()
Creates theManagedObjectTypeBuilder
to create the expectedManagedObjectType
.static <M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
AbstractAsyncManagedObjectSource.MetaDataContext<M,F>createMetaDataContext(java.lang.Class<M> dependenciesEnum, java.lang.Class<F> flowsEnum, java.lang.String... propertyNameValues)
static <M extends java.lang.Enum<M>,F extends java.lang.Enum<F>,S extends ManagedObjectSource<M,F>>
ManagedObjectType<M>loadManagedObjectType(java.lang.Class<S> managedObjectSourceClass, java.lang.ClassLoader classLoader, java.lang.String... propertyNameValues)
Loads theManagedObjectType
from theManagedObjectSource
.static <M extends java.lang.Enum<M>,F extends java.lang.Enum<F>,S extends ManagedObjectSource<M,F>>
ManagedObjectType<M>loadManagedObjectType(java.lang.Class<S> managedObjectSourceClass, java.lang.String... propertyNameValues)
Convenience method to load theManagedObjectType
from theManagedObjectSource
utilising theClassLoader
from the inputManagedObjectSource
class.static <M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
ManagedObjectType<M>loadManagedObjectType(ManagedObjectSource<M,F> managedObjectSource, java.lang.String... propertyNameValues)
Loads theManagedObjectType
from theManagedObjectSource
.static void
setNextOfficeFloorCompiler(OfficeFloorCompiler compiler)
Specifies theOfficeFloorCompiler
for the next operation.static <M extends java.lang.Enum<M>,F extends java.lang.Enum<F>,S extends ManagedObjectSource<M,F>>
ManagedObjectType<M>validateManagedObjectType(ManagedObjectTypeBuilder expectedManagedObjectType, java.lang.Class<S> managedObjectSourceClass, java.lang.String... propertyNameValues)
Validates theManagedObjectType
contained in theManagedObjectTypeBuilder
against theManagedObjectType
loaded from theManagedObjectSource
.static <M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
ManagedObjectType<M>validateManagedObjectType(ManagedObjectTypeBuilder expectedManagedObjectType, ManagedObjectSource<M,F> managedObjectSource, java.lang.String... propertyNameValues)
Validates theManagedObjectType
contained in theManagedObjectTypeBuilder
against theManagedObjectType
loaded from theManagedObjectSource
.static <M extends java.lang.Enum<M>,F extends java.lang.Enum<F>,S extends ManagedObjectSource<M,F>>
PropertyListvalidateSpecification(java.lang.Class<S> managedObjectSourceClass, java.lang.String... propertyNameLabels)
Validates theManagedObjectSourceSpecification
for theManagedObjectSource
.static <M extends java.lang.Enum<M>,F extends java.lang.Enum<F>>
PropertyListvalidateSpecification(ManagedObjectSource<M,F> managedObjectSource, java.lang.String... propertyNameLabels)
Validates theManagedObjectSourceSpecification
for theManagedObjectSource
.
-
-
-
Method Detail
-
validateSpecification
public static <M extends java.lang.Enum<M>,F extends java.lang.Enum<F>> PropertyList validateSpecification(ManagedObjectSource<M,F> managedObjectSource, java.lang.String... propertyNameLabels)
Validates theManagedObjectSourceSpecification
for theManagedObjectSource
.- Type Parameters:
M
- Dependency keys type.F
-Flow
keys type.- Parameters:
managedObjectSource
-ManagedObjectSource
class.propertyNameLabels
- Listing of name/label pairs for theProperty
instances.- Returns:
- Loaded
PropertyList
.
-
validateSpecification
public static <M extends java.lang.Enum<M>,F extends java.lang.Enum<F>,S extends ManagedObjectSource<M,F>> PropertyList validateSpecification(java.lang.Class<S> managedObjectSourceClass, java.lang.String... propertyNameLabels)
Validates theManagedObjectSourceSpecification
for theManagedObjectSource
.- Type Parameters:
M
- Dependency keys type.F
-Flow
keys type.S
-ManagedObjectSource
type.- Parameters:
managedObjectSourceClass
-ManagedObjectSource
class.propertyNameLabels
- Listing of name/label pairs for theProperty
instances.- Returns:
- Loaded
PropertyList
.
-
createManagedObjectTypeBuilder
public static ManagedObjectTypeBuilder createManagedObjectTypeBuilder()
Creates theManagedObjectTypeBuilder
to create the expectedManagedObjectType
.- Returns:
ManagedObjectTypeBuilder
.
-
validateManagedObjectType
public static <M extends java.lang.Enum<M>,F extends java.lang.Enum<F>,S extends ManagedObjectSource<M,F>> ManagedObjectType<M> validateManagedObjectType(ManagedObjectTypeBuilder expectedManagedObjectType, java.lang.Class<S> managedObjectSourceClass, java.lang.String... propertyNameValues)
Validates theManagedObjectType
contained in theManagedObjectTypeBuilder
against theManagedObjectType
loaded from theManagedObjectSource
.- Type Parameters:
M
- Dependency keys type.F
-Flow
keys type.S
-ManagedObjectSource
type.- Parameters:
expectedManagedObjectType
- ExpectedManagedObjectType
.managedObjectSourceClass
-ManagedObjectSource
Class
.propertyNameValues
- Property values to configure theManagedObjectSource
.- Returns:
ManagedObjectType
loaded from theManagedObjectSource
.
-
validateManagedObjectType
public static <M extends java.lang.Enum<M>,F extends java.lang.Enum<F>> ManagedObjectType<M> validateManagedObjectType(ManagedObjectTypeBuilder expectedManagedObjectType, ManagedObjectSource<M,F> managedObjectSource, java.lang.String... propertyNameValues)
Validates theManagedObjectType
contained in theManagedObjectTypeBuilder
against theManagedObjectType
loaded from theManagedObjectSource
.- Type Parameters:
M
- Dependency keys type.F
-Flow
keys type.- Parameters:
expectedManagedObjectType
- ExpectedManagedObjectType
.managedObjectSource
-ManagedObjectSource
instance.propertyNameValues
- Property values to configure theManagedObjectSource
.- Returns:
ManagedObjectType
loaded from theManagedObjectSource
.
-
loadManagedObjectType
public static <M extends java.lang.Enum<M>,F extends java.lang.Enum<F>,S extends ManagedObjectSource<M,F>> ManagedObjectType<M> loadManagedObjectType(java.lang.Class<S> managedObjectSourceClass, java.lang.String... propertyNameValues)
Convenience method to load theManagedObjectType
from theManagedObjectSource
utilising theClassLoader
from the inputManagedObjectSource
class.- Type Parameters:
M
- Dependency keys type.F
-Flow
keys type.S
-ManagedObjectSource
type.- Parameters:
managedObjectSourceClass
-ManagedObjectSource
class.propertyNameValues
-Property
name/value listing.- Returns:
ManagedObjectType
.
-
loadManagedObjectType
public static <M extends java.lang.Enum<M>,F extends java.lang.Enum<F>,S extends ManagedObjectSource<M,F>> ManagedObjectType<M> loadManagedObjectType(java.lang.Class<S> managedObjectSourceClass, java.lang.ClassLoader classLoader, java.lang.String... propertyNameValues)
Loads theManagedObjectType
from theManagedObjectSource
.- Type Parameters:
M
- Dependency keys type.F
-Flow
keys type.S
-ManagedObjectSource
type.- Parameters:
managedObjectSourceClass
-ManagedObjectSource
class.classLoader
-ClassLoader
.propertyNameValues
-Property
name/value listing.- Returns:
ManagedObjectType
.
-
loadManagedObjectType
public static <M extends java.lang.Enum<M>,F extends java.lang.Enum<F>> ManagedObjectType<M> loadManagedObjectType(ManagedObjectSource<M,F> managedObjectSource, java.lang.String... propertyNameValues)
Loads theManagedObjectType
from theManagedObjectSource
.- Type Parameters:
M
- Dependency keys type.F
-Flow
keys type.- Parameters:
managedObjectSource
-ManagedObjectSource
instance.propertyNameValues
-Property
name/value listing.- Returns:
ManagedObjectType
.
-
setNextOfficeFloorCompiler
public static void setNextOfficeFloorCompiler(OfficeFloorCompiler compiler)
Specifies theOfficeFloorCompiler
for the next operation.- Parameters:
compiler
-OfficeFloorCompiler
for the next operation.
-
createMetaDataContext
public static <M extends java.lang.Enum<M>,F extends java.lang.Enum<F>> AbstractAsyncManagedObjectSource.MetaDataContext<M,F> createMetaDataContext(java.lang.Class<M> dependenciesEnum, java.lang.Class<F> flowsEnum, java.lang.String... propertyNameValues)
Creates a
AbstractAsyncManagedObjectSource.MetaDataContext
.This is useful for testing abstract
ManagedObjectSource
instances that delegate configuration to sub classes.- Type Parameters:
M
- Dependency keys type.F
-Flow
keys type.- Parameters:
dependenciesEnum
- DependencyEnum
.flowsEnum
- FlowsEnum
.propertyNameValues
- Property name values for theAbstractAsyncManagedObjectSource.MetaDataContext
.- Returns:
AbstractAsyncManagedObjectSource.MetaDataContext
.
-
-