diff --git a/src/main/org/apache/ant/antunit/AntUnitScriptRunner.java b/src/main/org/apache/ant/antunit/AntUnitScriptRunner.java index 6af4495..cf207a3 100644 --- a/src/main/org/apache/ant/antunit/AntUnitScriptRunner.java +++ b/src/main/org/apache/ant/antunit/AntUnitScriptRunner.java @@ -205,6 +205,17 @@ public class AntUnitScriptRunner { return testTargets; } + /** + * Provides the name of the active script. + * @pre isAvtive() + */ + public String getName() { + if (!isActive()) { + throw new AssertionError(); + } + return getCurrentProject().getName(); + } + /** * Executes the suiteSetUp target if presents and report any execution error. * Note that if the method return false, you are not allowed to run targets.