Class TestCaseLM

java.lang.Object
com.compomics.util.junit.TestCaseLM

public class TestCaseLM
extends Object
This TestCase extension contains some useful methods for loading Properties files from the classpath and getting general files' full name or an InputStream from the classpath.
Author:
Lennart Martens
  • Method Details

    • getPropertiesFile

      public static Properties getPropertiesFile​(String aFilename) throws IllegalArgumentException
      This method will read a Properties file from the current ClassLoader and return a Properties instance with the Properties from the file.
      Note: if this doesn't succeed, it'll throw an IllegalArgumentException with some information.
      Parameters:
      aFilename - String with the filename to locate.
      Returns:
      Properties instance with the props (or IllegalArgumentException if the specified file was not found in the classpath!)
      Throws:
      IllegalArgumentException
    • getFullFilePath

      public static String getFullFilePath​(String aFilename)
      This method finds a file from the current classpath and attempts to reconstruct its full filename. It should work on UNIX as well as Windows platforms.
      Note that a file that is not found results in an IllegalArgumentException with a message.
      Parameters:
      aFilename - String with the filename to locate.
      Returns:
      String with the full pathname for the file or an IllegalArgumentException if the file was not found in the classpath.