Class SectionLoaderUtil
- java.lang.Object
-
- net.officefloor.compile.test.section.SectionLoaderUtil
-
public class SectionLoaderUtil extends java.lang.ObjectUtility class for testing aSectionSource.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SectionTypebuildSectionType(SectionDesigner designer)Builds theSectionTypefor theSectionDesigner.static SectionDesignercreateSectionDesigner()static SectionTypeBuildercreateSectionTypeBuilder()Creates theSectionTypeBuilder.static java.lang.StringgetClassPathLocation(java.lang.Class<?> offsetClass, java.lang.String resourceName)Convenience method to obtain the class path location.static <S extends SectionSource>
OfficeSectionTypeloadOfficeSectionType(java.lang.String sectionName, java.lang.Class<S> sectionSourceClass, java.lang.String sectionLocation, java.lang.String... propertyNameValuePairs)Convenience method to load theOfficeSectionType.static <S extends SectionSource>
SectionTypeloadSectionType(java.lang.Class<S> sectionSourceClass, java.lang.String sectionLocation, java.lang.String... propertyNameValuePairs)Convenience method to load theSectionType.static SectionTypeloadSectionType(SectionSource sectionSource, java.lang.String sectionLocation, java.lang.String... propertyNameValuePairs)Convenience method to load theSectionType.static <S extends SectionSource>
voidvalidateOfficeSection(SectionDesigner designer, java.lang.Class<S> sectionSourceClass, java.lang.String sectionLocation, java.lang.String... propertyNameValuePairs)Convenience method that validates the loadedOfficeSectionagainst expectedOfficeSectionfrom theSectionDesigner.static <S extends SectionSource>
voidvalidateSection(SectionDesigner designer, java.lang.Class<S> sectionSourceClass, java.lang.Class<?> offsetClass, java.lang.String resourceName, java.lang.String... propertyNameValuePairs)Facade method to validate theSectionTypeandOfficeSection.static <S extends SectionSource>
voidvalidateSection(SectionDesigner designer, java.lang.Class<S> sectionSourceClass, java.lang.String sectionLocation, java.lang.String... propertyNameValuePairs)Convenience method that validates both the loadedSectionTypeandOfficeSectionagainst expectedSectionType/OfficeSectionfrom theSectionDesigner.static <S extends SectionSource>
voidvalidateSectionType(SectionDesigner designer, java.lang.Class<S> sectionSourceClass, java.lang.String sectionLocation, java.lang.String... propertyNameValuePairs)Convenience method that validates the loadedSectionTypeagainst expectedSectionTypefrom theSectionDesigner.static voidvalidateSectionType(SectionDesigner designer, SectionType actualSection)Validates theSectionType.static voidvalidateSectionType(SectionDesigner designer, SectionSource sectionSource, java.lang.String sectionLocation, java.lang.String... propertyNameValuePairs)Convenience method that validates the loadedSectionTypeagainst expectedSectionTypefrom theSectionDesigner.static <S extends SectionSource>
PropertyListvalidateSpecification(java.lang.Class<S> sectionSourceClass, java.lang.String... propertyNameLabels)Validates theSectionSourceSpecificationfor theSectionSource.static PropertyListvalidateSpecification(SectionSource sectionSource, java.lang.String... propertyNameLabels)Validates theSectionSourceSpecificationfor theSectionSource.
-
-
-
Method Detail
-
validateSpecification
public static <S extends SectionSource> PropertyList validateSpecification(java.lang.Class<S> sectionSourceClass, java.lang.String... propertyNameLabels)
Validates theSectionSourceSpecificationfor theSectionSource.- Type Parameters:
S-SectionSourcetype.- Parameters:
sectionSourceClass-SectionSourceclass.propertyNameLabels- Listing of name/label pairs for thePropertyinstances.- Returns:
- Loaded
PropertyList.
-
validateSpecification
public static PropertyList validateSpecification(SectionSource sectionSource, java.lang.String... propertyNameLabels)
Validates theSectionSourceSpecificationfor theSectionSource.- Parameters:
sectionSource-SectionSource.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 theAssertinstance.resourceName- Name of the resource.- Returns:
- Class path location of the resource.
-
createSectionDesigner
public static SectionDesigner createSectionDesigner()
- Returns:
SectionDesigner.
-
createSectionTypeBuilder
public static SectionTypeBuilder createSectionTypeBuilder()
Creates theSectionTypeBuilder.- Returns:
SectionTypeBuilder.
-
buildSectionType
public static SectionType buildSectionType(SectionDesigner designer)
Builds theSectionTypefor theSectionDesigner.- Parameters:
designer-SectionDesigner.- Returns:
SectionType.
-
validateSection
public static <S extends SectionSource> void validateSection(SectionDesigner designer, java.lang.Class<S> sectionSourceClass, java.lang.Class<?> offsetClass, java.lang.String resourceName, java.lang.String... propertyNameValuePairs)
Facade method to validate theSectionTypeandOfficeSection.- Type Parameters:
S-SectionSourcetype.- Parameters:
designer-SectionDesignercontaining the expectedSectionType/OfficeSection.sectionSourceClass- Class of theSectionSourcebeing tested.offsetClass- Object indicating the package that the resource is within. Typically this will be theAssertinstance.resourceName- Name of the resource. This is used with theoffsetObjectto determine theOfficeSectionlocation.propertyNameValuePairs- Listing ofPropertyname/value pairs.
-
validateSection
public static <S extends SectionSource> void validateSection(SectionDesigner designer, java.lang.Class<S> sectionSourceClass, java.lang.String sectionLocation, java.lang.String... propertyNameValuePairs)
Convenience method that validates both the loadedSectionTypeandOfficeSectionagainst expectedSectionType/OfficeSectionfrom theSectionDesigner.- Type Parameters:
S-SectionSourcetype.- Parameters:
designer-SectionDesignercontaining the expectedSectionType/OfficeSection.sectionSourceClass- Class of theSectionSourcebeing tested.sectionLocation- Location of theOfficeSection.propertyNameValuePairs- Listing ofPropertyname/value pairs.
-
validateSectionType
public static void validateSectionType(SectionDesigner designer, SectionSource sectionSource, java.lang.String sectionLocation, java.lang.String... propertyNameValuePairs)
Convenience method that validates the loadedSectionTypeagainst expectedSectionTypefrom theSectionDesigner.- Parameters:
designer-SectionDesignercontaining the expectedSectionType.sectionSource-SectionSourceinstance being tested.sectionLocation- Location of theOfficeSection.propertyNameValuePairs- Listing ofPropertyname/value pairs.
-
validateSectionType
public static <S extends SectionSource> void validateSectionType(SectionDesigner designer, java.lang.Class<S> sectionSourceClass, java.lang.String sectionLocation, java.lang.String... propertyNameValuePairs)
Convenience method that validates the loadedSectionTypeagainst expectedSectionTypefrom theSectionDesigner.- Type Parameters:
S-SectionSourcetype.- Parameters:
designer-SectionDesignercontaining the expectedSectionType.sectionSourceClass- Class of theSectionSourcebeing tested.sectionLocation- Location of theOfficeSection.propertyNameValuePairs- Listing ofPropertyname/value pairs.
-
validateSectionType
public static void validateSectionType(SectionDesigner designer, SectionType actualSection)
Validates theSectionType.- Parameters:
designer-SectionDesignercontaining the expectedSectionType.actualSection- ActualSectionTypeto validate.
-
validateOfficeSection
public static <S extends SectionSource> void validateOfficeSection(SectionDesigner designer, java.lang.Class<S> sectionSourceClass, java.lang.String sectionLocation, java.lang.String... propertyNameValuePairs)
Convenience method that validates the loadedOfficeSectionagainst expectedOfficeSectionfrom theSectionDesigner.- Type Parameters:
S-SectionSourcetype.- Parameters:
designer-SectionDesignercontaining the expectedOfficeSection.sectionSourceClass- Class of theSectionSourcebeing tested.sectionLocation- Location of theOfficeSection.propertyNameValuePairs- Listing ofPropertyname/value pairs.
-
loadSectionType
public static <S extends SectionSource> SectionType loadSectionType(java.lang.Class<S> sectionSourceClass, java.lang.String sectionLocation, java.lang.String... propertyNameValuePairs)
Convenience method to load theSectionType. It uses theSectionSourceclass'sClassLoaderand subsequentClassLoaderConfigurationContext.- Type Parameters:
S-SectionSourcetype.- Parameters:
sectionSourceClass- Class of theSectionSource.sectionLocation- Location of theOfficeSection.propertyNameValuePairs- Listing ofPropertyname/value pairs.- Returns:
SectionType.
-
loadSectionType
public static SectionType loadSectionType(SectionSource sectionSource, java.lang.String sectionLocation, java.lang.String... propertyNameValuePairs)
Convenience method to load theSectionType.- Parameters:
sectionSource-SectionSourceinstance.sectionLocation- Location of theOfficeSection.propertyNameValuePairs- Listing ofPropertyname/value pairs.- Returns:
SectionType.
-
loadOfficeSectionType
public static <S extends SectionSource> OfficeSectionType loadOfficeSectionType(java.lang.String sectionName, java.lang.Class<S> sectionSourceClass, java.lang.String sectionLocation, java.lang.String... propertyNameValuePairs)
Convenience method to load theOfficeSectionType. It uses theSectionSourceclass'sClassLoaderand subsequentClassLoaderConfigurationContext.- Type Parameters:
S-SectionSourcetype.- Parameters:
sectionName- Name of theOfficeSection.sectionSourceClass- Class of theSectionSource.sectionLocation- Location of theOfficeSection.propertyNameValuePairs- Listing ofPropertyname/value pairs.- Returns:
OfficeSectionType.
-
-