Class TestResources

java.lang.Object
org.junit.rules.TestWatcher
org.apache.maven.plugin.testing.resources.TestResources
All Implemented Interfaces:
org.junit.rules.TestRule

@Deprecated public class TestResources extends org.junit.rules.TestWatcher
Deprecated.
As of version 3.4.0, it is advised to work with JUnit5 tests which do not use rules but extensions MojoExtension instead.
Junit4 test Rule to extract and assert test resources.
Since:
3.1.0
  • Constructor Details

    • TestResources

      public TestResources()
      Deprecated.
    • TestResources

      public TestResources(String projectsDir, String workDir)
      Deprecated.
  • Method Details

    • starting

      protected void starting(org.junit.runner.Description d)
      Deprecated.
      Overrides:
      starting in class org.junit.rules.TestWatcher
    • getBasedir

      public File getBasedir(String project) throws IOException
      Deprecated.
      Creates new clean copy of test project directory structure. The copy is named after both the test being executed and test project name, which allows the same test project can be used by multiple tests and by different instances of the same parametrized tests.

      TODO Provide alternative working directory naming for Windows, which still limits path names to ~250 charecters

      Throws:
      IOException
    • cp

      public static void cp(File basedir, String from, String to) throws IOException
      Deprecated.
      Throws:
      IOException
    • assertFileContents

      public static void assertFileContents(File basedir, String expectedPath, String actualPath) throws IOException
      Deprecated.
      Throws:
      IOException
    • assertDirectoryContents

      public static void assertDirectoryContents(File dir, String... expectedPaths)
      Deprecated.
    • touch

      public static void touch(File basedir, String path) throws InterruptedException
      Deprecated.
      Throws:
      InterruptedException
    • touch

      public static void touch(File file) throws InterruptedException
      Deprecated.
      Throws:
      InterruptedException
    • rm

      public static void rm(File basedir, String path)
      Deprecated.
    • create

      public static void create(File basedir, String... paths) throws IOException
      Deprecated.
      Throws:
      IOException
      Since:
      3.2.0