Return-Path: list-help: list-unsubscribe: List-Post: List-Id: Mailing-List: contact cactus-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list cactus-user@jakarta.apache.org Received: (qmail 10276 invoked from network); 12 Mar 2004 03:44:09 -0000 Received: from unknown (HELO tama5.ecl.ntt.co.jp) (129.60.39.102) by daedalus.apache.org with SMTP; 12 Mar 2004 03:44:09 -0000 Received: from vcs3.rdh.ecl.ntt.co.jp (vcs3.rdh.ecl.ntt.co.jp [129.60.39.110]) by tama5.ecl.ntt.co.jp (8.12.11/8.12.11) with ESMTP id i2C3i3X9018145; Fri, 12 Mar 2004 12:44:14 +0900 (JST) Received: from mfs3.rdh.ecl.ntt.co.jp (localhost [127.0.0.1]) by vcs3.rdh.ecl.ntt.co.jp (8.12.11/8.12.11) with ESMTP id i2C3i2ZY021270; Fri, 12 Mar 2004 12:44:03 +0900 (JST) Received: from mfs3.rdh.ecl.ntt.co.jp (localhost [127.0.0.1]) by mfs3.rdh.ecl.ntt.co.jp (8.12.11/8.12.11) with ESMTP id i2C3i2kl013769; Fri, 12 Mar 2004 12:44:02 +0900 (JST) Received: from nttmail3.ecl.ntt.co.jp ([129.60.39.100]) by mfs3.rdh.ecl.ntt.co.jp (8.12.11/8.12.11) with ESMTP id i2C3i1wA013766; Fri, 12 Mar 2004 12:44:02 +0900 (JST) Received: from dmailsv1.y.ecl.ntt.co.jp (dmailsv1.y.ecl.ntt.co.jp [129.60.53.14]) by nttmail3.ecl.ntt.co.jp (8.12.11/8.12.11) with ESMTP id i2C3i1gF022732; Fri, 12 Mar 2004 12:44:01 +0900 (JST) Received: from mailsv01.y.ecl.ntt.co.jp by dmailsv1.y.ecl.ntt.co.jp (8.12.11/dmailsv-1.1c) with ESMTP id i2C3i0X1019519; Fri, 12 Mar 2004 12:44:00 +0900 (JST) Received: from localhost by mailsv01.y.ecl.ntt.co.jp (8.12.11/Lab-1.2a) with ESMTP id i2C3i0Aw011498; Fri, 12 Mar 2004 12:44:00 +0900 (JST) Date: Fri, 12 Mar 2004 12:45:54 +0900 (JST) Message-Id: <20040312.124554.78707337.suguri.kazuhito@lab.ntt.co.jp> To: cactus-user@jakarta.apache.org, vmassol@pivolis.com Subject: Re: Cactus/test name is null From: Kazuhito SUGURI In-Reply-To: <016f01c4034e$49ce5d50$2502a8c0@vma> References: <4049042B.3000608@rogers.com> <016f01c4034e$49ce5d50$2502a8c0@vma> X-Mailer: Mew version 3.3 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Fri_Mar_12_12:45:54_2004_162)--" Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ----Next_Part(Fri_Mar_12_12:45:54_2004_162)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi Vincent, In article <016f01c4034e$49ce5d50$2502a8c0@vma>, Sat, 6 Mar 2004 08:40:25 +0100, "Vincent Massol" wrote: vmassol> Yep, I had the same thought. Also cactus could check for the static vmassol> keyword in testXXX. Just need to find some time. If anyone wants to vmassol> submit a patch... I had some time yesterday. Appending is a patch against AbstractCactusTestCase.java, v 1.7. I'm not sure if its feature is what you are looking for. Also, I'm not sure why the static keyword check is needed. Would you mind explaining a little further, please? # better to change cactus-dev ML? Regards, ---- Kazuhito SUGURI mailto:suguri.kazuhito@lab.ntt.co.jp ----Next_Part(Fri_Mar_12_12:45:54_2004_162)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename=patch --- framework/src/java/share/org/apache/cactus/AbstractCactusTestCase.java.orig 2004-02-29 17:56:38.000000000 +0900 +++ framework/src/java/share/org/apache/cactus/AbstractCactusTestCase.java 2004-03-11 19:38:33.000000000 +0900 @@ -26,6 +26,7 @@ import org.apache.cactus.configuration.ConfigurationInitializer; import org.apache.cactus.internal.client.ClientTestCaseCaller; import org.apache.cactus.internal.server.ServerTestCaseCaller; +import org.apache.cactus.util.JUnitVersionHelper; /** * Base class for all Cactus test case extensions. @@ -120,6 +121,7 @@ */ public void runBare() throws Throwable { + checkTestCaseImplementation(); runBareClient(); } @@ -211,4 +213,25 @@ throw t; } } + + /** + * check if the Test to run is properly implemented or not. + * + * @exception Throwable if the Test has no TestCase name. + */ + private void checkTestCaseImplementation() throws Throwable + { + Test test = getServerCaller().getWrappedTest(); + if (test == null) + { + test = this; + } + + if (JUnitVersionHelper.getTestCaseName(test) == null) + { + throw new Error("No test name found. The test [" + + test.getClass().getName() + + "] is not properly implemented."); + } + } } ----Next_Part(Fri_Mar_12_12:45:54_2004_162)----