X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2Ftest%2FTestCase.java;h=0479370f64df57bc5e27a809ee706b0908005f85;hp=4e7d3800c5a588bf6a1b06f341bfc5d3c2c8c2ac;hb=72648e757f648cd152bc00dfb83f895260f037a0;hpb=b6af2a6f8ec1f1963f6d33db0f8708b3a9cf3341 diff --git a/src/be/nikiroo/utils/test/TestCase.java b/src/be/nikiroo/utils/test/TestCase.java index 4e7d380..0479370 100644 --- a/src/be/nikiroo/utils/test/TestCase.java +++ b/src/be/nikiroo/utils/test/TestCase.java @@ -38,6 +38,15 @@ abstract public class TestCase { this.name = name; } + /** + * This constructor can be used if you require a no-param constructor. In + * this case, you are allowed to set the name manually via + * {@link TestCase#setName}. + */ + protected TestCase() { + this("no name"); + } + /** * Setup the test (called before the test is run). * @@ -65,6 +74,20 @@ abstract public class TestCase { return name; } + /** + * The test name. + * + * @param name + * the new name (internal use only) + * + * @return this (so we can chain and so we can initialize it in a member + * variable if this is an anonymous inner class) + */ + protected TestCase setName(String name) { + this.name = name; + return this; + } + /** * Actually do the test. *