Class OfficeLoaderUtil
java.lang.Object
net.officefloor.compile.test.office.OfficeLoaderUtil
Utility class for testing an
OfficeSource.- Author:
- Daniel Sagenschneider
-
Method Summary
Modifier and TypeMethodDescriptionstatic OfficeArchitectcreateOfficeArchitect(String officeSourceClassName) Creates theOfficeArchitectto create the expectedOfficeType.static OfficeArchitectcreateOfficeArchitect(OfficeSource officeSource) Creates theOfficeArchitectto create the expectedOfficeType.static StringgetClassPathLocation(Class<?> offsetClass, String resourceName) Convenience method to obtain the class path location.static <O extends OfficeSource>
OfficeTypeloadOfficeType(Class<O> officeSourceClass, String officeLocation, String... propertyNameValuePairs) Convenience method to use theClassLoaderof theOfficeSourceclass andClassLoaderConfigurationContextto load theOfficeType.static <O extends OfficeSource>
OfficeTypevalidateOffice(OfficeArchitect architect, Class<O> officeSourceClass, Class<?> offsetClass, String resourceName, String... propertyNameValuePairs) Convenience method to validate theOfficeTypevia an offset object to locate theOffice.static <O extends OfficeSource>
OfficeTypevalidateOffice(OfficeArchitect architect, Class<O> officeSourceClass, String officeLocation, String... propertyNameValuePairs) static <O extends OfficeSource>
PropertyListvalidateSpecification(Class<O> officeSourceClass, String... propertyNameLabels) Validates theOfficeSourceSpecificationfor theOfficeSource.
-
Method Details
-
validateSpecification
public static <O extends OfficeSource> PropertyList validateSpecification(Class<O> officeSourceClass, String... propertyNameLabels) Validates theOfficeSourceSpecificationfor theOfficeSource.- Type Parameters:
O-OfficeSourcetype.- Parameters:
officeSourceClass-OfficeSourceclass.propertyNameLabels- Listing of name/label pairs for thePropertyinstances.- Returns:
- Loaded
PropertyList.
-
getClassPathLocation
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
Creates theOfficeArchitectto create the expectedOfficeType.- Parameters:
officeSourceClassName-OfficeSourceclass name.- Returns:
OfficeArchitect.
-
createOfficeArchitect
Creates theOfficeArchitectto create the expectedOfficeType.- Parameters:
officeSource-OfficeSourceinstance.- Returns:
OfficeArchitect.
-
validateOffice
public static <O extends OfficeSource> OfficeType validateOffice(OfficeArchitect architect, Class<O> officeSourceClass, Class<?> offsetClass, String resourceName, 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, Class<O> officeSourceClass, String officeLocation, 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(Class<O> officeSourceClass, String officeLocation, 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.
-