Constant.java 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package de.jplag.endToEndTesting.constants;
  2. import java.nio.file.Path;
  3. /**
  4. * All constant values that are needed in the test cases or helper classes.
  5. *
  6. */
  7. public final class Constant {
  8. private Constant() {
  9. // private constructor to prevent instantiation
  10. }
  11. /**
  12. * Empty string to be able to query possible empty return values.
  13. */
  14. public static final String EMPTY_STRING = "";
  15. /**
  16. * Name for the folder to copy the submissions to in order to test them with
  17. * JPlag
  18. */
  19. public static final String TEMPORARY_DIRECTORY_NAME = "submission";
  20. /**
  21. * Identifier to find the system specific temporary directory.
  22. */
  23. private static final String TEMPORARY_SYSTEM_DIRECTORY = "java.io.tmpdir";
  24. /**
  25. * Create the complete path to the submission files. Here the temporary system
  26. * path is extended with the "TEMPORARY_DIRECTORY_NAME", which is predefined in
  27. * this class.
  28. */
  29. public static final String TEMPORARY_SUBMISSION_DIRECTORY_NAME = Path
  30. .of(System.getProperty(TEMPORARY_SYSTEM_DIRECTORY), TEMPORARY_DIRECTORY_NAME).toString();
  31. /**
  32. * Base path to the created plagiarism and the main file located in the project resources.
  33. */
  34. public static final Path BASE_PATH_TO_JAVA_RESOURCES_SORTALGO = Path.of("src", "test", "resources", "java",
  35. "sortAlgo");
  36. /**
  37. * Base path to the saved results of the previous tests in a *.json file
  38. */
  39. public static final Path BASE_PATH_TO_JAVA_RESULT_JSON = Path.of("src", "test", "resources", "results",
  40. "javaResult.json");
  41. }