Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 86222 invoked from network); 17 Jan 2006 12:11:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Jan 2006 12:11:05 -0000 Received: (qmail 92108 invoked by uid 500); 17 Jan 2006 12:10:36 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 92029 invoked by uid 500); 17 Jan 2006 12:10:35 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 91998 invoked by uid 99); 17 Jan 2006 12:10:35 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jan 2006 04:10:35 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=RCVD_IN_SORBS_WEB,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 217.158.94.220 is neither permitted nor denied by domain of t.p.ellison@gmail.com) Received: from [217.158.94.220] (HELO cirrus.purplecloud.com) (217.158.94.220) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jan 2006 04:10:34 -0800 Received: (qmail 44613 invoked from network); 17 Jan 2006 12:10:12 +0000 Received: from blueice2n1.uk.ibm.com (HELO ?9.20.183.163?) (195.212.29.75) by smtp.purplecloud.net with (DHE-RSA-AES256-SHA encrypted) SMTP; 17 Jan 2006 12:10:12 +0000 Message-ID: <43CCDEA3.4080702@gmail.com> Date: Tue, 17 Jan 2006 12:10:11 +0000 From: Tim Ellison User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: [jira] Commented: (HARMONY-31) Move peformance timing of unit tests into a decorator class. References: <1535375202.1137473444286.JavaMail.jira@ajax.apache.org> In-Reply-To: <1535375202.1137473444286.JavaMail.jira@ajax.apache.org> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Why not use java.util.logging? Regards, Tim Mikhail Loenko (JIRA) wrote: > [ http://issues.apache.org/jira/browse/HARMONY-31?page=comments#action_12362910 ] > > Mikhail Loenko commented on HARMONY-31: > --------------------------------------- > > This is not what I meant. > > I was going to create a Logger class at this point like this: > > public class Logger { > public static boolean printAllowed = false; > public static void log(String message) { > if (printAllowed) System.out.print(message); > } > public static void logln(String message) { > if (printAllowed) System.out.println(message); > } > public static void logError(String message) { > if (printAllowed) System.err.print(message); > } > public static void loglnError(String message) { > if (printAllowed) System.err.println(message); > } > } > > And replace log() with Logger.log() everywhere in the tests. > > All the remaining functionality in the PerformanceTest is obsolete. > > >> Move peformance timing of unit tests into a decorator class. >> ------------------------------------------------------------ >> >> Key: HARMONY-31 >> URL: http://issues.apache.org/jira/browse/HARMONY-31 >> Project: Harmony >> Type: Improvement >> Reporter: George Harley >> Assignee: Geir Magnusson Jr >> Priority: Minor >> Attachments: PerfDecorator.java >> >> There has been some low-level discussion on the dev mailing list recently about the inclusion of performance-related logging code near the top of a unit test class inheritance hierarchy (see com.openintel.drl.security.test.PerformanceTest in the HARMONY-16 contribution). This particular issue suggests an alternative way of adding in timing code but without making it the responsibility of the unit tests themselves and without the need to introduce a class in the inheritance hierarchy. >> The basic approach is to exploit the junit.extensions.TestDecorator type in the JUnit API to add in timing behaviour before and after each test method runs. This will be demonstrated with some simple sample code. > -- Tim Ellison (t.p.ellison@gmail.com) IBM Java technology centre, UK.