Class SectionLoaderUtil
java.lang.Object
net.officefloor.compile.test.section.SectionLoaderUtil
Utility class for testing a
SectionSource.- Author:
- Daniel Sagenschneider
-
Method Summary
Modifier and TypeMethodDescriptionstatic SectionTypebuildSectionType(SectionDesigner designer) Builds theSectionTypefor theSectionDesigner.static SectionDesignerstatic SectionTypeBuilderCreates theSectionTypeBuilder.static StringgetClassPathLocation(Class<?> offsetClass, String resourceName) Convenience method to obtain the class path location.static <S extends SectionSource>
OfficeSectionTypeloadOfficeSectionType(String sectionName, Class<S> sectionSourceClass, String sectionLocation, String... propertyNameValuePairs) Convenience method to load theOfficeSectionType.static <S extends SectionSource>
SectionTypeloadSectionType(Class<S> sectionSourceClass, String sectionLocation, String... propertyNameValuePairs) Convenience method to load theSectionType.static SectionTypeloadSectionType(SectionSource sectionSource, String sectionLocation, String... propertyNameValuePairs) Convenience method to load theSectionType.static <S extends SectionSource>
voidvalidateOfficeSection(SectionDesigner designer, Class<S> sectionSourceClass, String sectionLocation, String... propertyNameValuePairs) Convenience method that validates the loadedOfficeSectionagainst expectedOfficeSectionfrom theSectionDesigner.static <S extends SectionSource>
voidvalidateSection(SectionDesigner designer, Class<S> sectionSourceClass, Class<?> offsetClass, String resourceName, String... propertyNameValuePairs) Facade method to validate theSectionTypeandOfficeSection.static <S extends SectionSource>
voidvalidateSection(SectionDesigner designer, Class<S> sectionSourceClass, String sectionLocation, String... propertyNameValuePairs) Convenience method that validates both the loadedSectionTypeandOfficeSectionagainst expectedSectionType/OfficeSectionfrom theSectionDesigner.static <S extends SectionSource>
voidvalidateSectionType(SectionDesigner designer, Class<S> sectionSourceClass, String sectionLocation, String... propertyNameValuePairs) Convenience method that validates the loadedSectionTypeagainst expectedSectionTypefrom theSectionDesigner.static voidvalidateSectionType(SectionDesigner designer, SectionType actualSection) Validates theSectionType.static voidvalidateSectionType(SectionDesigner designer, SectionSource sectionSource, String sectionLocation, String... propertyNameValuePairs) Convenience method that validates the loadedSectionTypeagainst expectedSectionTypefrom theSectionDesigner.static <S extends SectionSource>
PropertyListvalidateSpecification(Class<S> sectionSourceClass, String... propertyNameLabels) Validates theSectionSourceSpecificationfor theSectionSource.static PropertyListvalidateSpecification(SectionSource sectionSource, String... propertyNameLabels) Validates theSectionSourceSpecificationfor theSectionSource.
-
Method Details
-
validateSpecification
public static <S extends SectionSource> PropertyList validateSpecification(Class<S> sectionSourceClass, 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, String... propertyNameLabels) Validates theSectionSourceSpecificationfor theSectionSource.- Parameters:
sectionSource-SectionSource.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 theAssertinstance.resourceName- Name of the resource.- Returns:
- Class path location of the resource.
-
createSectionDesigner
- Returns:
SectionDesigner.
-
createSectionTypeBuilder
Creates theSectionTypeBuilder.- Returns:
SectionTypeBuilder.
-
buildSectionType
Builds theSectionTypefor theSectionDesigner.- Parameters:
designer-SectionDesigner.- Returns:
SectionType.
-
validateSection
public static <S extends SectionSource> void validateSection(SectionDesigner designer, Class<S> sectionSourceClass, Class<?> offsetClass, String resourceName, 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, Class<S> sectionSourceClass, String sectionLocation, 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, String sectionLocation, 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, Class<S> sectionSourceClass, String sectionLocation, 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
Validates theSectionType.- Parameters:
designer-SectionDesignercontaining the expectedSectionType.actualSection- ActualSectionTypeto validate.
-
validateOfficeSection
public static <S extends SectionSource> void validateOfficeSection(SectionDesigner designer, Class<S> sectionSourceClass, String sectionLocation, 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(Class<S> sectionSourceClass, String sectionLocation, 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, String sectionLocation, 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(String sectionName, Class<S> sectionSourceClass, String sectionLocation, 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.
-