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.TestWatcherDeprecated.As of version 3.4.0, it is advised to work with JUnit5 tests which do not use rules but extensionsMojoExtensioninstead.Junit4 testRuleto extract and assert test resources.- Since:
- 3.1.0
-
-
Constructor Summary
Constructors Constructor Description TestResources()Deprecated.TestResources(java.lang.String projectsDir, java.lang.String workDir)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidassertDirectoryContents(java.io.File dir, java.lang.String... expectedPaths)Deprecated.static voidassertFileContents(java.io.File basedir, java.lang.String expectedPath, java.lang.String actualPath)Deprecated.static voidcp(java.io.File basedir, java.lang.String from, java.lang.String to)Deprecated.static voidcreate(java.io.File basedir, java.lang.String... paths)Deprecated.java.io.FilegetBasedir(java.lang.String project)Deprecated.Creates new clean copy of test project directory structure.static voidrm(java.io.File basedir, java.lang.String path)Deprecated.protected voidstarting(org.junit.runner.Description d)Deprecated.static voidtouch(java.io.File file)Deprecated.static voidtouch(java.io.File basedir, java.lang.String path)Deprecated.
-
-
-
Method Detail
-
starting
protected void starting(org.junit.runner.Description d)
Deprecated.- Overrides:
startingin classorg.junit.rules.TestWatcher
-
getBasedir
public java.io.File getBasedir(java.lang.String project) throws java.io.IOExceptionDeprecated.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:
java.io.IOException
-
cp
public static void cp(java.io.File basedir, java.lang.String from, java.lang.String to) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
assertFileContents
public static void assertFileContents(java.io.File basedir, java.lang.String expectedPath, java.lang.String actualPath) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
assertDirectoryContents
public static void assertDirectoryContents(java.io.File dir, java.lang.String... expectedPaths)Deprecated.
-
touch
public static void touch(java.io.File basedir, java.lang.String path) throws java.lang.InterruptedExceptionDeprecated.- Throws:
java.lang.InterruptedException
-
touch
public static void touch(java.io.File file) throws java.lang.InterruptedExceptionDeprecated.- Throws:
java.lang.InterruptedException
-
rm
public static void rm(java.io.File basedir, java.lang.String path)Deprecated.
-
create
public static void create(java.io.File basedir, java.lang.String... paths) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException- Since:
- 3.2.0
-
-