java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.external.services.testTools.TestOperations

public class TestOperations extends Object
A class which provides supporting functionalities mainly for writing unit tests.
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
  • Constructor Details

    • TestOperations

      public TestOperations()
  • Method Details

    • setContainsSameContent

      public static boolean setContainsSameContent(Set s1, Set s2)
      Checks whether two sets contain the same contents.
      Parameters:
      s1 - Set 1
      s2 - Set 2
      Returns:
      True if the content of the sets is equal, else false.
    • isSameStringArray

      public static boolean isSameStringArray(String[] array_1, String[] array_2)
      Checks whether two string arrays contain the same contents.
      Parameters:
      array_1 - Array 1.
      array_2 - Array 2.
      Returns:
      True if the content of the arrays is equal, else false.
    • isSameDoubleArray

      public static boolean isSameDoubleArray(double[] array_1, double[] array_2)
      Checks whether two double arrays contain the same contents.
      Parameters:
      array_1 - Array 1.
      array_2 - Array 2.
      Returns:
      True if the content of the arrays is equal, else false.
    • isSameDoubleArray

      public static boolean isSameDoubleArray(Double[] array_1, Double[] array_2)
      Checks whether two double arrays contain the same contents.
      Parameters:
      array_1 - Array 1.
      array_2 - Array 2.
      Returns:
      True if the content of the arrays is equal, else false.
    • isSameArrayContent

      public static boolean isSameArrayContent(String[] array_1, String[] array_2)
      Checks whether the String components within the two given arrays are equal. The position of the elements does not matter.
      Parameters:
      array_1 - Array 1.
      array_2 - Array 2.
      Returns:
      True if the content of the arrays is equal, else false.
    • printStringArray

      private void printStringArray(String[] stringArray)
      Prints the contents of a String Array.
      Parameters:
      stringArray - The String Array to be printed.
    • getStringKeyFromResourceBundle

      public static String getStringKeyFromResourceBundle(String resourceBundle, String key)
      Returns the key from the specified resource bundle.
      Parameters:
      resourceBundle - The resource bundle name.
      key - The key to be looked up.
      Returns:
      Null if nothing was found or if there was an Exception - else value as String.
    • getKeyFromConfigFiles

      public static String getKeyFromConfigFiles(String key)
      Retrieves a string value from "local_config.properties" and if the key is not found there from "config.properties".
      Parameters:
      key - The key to be used.
      Returns:
      String value if value found in one of the two properties files, else null.
    • deletePersistenceDirectory

      public static void deletePersistenceDirectory()
      Delete the persistence directory.