Class OfficeLoaderUtil
- java.lang.Object
-
- net.officefloor.compile.test.office.OfficeLoaderUtil
-
public class OfficeLoaderUtil extends java.lang.Object
Utility class for testing anOfficeSource
.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OfficeArchitect
createOfficeArchitect(java.lang.String officeSourceClassName)
Creates theOfficeArchitect
to create the expectedOfficeType
.static OfficeArchitect
createOfficeArchitect(OfficeSource officeSource)
Creates theOfficeArchitect
to create the expectedOfficeType
.static java.lang.String
getClassPathLocation(java.lang.Class<?> offsetClass, java.lang.String resourceName)
Convenience method to obtain the class path location.static <O extends OfficeSource>
OfficeTypeloadOfficeType(java.lang.Class<O> officeSourceClass, java.lang.String officeLocation, java.lang.String... propertyNameValuePairs)
Convenience method to use theClassLoader
of theOfficeSource
class andClassLoaderConfigurationContext
to load theOfficeType
.static <O extends OfficeSource>
OfficeTypevalidateOffice(OfficeArchitect architect, java.lang.Class<O> officeSourceClass, java.lang.Class<?> offsetClass, java.lang.String resourceName, java.lang.String... propertyNameValuePairs)
Convenience method to validate theOfficeType
via an offset object to locate theOffice
.static <O extends OfficeSource>
OfficeTypevalidateOffice(OfficeArchitect architect, java.lang.Class<O> officeSourceClass, java.lang.String officeLocation, java.lang.String... propertyNameValuePairs)
static <O extends OfficeSource>
PropertyListvalidateSpecification(java.lang.Class<O> officeSourceClass, java.lang.String... propertyNameLabels)
Validates theOfficeSourceSpecification
for theOfficeSource
.
-
-
-
Method Detail
-
validateSpecification
public static <O extends OfficeSource> PropertyList validateSpecification(java.lang.Class<O> officeSourceClass, java.lang.String... propertyNameLabels)
Validates theOfficeSourceSpecification
for theOfficeSource
.- Type Parameters:
O
-OfficeSource
type.- Parameters:
officeSourceClass
-OfficeSource
class.propertyNameLabels
- Listing of name/label pairs for theProperty
instances.- Returns:
- Loaded
PropertyList
.
-
getClassPathLocation
public static java.lang.String getClassPathLocation(java.lang.Class<?> offsetClass, java.lang.String resourceName)
Convenience method to obtain the class path location.- Parameters:
offsetClass
- Class indicating the package that the resource is within. Typically this will be theTestCase
instance.resourceName
- Name of the resource.- Returns:
- Class path location of the resource.
-
createOfficeArchitect
public static OfficeArchitect createOfficeArchitect(java.lang.String officeSourceClassName)
Creates theOfficeArchitect
to create the expectedOfficeType
.- Parameters:
officeSourceClassName
-OfficeSource
class name.- Returns:
OfficeArchitect
.
-
createOfficeArchitect
public static OfficeArchitect createOfficeArchitect(OfficeSource officeSource)
Creates theOfficeArchitect
to create the expectedOfficeType
.- Parameters:
officeSource
-OfficeSource
instance.- Returns:
OfficeArchitect
.
-
validateOffice
public static <O extends OfficeSource> OfficeType validateOffice(OfficeArchitect architect, java.lang.Class<O> officeSourceClass, java.lang.Class<?> offsetClass, java.lang.String resourceName, java.lang.String... propertyNameValuePairs)
Convenience method to validate theOfficeType
via an offset object to locate theOffice
.- Type Parameters:
O
-OfficeSource
type.- Parameters:
architect
-OfficeArchitect
containing the expectedOfficeType
.officeSourceClass
-OfficeSource
class.offsetClass
- Class indicating the package that the resource is within. Typically this will be theTestCase
instance.resourceName
- Name of the resource for theOffice
location.propertyNameValuePairs
-Property
name/value listings.- Returns:
OfficeType
.
-
validateOffice
public static <O extends OfficeSource> OfficeType validateOffice(OfficeArchitect architect, java.lang.Class<O> officeSourceClass, java.lang.String officeLocation, java.lang.String... propertyNameValuePairs)
- Type Parameters:
O
-OfficeSource
type.- Parameters:
architect
-OfficeArchitect
containing the expectedOfficeType
.officeSourceClass
-OfficeSource
class.officeLocation
- Location of theOffice
.propertyNameValuePairs
-Property
name/value listings.- Returns:
OfficeType
.
-
loadOfficeType
public static <O extends OfficeSource> OfficeType loadOfficeType(java.lang.Class<O> officeSourceClass, java.lang.String officeLocation, java.lang.String... propertyNameValuePairs)
Convenience method to use theClassLoader
of theOfficeSource
class andClassLoaderConfigurationContext
to load theOfficeType
.- Type Parameters:
O
-OfficeSource
type.- Parameters:
officeSourceClass
-OfficeSource
class.officeLocation
- Location of theOffice
.propertyNameValuePairs
-Property
name/value listing.- Returns:
OfficeType
.
-
-