Class ManagedObjectLoaderUtil
java.lang.Object
net.officefloor.compile.test.managedobject.ManagedObjectLoaderUtil
Utility class for testing the
ManagedObjectSource.- Author:
- Daniel Sagenschneider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classManagedObjectSourceto enable obtaining theAbstractAsyncManagedObjectSource.MetaDataContext. -
Method Summary
Modifier and TypeMethodDescriptionstatic ManagedObjectTypeBuilderCreates theManagedObjectTypeBuilderto create the expectedManagedObjectType.static <M extends Enum<M>,F extends Enum<F>>
AbstractAsyncManagedObjectSource.MetaDataContext<M,F> createMetaDataContext(Class<M> dependenciesEnum, Class<F> flowsEnum, String... propertyNameValues) static <M extends Enum<M>,F extends Enum<F>, S extends ManagedObjectSource<M, F>>
ManagedObjectType<M>loadManagedObjectType(Class<S> managedObjectSourceClass, ClassLoader classLoader, String... propertyNameValues) Loads theManagedObjectTypefrom theManagedObjectSource.static <M extends Enum<M>,F extends Enum<F>, S extends ManagedObjectSource<M, F>>
ManagedObjectType<M>loadManagedObjectType(Class<S> managedObjectSourceClass, String... propertyNameValues) Convenience method to load theManagedObjectTypefrom theManagedObjectSourceutilising theClassLoaderfrom the inputManagedObjectSourceclass.static <M extends Enum<M>,F extends Enum<F>>
ManagedObjectType<M>loadManagedObjectType(ManagedObjectSource<M, F> managedObjectSource, String... propertyNameValues) Loads theManagedObjectTypefrom theManagedObjectSource.static voidSpecifies theOfficeFloorCompilerfor the next operation.static <M extends Enum<M>,F extends Enum<F>, S extends ManagedObjectSource<M, F>>
ManagedObjectType<M>validateManagedObjectType(ManagedObjectTypeBuilder expectedManagedObjectType, Class<S> managedObjectSourceClass, String... propertyNameValues) Validates theManagedObjectTypecontained in theManagedObjectTypeBuilderagainst theManagedObjectTypeloaded from theManagedObjectSource.static <M extends Enum<M>,F extends Enum<F>>
ManagedObjectType<M>validateManagedObjectType(ManagedObjectTypeBuilder expectedManagedObjectType, ManagedObjectSource<M, F> managedObjectSource, String... propertyNameValues) Validates theManagedObjectTypecontained in theManagedObjectTypeBuilderagainst theManagedObjectTypeloaded from theManagedObjectSource.static <M extends Enum<M>,F extends Enum<F>, S extends ManagedObjectSource<M, F>>
PropertyListvalidateSpecification(Class<S> managedObjectSourceClass, String... propertyNameLabels) Validates theManagedObjectSourceSpecificationfor theManagedObjectSource.static <M extends Enum<M>,F extends Enum<F>>
PropertyListvalidateSpecification(ManagedObjectSource<M, F> managedObjectSource, String... propertyNameLabels) Validates theManagedObjectSourceSpecificationfor theManagedObjectSource.
-
Method Details
-
validateSpecification
public static <M extends Enum<M>,F extends Enum<F>> PropertyList validateSpecification(ManagedObjectSource<M, F> managedObjectSource, String... propertyNameLabels) Validates theManagedObjectSourceSpecificationfor theManagedObjectSource.- Type Parameters:
M- Dependency keys type.F-Flowkeys type.- Parameters:
managedObjectSource-ManagedObjectSourceclass.propertyNameLabels- Listing of name/label pairs for thePropertyinstances.- Returns:
- Loaded
PropertyList.
-
validateSpecification
public static <M extends Enum<M>,F extends Enum<F>, PropertyList validateSpecificationS extends ManagedObjectSource<M, F>> (Class<S> managedObjectSourceClass, String... propertyNameLabels) Validates theManagedObjectSourceSpecificationfor theManagedObjectSource.- Type Parameters:
M- Dependency keys type.F-Flowkeys type.S-ManagedObjectSourcetype.- Parameters:
managedObjectSourceClass-ManagedObjectSourceclass.propertyNameLabels- Listing of name/label pairs for thePropertyinstances.- Returns:
- Loaded
PropertyList.
-
createManagedObjectTypeBuilder
Creates theManagedObjectTypeBuilderto create the expectedManagedObjectType.- Returns:
ManagedObjectTypeBuilder.
-
validateManagedObjectType
public static <M extends Enum<M>,F extends Enum<F>, ManagedObjectType<M> validateManagedObjectTypeS extends ManagedObjectSource<M, F>> (ManagedObjectTypeBuilder expectedManagedObjectType, Class<S> managedObjectSourceClass, String... propertyNameValues) Validates theManagedObjectTypecontained in theManagedObjectTypeBuilderagainst theManagedObjectTypeloaded from theManagedObjectSource.- Type Parameters:
M- Dependency keys type.F-Flowkeys type.S-ManagedObjectSourcetype.- Parameters:
expectedManagedObjectType- ExpectedManagedObjectType.managedObjectSourceClass-ManagedObjectSourceClass.propertyNameValues- Property values to configure theManagedObjectSource.- Returns:
ManagedObjectTypeloaded from theManagedObjectSource.
-
validateManagedObjectType
public static <M extends Enum<M>,F extends Enum<F>> ManagedObjectType<M> validateManagedObjectType(ManagedObjectTypeBuilder expectedManagedObjectType, ManagedObjectSource<M, F> managedObjectSource, String... propertyNameValues) Validates theManagedObjectTypecontained in theManagedObjectTypeBuilderagainst theManagedObjectTypeloaded from theManagedObjectSource.- Type Parameters:
M- Dependency keys type.F-Flowkeys type.- Parameters:
expectedManagedObjectType- ExpectedManagedObjectType.managedObjectSource-ManagedObjectSourceinstance.propertyNameValues- Property values to configure theManagedObjectSource.- Returns:
ManagedObjectTypeloaded from theManagedObjectSource.
-
loadManagedObjectType
public static <M extends Enum<M>,F extends Enum<F>, ManagedObjectType<M> loadManagedObjectTypeS extends ManagedObjectSource<M, F>> (Class<S> managedObjectSourceClass, String... propertyNameValues) Convenience method to load theManagedObjectTypefrom theManagedObjectSourceutilising theClassLoaderfrom the inputManagedObjectSourceclass.- Type Parameters:
M- Dependency keys type.F-Flowkeys type.S-ManagedObjectSourcetype.- Parameters:
managedObjectSourceClass-ManagedObjectSourceclass.propertyNameValues-Propertyname/value listing.- Returns:
ManagedObjectType.
-
loadManagedObjectType
public static <M extends Enum<M>,F extends Enum<F>, ManagedObjectType<M> loadManagedObjectTypeS extends ManagedObjectSource<M, F>> (Class<S> managedObjectSourceClass, ClassLoader classLoader, String... propertyNameValues) Loads theManagedObjectTypefrom theManagedObjectSource.- Type Parameters:
M- Dependency keys type.F-Flowkeys type.S-ManagedObjectSourcetype.- Parameters:
managedObjectSourceClass-ManagedObjectSourceclass.classLoader-ClassLoader.propertyNameValues-Propertyname/value listing.- Returns:
ManagedObjectType.
-
loadManagedObjectType
public static <M extends Enum<M>,F extends Enum<F>> ManagedObjectType<M> loadManagedObjectType(ManagedObjectSource<M, F> managedObjectSource, String... propertyNameValues) Loads theManagedObjectTypefrom theManagedObjectSource.- Type Parameters:
M- Dependency keys type.F-Flowkeys type.- Parameters:
managedObjectSource-ManagedObjectSourceinstance.propertyNameValues-Propertyname/value listing.- Returns:
ManagedObjectType.
-
setNextOfficeFloorCompiler
Specifies theOfficeFloorCompilerfor the next operation.- Parameters:
compiler-OfficeFloorCompilerfor the next operation.
-
createMetaDataContext
public static <M extends Enum<M>,F extends Enum<F>> AbstractAsyncManagedObjectSource.MetaDataContext<M,F> createMetaDataContext(Class<M> dependenciesEnum, Class<F> flowsEnum, String... propertyNameValues) Creates a
AbstractAsyncManagedObjectSource.MetaDataContext.This is useful for testing abstract
ManagedObjectSourceinstances that delegate configuration to sub classes.- Type Parameters:
M- Dependency keys type.F-Flowkeys type.- Parameters:
dependenciesEnum- DependencyEnum.flowsEnum- FlowsEnum.propertyNameValues- Property name values for theAbstractAsyncManagedObjectSource.MetaDataContext.- Returns:
AbstractAsyncManagedObjectSource.MetaDataContext.
-