Class SupplierLoaderUtil
java.lang.Object
net.officefloor.compile.test.supplier.SupplierLoaderUtil
Utility class for testing a
SupplierSource.- Author:
- Daniel Sagenschneider
-
Method Summary
Modifier and TypeMethodDescriptionstatic SupplierTypeBuilderCreates theSupplierTypeBuilderto create the expectedInitialSupplierType.static SupplierCompletionContextSafely obtains theSupplierCompletionContextfrom theSupplierSourceContext.static <S extends SupplierSource>
InitialSupplierTypeloadInitialSupplierType(Class<S> supplierSourceClass, String... propertyNameValues) Convenience method that loads theInitialSupplierTypeby obtaining theClassLoaderfrom theSupplierSourceclass.static <S extends SupplierSource>
InitialSupplierTypeloadInitialSupplierType(Class<S> supplierSourceClass, OfficeFloorCompiler compiler, String... propertyNameValues) Convenience method that loads theInitialSupplierTypewith the providedOfficeFloorCompiler.static <S extends SupplierSource>
SupplierTypeloadSupplierType(Class<S> supplierSourceClass, String... propertyNameValues) Convenience method that loads theSupplierTypeby obtaining theClassLoaderfrom theSupplierSourceclass.static <S extends SupplierSource>
SupplierTypeloadSupplierType(Class<S> supplierSourceClass, OfficeFloorCompiler compiler, String... propertyNameValues) Convenience method that loads theSupplierTypewith the providedOfficeFloorCompiler.static <S extends SupplierSource>
InitialSupplierTypevalidateInitialSupplierType(SupplierTypeBuilder expectedSupplierType, Class<S> supplierSourceClass, String... propertyNameValues) Convenience method that validates theInitialSupplierTypeloaded from the inputSupplierSourceagainst the expectedInitialSupplierTypefrom theSupplierTypeBuilder.static <S extends SupplierSource>
PropertyListvalidateSpecification(Class<S> supplierSourceClass, String... propertyNameLabels) Validates theSupplierSourceSpecificationfor theSupplierSource.static <S extends SupplierSource>
SupplierTypevalidateSupplierType(SupplierTypeBuilder expectedSupplierType, Class<S> supplierSourceClass, String... propertyNameValues) Convenience method that validates theSupplierTypeloaded from the inputSupplierSourceagainst the expectedSupplierTypefrom theSupplierTypeBuilder.
-
Method Details
-
getSupplierCompletionContext
Safely obtains the
SupplierCompletionContextfrom theSupplierSourceContext.This aids in testing of
SupplierCompileCompletion.- Parameters:
context-SupplierSourceContext.- Returns:
SupplierCompletionContextcorresponding to theSupplierSourceContext.
-
validateSpecification
public static <S extends SupplierSource> PropertyList validateSpecification(Class<S> supplierSourceClass, String... propertyNameLabels) Validates theSupplierSourceSpecificationfor theSupplierSource.- Type Parameters:
S-SupplierSourcetype.- Parameters:
supplierSourceClass-SupplierSourceclass.propertyNameLabels- Listing of name/label pairs for thePropertyinstances.- Returns:
- Loaded
PropertyList.
-
createSupplierTypeBuilder
Creates theSupplierTypeBuilderto create the expectedInitialSupplierType.- Returns:
SupplierTypeBuilderto build the expectedInitialSupplierType.
-
validateInitialSupplierType
public static <S extends SupplierSource> InitialSupplierType validateInitialSupplierType(SupplierTypeBuilder expectedSupplierType, Class<S> supplierSourceClass, String... propertyNameValues) Convenience method that validates theInitialSupplierTypeloaded from the inputSupplierSourceagainst the expectedInitialSupplierTypefrom theSupplierTypeBuilder.- Type Parameters:
S-SupplierSourcetype.- Parameters:
expectedSupplierType-SupplierTypeBuilderthat has had the expectedInitialSupplierTypebuilt against it.supplierSourceClass-SupplierSourceclass.propertyNameValues- Listing of name/value pairs that comprise the properties for theSupplierSource.- Returns:
- Loaded
InitialSupplierType.
-
validateSupplierType
public static <S extends SupplierSource> SupplierType validateSupplierType(SupplierTypeBuilder expectedSupplierType, Class<S> supplierSourceClass, String... propertyNameValues) Convenience method that validates theSupplierTypeloaded from the inputSupplierSourceagainst the expectedSupplierTypefrom theSupplierTypeBuilder.- Type Parameters:
S-SupplierSourcetype.- Parameters:
expectedSupplierType-SupplierTypeBuilderthat has had the expectedSupplierTypebuilt against it.supplierSourceClass-SupplierSourceclass.propertyNameValues- Listing of name/value pairs that comprise the properties for theSupplierSource.- Returns:
- Loaded
SupplierType.
-
loadInitialSupplierType
public static <S extends SupplierSource> InitialSupplierType loadInitialSupplierType(Class<S> supplierSourceClass, String... propertyNameValues) Convenience method that loads theInitialSupplierTypeby obtaining theClassLoaderfrom theSupplierSourceclass.- Type Parameters:
S-SupplierSourcetype.- Parameters:
supplierSourceClass-SupplierSourceclass.propertyNameValues- Listing of name/value pairs that comprise the properties for theSupplierSource.- Returns:
- Loaded
InitialSupplierType.
-
loadInitialSupplierType
public static <S extends SupplierSource> InitialSupplierType loadInitialSupplierType(Class<S> supplierSourceClass, OfficeFloorCompiler compiler, String... propertyNameValues) Convenience method that loads theInitialSupplierTypewith the providedOfficeFloorCompiler.- Type Parameters:
S-SupplierSourcetype.- Parameters:
supplierSourceClass-SupplierSourceclass.compiler-OfficeFloorCompiler.propertyNameValues- Listing of name/value pairs that comprise the properties for theSupplierSource.- Returns:
- Loaded
InitialSupplierType.
-
loadSupplierType
public static <S extends SupplierSource> SupplierType loadSupplierType(Class<S> supplierSourceClass, String... propertyNameValues) Convenience method that loads theSupplierTypeby obtaining theClassLoaderfrom theSupplierSourceclass.- Type Parameters:
S-SupplierSourcetype.- Parameters:
supplierSourceClass-SupplierSourceclass.propertyNameValues- Listing of name/value pairs that comprise the properties for theSupplierSource.- Returns:
- Loaded
SupplierType.
-
loadSupplierType
public static <S extends SupplierSource> SupplierType loadSupplierType(Class<S> supplierSourceClass, OfficeFloorCompiler compiler, String... propertyNameValues) Convenience method that loads theSupplierTypewith the providedOfficeFloorCompiler.- Type Parameters:
S-SupplierSourcetype.- Parameters:
supplierSourceClass-SupplierSourceclass.compiler-OfficeFloorCompiler.propertyNameValues- Listing of name/value pairs that comprise the properties for theSupplierSource.- Returns:
- Loaded
SupplierType.
-