Class OfficeLoaderUtil
- java.lang.Object
-
- net.officefloor.compile.test.office.OfficeLoaderUtil
-
public class OfficeLoaderUtil extends java.lang.ObjectUtility class for testing anOfficeSource.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OfficeArchitectcreateOfficeArchitect(java.lang.String officeSourceClassName)Creates theOfficeArchitectto create the expectedOfficeType.static OfficeArchitectcreateOfficeArchitect(OfficeSource officeSource)Creates theOfficeArchitectto create the expectedOfficeType.static java.lang.StringgetClassPathLocation(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 theClassLoaderof theOfficeSourceclass andClassLoaderConfigurationContextto 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 theOfficeTypevia 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 theOfficeSourceSpecificationfor theOfficeSource.
-
-
-
Method Detail
-
validateSpecification
public static <O extends OfficeSource> PropertyList validateSpecification(java.lang.Class<O> officeSourceClass, java.lang.String... propertyNameLabels)
Validates theOfficeSourceSpecificationfor theOfficeSource.- Type Parameters:
O-OfficeSourcetype.- Parameters:
officeSourceClass-OfficeSourceclass.propertyNameLabels- Listing of name/label pairs for thePropertyinstances.- 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 theTestCaseinstance.resourceName- Name of the resource.- Returns:
- Class path location of the resource.
-
createOfficeArchitect
public static OfficeArchitect createOfficeArchitect(java.lang.String officeSourceClassName)
Creates theOfficeArchitectto create the expectedOfficeType.- Parameters:
officeSourceClassName-OfficeSourceclass name.- Returns:
OfficeArchitect.
-
createOfficeArchitect
public static OfficeArchitect createOfficeArchitect(OfficeSource officeSource)
Creates theOfficeArchitectto create the expectedOfficeType.- Parameters:
officeSource-OfficeSourceinstance.- 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 theOfficeTypevia an offset object to locate theOffice.- Type Parameters:
O-OfficeSourcetype.- Parameters:
architect-OfficeArchitectcontaining the expectedOfficeType.officeSourceClass-OfficeSourceclass.offsetClass- Class indicating the package that the resource is within. Typically this will be theTestCaseinstance.resourceName- Name of the resource for theOfficelocation.propertyNameValuePairs-Propertyname/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-OfficeSourcetype.- Parameters:
architect-OfficeArchitectcontaining the expectedOfficeType.officeSourceClass-OfficeSourceclass.officeLocation- Location of theOffice.propertyNameValuePairs-Propertyname/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 theClassLoaderof theOfficeSourceclass andClassLoaderConfigurationContextto load theOfficeType.- Type Parameters:
O-OfficeSourcetype.- Parameters:
officeSourceClass-OfficeSourceclass.officeLocation- Location of theOffice.propertyNameValuePairs-Propertyname/value listing.- Returns:
OfficeType.
-
-