Class TestOperations
java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.external.services.testTools.TestOperations
A class which provides supporting functionalities mainly for writing unit tests.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Delete the persistence directory.static String
Retrieves a string value from "local_config.properties" and if the key is not found there from "config.properties".static String
getStringKeyFromResourceBundle
(String resourceBundle, String key) Returns the key from the specified resource bundle.static boolean
isSameArrayContent
(String[] array_1, String[] array_2) Checks whether the String components within the two given arrays are equal.static boolean
isSameDoubleArray
(double[] array_1, double[] array_2) Checks whether two double arrays contain the same contents.static boolean
isSameDoubleArray
(Double[] array_1, Double[] array_2) Checks whether two double arrays contain the same contents.static boolean
isSameStringArray
(String[] array_1, String[] array_2) Checks whether two string arrays contain the same contents.private void
printStringArray
(String[] stringArray) Prints the contents of a String Array.static boolean
setContainsSameContent
(Set s1, Set s2) Checks whether two sets contain the same contents.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
TestOperations
public TestOperations()
-
-
Method Details
-
setContainsSameContent
Checks whether two sets contain the same contents.- Parameters:
s1
- Set 1s2
- Set 2- Returns:
- True if the content of the sets is equal, else false.
-
isSameStringArray
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
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
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
Prints the contents of a String Array.- Parameters:
stringArray
- The String Array to be printed.
-
getStringKeyFromResourceBundle
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
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.
-