Class SupplierLoaderUtil
- java.lang.Object
-
- net.officefloor.compile.test.supplier.SupplierLoaderUtil
-
public class SupplierLoaderUtil extends java.lang.ObjectUtility class for testing aSupplierSource.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SupplierTypeBuildercreateSupplierTypeBuilder()Creates theSupplierTypeBuilderto create the expectedInitialSupplierType.static SupplierCompletionContextgetSupplierCompletionContext(SupplierSourceContext context)Safely obtains theSupplierCompletionContextfrom theSupplierSourceContext.static <S extends SupplierSource>
InitialSupplierTypeloadInitialSupplierType(java.lang.Class<S> supplierSourceClass, java.lang.String... propertyNameValues)Convenience method that loads theInitialSupplierTypeby obtaining theClassLoaderfrom theSupplierSourceclass.static <S extends SupplierSource>
InitialSupplierTypeloadInitialSupplierType(java.lang.Class<S> supplierSourceClass, OfficeFloorCompiler compiler, java.lang.String... propertyNameValues)Convenience method that loads theInitialSupplierTypewith the providedOfficeFloorCompiler.static <S extends SupplierSource>
SupplierTypeloadSupplierType(java.lang.Class<S> supplierSourceClass, java.lang.String... propertyNameValues)Convenience method that loads theSupplierTypeby obtaining theClassLoaderfrom theSupplierSourceclass.static <S extends SupplierSource>
SupplierTypeloadSupplierType(java.lang.Class<S> supplierSourceClass, OfficeFloorCompiler compiler, java.lang.String... propertyNameValues)Convenience method that loads theSupplierTypewith the providedOfficeFloorCompiler.static <S extends SupplierSource>
InitialSupplierTypevalidateInitialSupplierType(SupplierTypeBuilder expectedSupplierType, java.lang.Class<S> supplierSourceClass, java.lang.String... propertyNameValues)Convenience method that validates theInitialSupplierTypeloaded from the inputSupplierSourceagainst the expectedInitialSupplierTypefrom theSupplierTypeBuilder.static <S extends SupplierSource>
PropertyListvalidateSpecification(java.lang.Class<S> supplierSourceClass, java.lang.String... propertyNameLabels)Validates theSupplierSourceSpecificationfor theSupplierSource.static <S extends SupplierSource>
SupplierTypevalidateSupplierType(SupplierTypeBuilder expectedSupplierType, java.lang.Class<S> supplierSourceClass, java.lang.String... propertyNameValues)Convenience method that validates theSupplierTypeloaded from the inputSupplierSourceagainst the expectedSupplierTypefrom theSupplierTypeBuilder.
-
-
-
Method Detail
-
getSupplierCompletionContext
public static SupplierCompletionContext getSupplierCompletionContext(SupplierSourceContext context)
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(java.lang.Class<S> supplierSourceClass, java.lang.String... propertyNameLabels)
Validates theSupplierSourceSpecificationfor theSupplierSource.- Type Parameters:
S-SupplierSourcetype.- Parameters:
supplierSourceClass-SupplierSourceclass.propertyNameLabels- Listing of name/label pairs for thePropertyinstances.- Returns:
- Loaded
PropertyList.
-
createSupplierTypeBuilder
public static SupplierTypeBuilder createSupplierTypeBuilder()
Creates theSupplierTypeBuilderto create the expectedInitialSupplierType.- Returns:
SupplierTypeBuilderto build the expectedInitialSupplierType.
-
validateInitialSupplierType
public static <S extends SupplierSource> InitialSupplierType validateInitialSupplierType(SupplierTypeBuilder expectedSupplierType, java.lang.Class<S> supplierSourceClass, java.lang.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, java.lang.Class<S> supplierSourceClass, java.lang.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(java.lang.Class<S> supplierSourceClass, java.lang.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(java.lang.Class<S> supplierSourceClass, OfficeFloorCompiler compiler, java.lang.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(java.lang.Class<S> supplierSourceClass, java.lang.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(java.lang.Class<S> supplierSourceClass, OfficeFloorCompiler compiler, java.lang.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.
-
-