From cf53bf4bf516053b13ebeeb001641f5fffa5b0f0 Mon Sep 17 00:00:00 2001 From: Scokart Gilles Date: Sat, 31 Jan 2009 14:36:57 +0000 Subject: [PATCH] Give access to project name so that it can be used in junit adapter git-svn-id: https://svn.apache.org/repos/asf/ant/antlibs/antunit/trunk@739564 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/ant/antunit/AntUnitScriptRunner.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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.