Class TestFrame

java.lang.Object
eu.bandm.tools.test.TestFrame
Direct Known Subclasses:
TestFrame_messages

public class TestFrame extends Object
Base class with convenience methods for JUnit tests. Currently we are using "junit 4" = https://junit.org/junit4/"
  • Constructor Details

    • TestFrame

      public TestFrame()
  • Method Details

    • filesystemRelativeProjectRoot

      public static String filesystemRelativeProjectRoot(Class cl)
      Assumes that all class source is under "$(PRJ)/src/..." or "$(PRJ)/test".
      Returns:
      the relative path to the root of the project.
    • methodName

      protected String methodName()
    • writeTmpFile

      protected static void writeTmpFile(File testDir, String fileName, String... lines)
      Write the strings into a file with the given name in the given directory, in UTF_8 encoding.
    • writeTmpFile

      protected static File writeTmpFile(String fileName, String... lines)
      Write the string into a file with the given name, in some temp directory.
      Returns:
      the temp directory