Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 2643 invoked from network); 14 Mar 2007 17:44:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Mar 2007 17:44:17 -0000 Received: (qmail 9217 invoked by uid 500); 14 Mar 2007 17:44:20 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 9188 invoked by uid 500); 14 Mar 2007 17:44:20 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 9177 invoked by uid 99); 14 Mar 2007 17:44:19 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Mar 2007 10:44:19 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lists@nabble.com designates 72.21.53.35 as permitted sender) Received: from [72.21.53.35] (HELO talk.nabble.com) (72.21.53.35) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Mar 2007 10:44:07 -0700 Received: from [72.21.53.38] (helo=jubjub.nabble.com) by talk.nabble.com with esmtp (Exim 4.50) id 1HRXVr-0001UG-CU for user@ant.apache.org; Wed, 14 Mar 2007 10:43:47 -0700 Message-ID: <9479688.post@talk.nabble.com> Date: Wed, 14 Mar 2007 10:43:47 -0700 (PDT) From: SHANKAR S To: user@ant.apache.org Subject: Re: [SEC=UNCLASSIFIED] Junit test fails in ant but not in Eclipse In-Reply-To: <3AB568CCAC1BCA49AF26F838D0BD3DD7DF351A@esealmw104.eemea.ericsson.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: shankar.sathiamurthi@gmail.com References: <3AB568CCAC1BCA49AF26F838D0BD3DD7DF351A@esealmw104.eemea.ericsson.se> X-Virus-Checked: Checked by ClamAV on apache.org Hi, Your best bet is to debug it with Eclipse but NOT using the Eclipse junit tool. Change the ant junit target, add these jvmargs to the junit target Here I am using 8787 port for debugging which should be a free port on your machine. When the ant reaches this task, it will wait (because suspend=y), now from Eclipse, launch a "Remote Java Application" debug with Connection Properties set as localhost and 8787. Set breakpoints wherever required. Hope this helps! Mikael Petterson (KI/EAB) wrote: > > Hi, > > I run a junit test ( junit 3.8.1 in both) in Eclipse it works just fine. > Then I run the test in Ant using: > > > fork="on" failureproperty="junit_test_failed" forkmode="perBatch"> > > value="-Demma.coverage.out.file=${coverage.dir}/coverage.emma" /> > > > > > > > > > > > > > > > > > > > > > > > > The test fails with an NullPointerException. > > How are junit tests executed in ant? > > Anyone knows if the jvm is restarted per suite or something. Since there > must be differences in what objects are still in the environment. > All ideas and hints are greatly appreciated! > > Cheers, > > //mikael > > -- View this message in context: http://www.nabble.com/Junit-test-fails-in-ant-but-not-in-Eclipse-tf3361400.html#a9479688 Sent from the Ant - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org