Return-Path: Delivered-To: apmail-tapestry-users-archive@www.apache.org Received: (qmail 69753 invoked from network); 4 Dec 2008 20:24:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Dec 2008 20:24:13 -0000 Received: (qmail 23489 invoked by uid 500); 4 Dec 2008 20:24:21 -0000 Delivered-To: apmail-tapestry-users-archive@tapestry.apache.org Received: (qmail 23467 invoked by uid 500); 4 Dec 2008 20:24:21 -0000 Mailing-List: contact users-help@tapestry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tapestry users" Delivered-To: mailing list users@tapestry.apache.org Received: (qmail 23455 invoked by uid 99); 4 Dec 2008 20:24:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 12:24:21 -0800 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of hlship@gmail.com designates 64.233.170.188 as permitted sender) Received: from [64.233.170.188] (HELO rn-out-0910.google.com) (64.233.170.188) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 20:22:50 +0000 Received: by rn-out-0910.google.com with SMTP id i50so3557790rne.11 for ; Thu, 04 Dec 2008 12:23:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Tp2l1Xss4Q2xvh36RrSKh/Md/FTl5gURvHfFhLM6h8Y=; b=cbqa+ubyBtiR2yLin4tHENVVhXvSKm4c8wvfvMRXJ8mjKcwsmhfoRLNZlhY7HuQ3kq RH69EcbRXTNm7cj21y9XnYiEdQej01FHrDyQ+dp+48rijewx8ez0eV7MSTHkhTs6pGnT Z3WPq+DAUVtFoS3J4wnbTrkBnKCZdVBjJr4QA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=Phw74Y0uCbfF1ZLZoaleop9xs3WeSh8VohVo5BqsVi4ULlVrLRdX8QEvc1AyROCsml URmRO659iVKAsp3Wsr29wG4rqLgFCRDp1loLaHpd1APxReIhUccyAmDBza/fapraCLT7 hlcXX052g6RXRi8pFcwPe3uVHZdJKXspbqnqo= Received: by 10.151.112.10 with SMTP id p10mr220468ybm.29.1228422207855; Thu, 04 Dec 2008 12:23:27 -0800 (PST) Received: by 10.151.155.8 with HTTP; Thu, 4 Dec 2008 12:23:27 -0800 (PST) Message-ID: Date: Thu, 4 Dec 2008 12:23:27 -0800 From: "Howard Lewis Ship" To: "Tapestry users" Subject: Re: IoC registry survives between JUnit tests? In-Reply-To: <27A88558-770B-4546-9AEB-4BCF43F617B0@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20828078.post@talk.nabble.com> <27A88558-770B-4546-9AEB-4BCF43F617B0@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org I use a mix of techniques, using a lot of mocks for true unit tests, but also a lot of integration tests. I'm not sure what CEG has actually seen here; Registry.shutdown() is very dramatic, it tears apart the registry (releasing almost everything to the GC) and informs all of the proxies to shutdown as well. Could he just be missing the re-creation of the services in later tests ... Registry startup is very, very fast once all the underlying classes are instantiated. On Thu, Dec 4, 2008 at 12:04 PM, Christian Edward Gruber wrote: > FYI, in general, you shouldn't be using the container in your tests, unless > you're testing the wiring itself. You should be creating the > component/service under test, and constructing it with fakes. This isn't > absolute but there is a lot more effort/configuration/overhead if you want > to use the container infrastructure in your unit test, and you start to have > subtle interactions that might potentially make it more of an integration > test. You risk testing more than one thing at a time. > > Christian > > On 4-Dec-08, at 01:28 , Stephan Schwab wrote: > >> >> Hi! >> >> I have several JUnit tests that instantiate >> org.apache.tapestry5.ioc.Registry via the RegistryBuilder before tests >> run. >> Now I'm observing that services registered in one test are still available >> in other tests although I did call registry.shutdown(). My test runner >> does >> not fork a new JVM. >> >> Calling registry.shutdown() should cause everything to vanish. Is there >> anything that causes one-registry-per-JVM? >> >> Stephan >> >> >> >> ----- >> -- >> http://www.caimito.net - Caimito One Team - Agile Collaboration and >> Planning >> tool >> http://www.stephan-schwab.com - Personal blog >> http://code.google.com/p/tapestry-sesame - Authentication extension for >> Tapestry 5 >> >> -- >> View this message in context: >> http://www.nabble.com/IoC-registry-survives-between-JUnit-tests--tp20828078p20828078.html >> Sent from the Tapestry - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org >> For additional commands, e-mail: users-help@tapestry.apache.org >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org > For additional commands, e-mail: users-help@tapestry.apache.org > > -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org For additional commands, e-mail: users-help@tapestry.apache.org