Return-Path: Delivered-To: apmail-hadoop-avro-dev-archive@minotaur.apache.org Received: (qmail 29093 invoked from network); 4 May 2009 19:16:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 May 2009 19:16:43 -0000 Received: (qmail 25771 invoked by uid 500); 4 May 2009 19:16:43 -0000 Delivered-To: apmail-hadoop-avro-dev-archive@hadoop.apache.org Received: (qmail 25723 invoked by uid 500); 4 May 2009 19:16:43 -0000 Mailing-List: contact avro-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: avro-dev@hadoop.apache.org Delivered-To: mailing list avro-dev@hadoop.apache.org Received: (qmail 25713 invoked by uid 99); 4 May 2009 19:16:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 May 2009 19:16:43 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [216.145.54.172] (HELO mrout2.yahoo.com) (216.145.54.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 May 2009 19:16:33 +0000 Received: from [192.168.102.135] (snvvpn1-10-73-152-c189.hq.corp.yahoo.com [10.73.152.189]) by mrout2.yahoo.com (8.13.6/8.13.6/y.out) with ESMTP id n44JFuAi009670 for ; Mon, 4 May 2009 12:15:56 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; s=serpent; d=yahoo-inc.com; c=nofws; q=dns; h=message-id:date:from:user-agent:mime-version:to:subject: references:in-reply-to:content-type:content-transfer-encoding; b=mtSDnApfkAor06FtvGrDuX6A8fWpxnsL0thD2nHu1HR8UHgC0FNgCSvHFFs6DXIg Message-ID: <49FF3EEC.6020607@yahoo-inc.com> Date: Mon, 04 May 2009 12:15:56 -0700 From: Konstantin Boudnik User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: "avro-dev@hadoop.apache.org" Subject: Re: TestNG in Avro [Was: Code reorg] References: <49E36A04.7010509@apache.org> <837B3A0B-5039-4B32-9E29-CD5A1A7457E4@yahoo-inc.com> <49F9195F.3030608@yahoo-inc.com> <49FF33CE.5090504@apache.org> <49FF3B76.8070706@yahoo-inc.com> In-Reply-To: <49FF3B76.8070706@yahoo-inc.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org It turns out that the issues were caused by this inheritance public class TestProtocolReflect extends TestProtocolSpecific where TestProtocolSpecific was declaring testStartServer() method as @BeforeMethod and TestProtocolReflect has it has just @Test When using @Before.../@After annotations the overall number of tests was reduced to 34 from 42 because none of @Before.../@After accounted as tests anymore. Resolved and new patch is submitted. Review is highly welcomed! :-) Cos Konstantin Boudnik wrote: > Thanks for the info, Doug. > > The failures were caused by these two issues: > - the presence of generated Test interface which was clashing with > org.testng.annotations.Test. To work around the problem I have renamed > test.js to generated.js and refactored all code, which has been affected > by this > - RPC testing sequence as you've described below. After I've realized > that certain tests require a server to be started upfront the rest of > exercise was a breeze. I've put inter tests dependencies so the > testStartServer() would be always called before any of the test methods > is started. > > Both of these modifications are included into the AVRO-26 patch. > > Just now I have thought and tried another approached to guarantee > execution sequence for RPC tests: I've added @BeforeMethod and > @AfterMethod annotations to testStartServer() and testStopServer() > respectively and removed hardcoded inter-tests dependencies. This > approach has worked for at least two complex test classes: > TestProtocolGeneric and TestFsData. In TestProtocolSpecific class > this approach failed and I'll take a look to find out why it is so. > > I think technically AVRO is ready to be switched to TestNG for all > current java tests are converted into the new framework. > > Cos > > Doug Cutting wrote: >> Konstantin Boudnik wrote: >>> 1) Complete test conversion using provided JUnitConverter. For a >>> number of reasons it failed to work. One of the possible reasons my >>> insufficient TestNG skills. Another possible reason is relative >>> complexity of the tests, which is above JUnitConverter level of intellect. >> How did it fail? >> >> Most of the tests don't push JUnit very hard and should be trivial. The >> only one's that I'd expect to be a problem are the RPC tests. I tried >> to use JUnit's setup/teardown methods to start and stop the daemon, but >> could not get that to work for some reason. I ended up doing something >> pretty ugly, which is, in each class, adding an initial test method that >> starts a daemon, and a final one that kills the daemon, and a bunch in >> between that use the daemon for tests. So perhaps the problem is >> related to this, e.g., perhaps JUnitConverter doesn't run tests in the >> right order or somesuch. >> >> Doug >