Class TestContext

java.lang.Object
org.silverpeas.kernel.test.TestContext

public class TestContext extends Object
Context of a unit test. Used to access the information of the context of such a test. This class can be extended to add other information required by unit tests for their execution.
Author:
mmoquillon
  • Method Details

    • getInstance

      public static TestContext getInstance()
    • getMavenProperties

      public Properties getMavenProperties()
      Gets the properties of the project with which the unit test is configured.
      Returns:
      the Maven properties
    • getPathOfTestResources

      public Path getPathOfTestResources()
      Gets the path of the directory in which are located the resources available to the unit test during its execution.
      Returns:
      the path of the test resources root directory.
    • getPathOfBuildDirectory

      public Path getPathOfBuildDirectory()
      Gets the path of the directory into which are build the source code of the project and into which the resources of the project are also copied. This doesn't concern the test code and the test resources; please see getPathOfTestResources() for that.
      Returns:
      the path of the project build directory.
    • getLoggerRootHomePath

      public Path getLoggerRootHomePath()
      Gets the path of the directory in which are located the logger configuration files that are available to the unit test during its execution.
      Returns:
      the path of the logger configurations root directory.