This project publishes 2 utility classes in Java:
-
'com.kazurayam.unittest.ProjectDirectoryResolver' : This class enables your unit-test class to find the location of "project directory" based on the classpath for the test class rather than depending on the value of
System.property("user.dir")
. This is useful because the System Propertyuser.dir
sometimes moves, therefore is unreliable especially in a Gradle Multi-project build. -
com.kazurayam.unittest.TestOutputOrganizer
: This class finds the location of project directory by callingcom.kazurayam.unittest.ProjectDirectoryResolver
class. Under the project directory, theTestOutputOrganizer
enables your unit-test class to create a directory where your test classes can output arbitrary files. You can askTestOutputOrganizer
to create a directory with name of Fully Qualified Class Name of your unit-test class. Also you can ask it to create a director with name of individual test Method name. TheTestOutputOrganizer
enables your unit-test class to clean the output directory recursively and recreate it.
You can download the jar from the Maven Central repository:
Of course, your build.gradle
file can use it as a dependency, as follows:
repositories {
mavenCentral()
}
dependencies {
testImplementation("com.kazurayam:unittest-helper:0.4.0")
}