Class FermenterMDATestUtil
java.lang.Object
org.technologybrewery.fermenter.mda.test.utils.FermenterMDATestUtil
Utility class that provides reading and retrieving profile.json and targets.json specific testing
to help ease creating cucumber unit test for fermenter resource generation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisGeneratorOnClassPath(org.technologybrewery.fermenter.mda.element.Target target) check if Generator file class exist on Classpath.static booleanisTemplateFileExist(org.technologybrewery.fermenter.mda.element.Target target, String baseDirectory) check if template file exist on a given target.static org.apache.commons.lang3.tuple.Pair<Map<String,org.technologybrewery.fermenter.mda.element.ExpandedProfile>, Map<String, org.technologybrewery.fermenter.mda.element.Target>> readProfilesAndTargetFile(File profilesFile, File targetsFile) Loads all Profiles and Targets Map on given profiles.json and target.json file.readProfilesFile(File profilesFile) Loads all Profiles Map on given profiles.json file.readTargetsFile(File targetsFile) Loads all Targets Map on given target.json file.retrieveMissingProfiles(org.technologybrewery.fermenter.mda.element.ExpandedProfile profile, List<String> profileReferences) Returns missing profile References on a given Profile and specified profileReferences.retriveMissingTargets(org.technologybrewery.fermenter.mda.element.ExpandedProfile profile, List<String> targetReferences) Returns missing target References on a given Profile and specified TargetReferences,
-
Constructor Details
-
FermenterMDATestUtil
public FermenterMDATestUtil()
-
-
Method Details
-
readProfilesAndTargetFile
public static org.apache.commons.lang3.tuple.Pair<Map<String,org.technologybrewery.fermenter.mda.element.ExpandedProfile>, readProfilesAndTargetFileMap<String, org.technologybrewery.fermenter.mda.element.Target>> (File profilesFile, File targetsFile) throws IOException Loads all Profiles and Targets Map on given profiles.json and target.json file.- Parameters:
profilesFile-Filereferencing profiles.json file desired to load.targetsFile-Filereferencing targets.json file desired to load.- Returns:
Paircontaining Profile Map and Targets Map, key being name of profile and target respectively. Left Pair is Profile Map and Right Pair is Target Map.- Throws:
IOException
-
readProfilesFile
public static Map<String,org.technologybrewery.fermenter.mda.element.ExpandedProfile> readProfilesFile(File profilesFile) throws IOException Loads all Profiles Map on given profiles.json file.- Parameters:
profilesFile-Filereferencing profiles.json file desired to load.- Returns:
MapProfile Map key being name of profile and value being ExpandedProfile object.- Throws:
IOException
-
readTargetsFile
public static Map<String,org.technologybrewery.fermenter.mda.element.Target> readTargetsFile(File targetsFile) throws IOException Loads all Targets Map on given target.json file.- Parameters:
targetsFile-Filereferencing targets.json file desired to load.- Returns:
MapTarget Map key being name of target and value being Target object.- Throws:
IOException
-
retriveMissingTargets
public static List<String> retriveMissingTargets(org.technologybrewery.fermenter.mda.element.ExpandedProfile profile, List<String> targetReferences) Returns missing target References on a given Profile and specified TargetReferences, -
retrieveMissingProfiles
public static List<String> retrieveMissingProfiles(org.technologybrewery.fermenter.mda.element.ExpandedProfile profile, List<String> profileReferences) Returns missing profile References on a given Profile and specified profileReferences. -
isTemplateFileExist
public static boolean isTemplateFileExist(org.technologybrewery.fermenter.mda.element.Target target, String baseDirectory) check if template file exist on a given target.- Parameters:
target-Targetreferencing target to inspect.baseDirectory-StringBase Directory of template file.- Returns:
- boolean Return Whether template file on a given target exists.
-
isGeneratorOnClassPath
public static boolean isGeneratorOnClassPath(org.technologybrewery.fermenter.mda.element.Target target) check if Generator file class exist on Classpath.- Parameters:
target-Targetreferencing target to inspect.- Returns:
- boolean Return Whether generator class on a given target exists and loaded.
-