Return-Path: Delivered-To: apmail-incubator-chukwa-user-archive@www.apache.org Received: (qmail 71589 invoked from network); 6 Dec 2010 18:52:10 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Dec 2010 18:52:10 -0000 Received: (qmail 45433 invoked by uid 500); 6 Dec 2010 18:52:10 -0000 Delivered-To: apmail-incubator-chukwa-user-archive@incubator.apache.org Received: (qmail 45374 invoked by uid 500); 6 Dec 2010 18:52:09 -0000 Mailing-List: contact chukwa-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: chukwa-user@incubator.apache.org Delivered-To: mailing list chukwa-user@incubator.apache.org Received: (qmail 45367 invoked by uid 99); 6 Dec 2010 18:52:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Dec 2010 18:52:09 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of billgraham@gmail.com designates 74.125.82.175 as permitted sender) Received: from [74.125.82.175] (HELO mail-wy0-f175.google.com) (74.125.82.175) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Dec 2010 18:52:04 +0000 Received: by wyb40 with SMTP id 40so12570333wyb.6 for ; Mon, 06 Dec 2010 10:51:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:reply-to :in-reply-to:references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=5FYwATTVrz2m4Jk3VlAPLp5W7JYeAZf7MGA0zUNCUY8=; b=VoFcL0frtUN3zrbJZoZsaenhw75cFLx+Cc+DNm6xYL37u5f4n4CyOUGBml3g/EZ1Vz jSHvkmM6h/W641BKTLrWlvxokNrscnWdbPwPpgnHv1btdQ3BIbqUka9sW6N2hJ/BpM3v zfnWjoxhPmkOE9kokWDVI0w+P8AEI8mDpV/io= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:content-type:content-transfer-encoding; b=T8NAljVp++X+QbyFEDfrppIFSwTVvKRsNoABFzxQdhA+whCt6j8m9JJ+D6DMNA82nS IlMQ8Ui92xa4N2nGapa+m9cLclB+RD/zZc4+qwidWoO4AprKJ+lms99/w+F4botD/z/K mDB0ywGljqiCCW5I4vcr4LJHhf+0gfwX9xsVA= Received: by 10.216.180.76 with SMTP id i54mr393103wem.33.1291661503202; Mon, 06 Dec 2010 10:51:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.74.20 with HTTP; Mon, 6 Dec 2010 10:51:22 -0800 (PST) Reply-To: billgraham@gmail.com In-Reply-To: References: From: Bill Graham Date: Mon, 6 Dec 2010 10:51:22 -0800 Message-ID: Subject: Re: Why system.exit() present in Demux.java To: chukwa-user@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I'm not sure why System.exit get's called but I suspect someone had a use case to know the return status of the process. If that's causing problems with unit tests, you could have your unit test call Demux.run(String[] args) directly. On Fri, Dec 3, 2010 at 12:51 AM, Stuti Awasthi wrote: > Hi all, > > I am facing issues while executing Junit test cases for my custom process= or. > This is what I have done : > > > > =B7=A0=A0=A0=A0=A0=A0=A0=A0 I have created my own processor class extende= d from > AbstractProcessor.java. > > =B7=A0=A0=A0=A0=A0=A0=A0=A0 For testing I wrote the Junit test class and = passed .done file > location and output directory location to Demux.main() > > =B7=A0=A0=A0=A0=A0=A0=A0=A0 Demux class run and successfully executes my = custom processor > > =B7=A0=A0=A0=A0=A0=A0=A0=A0 Convert .done to .evt file in output director= y as desired. > > > > Issue : Code of Demux.main() class : > > > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 public static void main(Str= ing[] args) throws Exception { > > =A0=A0=A0 int res =3D ToolRunner.run(new Configuration(), new Demux(), ar= gs); > > =A0=A0=A0 System.exit(res); > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0} > > > > After converting .done file to .evt file , Demux class end the process by > System.exit() command due to which control is not returned to my JUnit te= st > class. Because of this the control is not reaching my assertion and testc= ase > is not successful. > > > > Questions > > =B7=A0=A0=A0=A0=A0=A0=A0=A0 I want to know why we have this System.exit()= in Demux.java class > ? > > =B7=A0=A0=A0=A0=A0=A0=A0=A0 Is there any way I can execute my testcase su= ccessfully ? Have any > one tested processor classes given by chukwa ? Eg : Syslog, TsProcessor e= tc > > =B7=A0=A0=A0=A0=A0=A0=A0=A0 Since Demux is a daemon which runs continuous= ly . So does > everytime this demux class is called for every .done file ? > > > > Please Suggest > > > > Thanks > > Stuti Awasthi > > DISCLAIMER =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This e-mail may contain privile= ged and confidential > information which is the property of Persistent Systems Ltd. It is intend= ed > only for the use of the individual or entity to which it is addressed. If > you are not the intended recipient, you are not authorized to read, retai= n, > copy, print, distribute or use this message. If you have received this > communication in error, please notify the sender and delete all copies of > this message. Persistent Systems Ltd. does not accept any liability for > virus infected mails.