Class FermenterMDATestUtil

java.lang.Object
org.technologybrewery.fermenter.mda.test.utils.FermenterMDATestUtil

public class FermenterMDATestUtil extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isGeneratorOnClassPath(org.technologybrewery.fermenter.mda.element.Target target)
    check if Generator file class exist on Classpath.
    static boolean
    isTemplateFileExist(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.
    static Map<String,org.technologybrewery.fermenter.mda.element.ExpandedProfile>
    readProfilesFile(File profilesFile)
    Loads all Profiles Map on given profiles.json file.
    static Map<String,org.technologybrewery.fermenter.mda.element.Target>
    readTargetsFile(File targetsFile)
    Loads all Targets Map on given target.json file.
    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.
    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,

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FermenterMDATestUtil

      public FermenterMDATestUtil()
  • Method Details

    • readProfilesAndTargetFile

      public 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) throws IOException
      Loads all Profiles and Targets Map on given profiles.json and target.json file.
      Parameters:
      profilesFile - File referencing profiles.json file desired to load.
      targetsFile - File referencing targets.json file desired to load.
      Returns:
      Pair containing 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 - File referencing profiles.json file desired to load.
      Returns:
      Map Profile 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 - File referencing targets.json file desired to load.
      Returns:
      Map Target 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,
      Parameters:
      profile - ExpandedProfile referencing profile to inspect.
      targetReferences - List list of targetReference to search.
      Returns:
      List Return list of missing targetReferences on a given profile.
    • 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.
      Parameters:
      profile - ExpandedProfile referencing profile to inspect.
      profileReferences - List list of profileReferences to search.
      Returns:
      List Return list of missing profileReferences on a given profile.
    • 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 - Target referencing target to inspect.
      baseDirectory - String Base 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 - Target referencing target to inspect.
      Returns:
      boolean Return Whether generator class on a given target exists and loaded.