Class SupplierLoaderUtil
- java.lang.Object
-
- net.officefloor.compile.test.supplier.SupplierLoaderUtil
-
public class SupplierLoaderUtil extends java.lang.Object
Utility class for testing aSupplierSource
.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SupplierTypeBuilder
createSupplierTypeBuilder()
Creates theSupplierTypeBuilder
to create the expectedInitialSupplierType
.static SupplierCompletionContext
getSupplierCompletionContext(SupplierSourceContext context)
Safely obtains theSupplierCompletionContext
from theSupplierSourceContext
.static <S extends SupplierSource>
InitialSupplierTypeloadInitialSupplierType(java.lang.Class<S> supplierSourceClass, java.lang.String... propertyNameValues)
Convenience method that loads theInitialSupplierType
by obtaining theClassLoader
from theSupplierSource
class.static <S extends SupplierSource>
InitialSupplierTypeloadInitialSupplierType(java.lang.Class<S> supplierSourceClass, OfficeFloorCompiler compiler, java.lang.String... propertyNameValues)
Convenience method that loads theInitialSupplierType
with the providedOfficeFloorCompiler
.static <S extends SupplierSource>
SupplierTypeloadSupplierType(java.lang.Class<S> supplierSourceClass, java.lang.String... propertyNameValues)
Convenience method that loads theSupplierType
by obtaining theClassLoader
from theSupplierSource
class.static <S extends SupplierSource>
SupplierTypeloadSupplierType(java.lang.Class<S> supplierSourceClass, OfficeFloorCompiler compiler, java.lang.String... propertyNameValues)
Convenience method that loads theSupplierType
with the providedOfficeFloorCompiler
.static <S extends SupplierSource>
InitialSupplierTypevalidateInitialSupplierType(SupplierTypeBuilder expectedSupplierType, java.lang.Class<S> supplierSourceClass, java.lang.String... propertyNameValues)
Convenience method that validates theInitialSupplierType
loaded from the inputSupplierSource
against the expectedInitialSupplierType
from theSupplierTypeBuilder
.static <S extends SupplierSource>
PropertyListvalidateSpecification(java.lang.Class<S> supplierSourceClass, java.lang.String... propertyNameLabels)
Validates theSupplierSourceSpecification
for theSupplierSource
.static <S extends SupplierSource>
SupplierTypevalidateSupplierType(SupplierTypeBuilder expectedSupplierType, java.lang.Class<S> supplierSourceClass, java.lang.String... propertyNameValues)
Convenience method that validates theSupplierType
loaded from the inputSupplierSource
against the expectedSupplierType
from theSupplierTypeBuilder
.
-
-
-
Method Detail
-
getSupplierCompletionContext
public static SupplierCompletionContext getSupplierCompletionContext(SupplierSourceContext context)
Safely obtains the
SupplierCompletionContext
from theSupplierSourceContext
.This aids in testing of
SupplierCompileCompletion
.- Parameters:
context
-SupplierSourceContext
.- Returns:
SupplierCompletionContext
corresponding to theSupplierSourceContext
.
-
validateSpecification
public static <S extends SupplierSource> PropertyList validateSpecification(java.lang.Class<S> supplierSourceClass, java.lang.String... propertyNameLabels)
Validates theSupplierSourceSpecification
for theSupplierSource
.- Type Parameters:
S
-SupplierSource
type.- Parameters:
supplierSourceClass
-SupplierSource
class.propertyNameLabels
- Listing of name/label pairs for theProperty
instances.- Returns:
- Loaded
PropertyList
.
-
createSupplierTypeBuilder
public static SupplierTypeBuilder createSupplierTypeBuilder()
Creates theSupplierTypeBuilder
to create the expectedInitialSupplierType
.- Returns:
SupplierTypeBuilder
to 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 theInitialSupplierType
loaded from the inputSupplierSource
against the expectedInitialSupplierType
from theSupplierTypeBuilder
.- Type Parameters:
S
-SupplierSource
type.- Parameters:
expectedSupplierType
-SupplierTypeBuilder
that has had the expectedInitialSupplierType
built against it.supplierSourceClass
-SupplierSource
class.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 theSupplierType
loaded from the inputSupplierSource
against the expectedSupplierType
from theSupplierTypeBuilder
.- Type Parameters:
S
-SupplierSource
type.- Parameters:
expectedSupplierType
-SupplierTypeBuilder
that has had the expectedSupplierType
built against it.supplierSourceClass
-SupplierSource
class.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 theInitialSupplierType
by obtaining theClassLoader
from theSupplierSource
class.- Type Parameters:
S
-SupplierSource
type.- Parameters:
supplierSourceClass
-SupplierSource
class.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 theInitialSupplierType
with the providedOfficeFloorCompiler
.- Type Parameters:
S
-SupplierSource
type.- Parameters:
supplierSourceClass
-SupplierSource
class.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 theSupplierType
by obtaining theClassLoader
from theSupplierSource
class.- Type Parameters:
S
-SupplierSource
type.- Parameters:
supplierSourceClass
-SupplierSource
class.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 theSupplierType
with the providedOfficeFloorCompiler
.- Type Parameters:
S
-SupplierSource
type.- Parameters:
supplierSourceClass
-SupplierSource
class.compiler
-OfficeFloorCompiler
.propertyNameValues
- Listing of name/value pairs that comprise the properties for theSupplierSource
.- Returns:
- Loaded
SupplierType
.
-
-