Class TestPathHelper


  • public class TestPathHelper
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.io.File resolveClassFile​(java.lang.Class knownClass)
      Essentially the same as resolveRootUrl(Class), but here we convert the root URL to a File (directory) reference.
      static java.io.File resolveRootDirectory​(java.lang.Class knownClass)
      Essentially the same as resolveRootUrl(Class), but here we convert the root URL to a File (directory) reference.
      static java.net.URL resolveRootUrl​(java.lang.Class knownClass)
      Useful in cases where we need to deal with files/resources in the test compilation output dir of the project.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • resolveRootUrl

        public static java.net.URL resolveRootUrl​(java.lang.Class knownClass)
        Useful in cases where we need to deal with files/resources in the test compilation output dir of the project. This gets a reference to the compilation output directory into which the given class was compiled.
        Parameters:
        knownClass - Reference to a Class known to be in the compilation output dir.
        Returns:
        The root URL
      • resolveRootDirectory

        public static java.io.File resolveRootDirectory​(java.lang.Class knownClass)
        Essentially the same as resolveRootUrl(Class), but here we convert the root URL to a File (directory) reference. In fact we delegate to resolveRootUrl(Class) and simply convert its return into a File reference.
        Parameters:
        knownClass - Reference to a Class known to be in the compilation output dir.
        Returns:
        The root directory
      • resolveClassFile

        public static java.io.File resolveClassFile​(java.lang.Class knownClass)
        Essentially the same as resolveRootUrl(Class), but here we convert the root URL to a File (directory) reference. In fact we delegate to resolveRootUrl(Class) and simply convert its return into a File reference.
        Parameters:
        knownClass - Reference to a Class known to be in the compilation output dir.
        Returns:
        The root directory