Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 69538 invoked from network); 5 Jan 2009 22:40:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Jan 2009 22:40:54 -0000 Received: (qmail 65035 invoked by uid 500); 5 Jan 2009 22:40:48 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 64974 invoked by uid 500); 5 Jan 2009 22:40:48 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 64573 invoked by uid 99); 5 Jan 2009 22:40:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jan 2009 14:40:47 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sebbaz@gmail.com designates 209.85.217.16 as permitted sender) Received: from [209.85.217.16] (HELO mail-gx0-f16.google.com) (209.85.217.16) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jan 2009 22:40:39 +0000 Received: by gxk9 with SMTP id 9so5253568gxk.18 for ; Mon, 05 Jan 2009 14:40:17 -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=Ch3kEJRg+DDA9BW8LzKWEIKPZS3s+kQAqLl8KCdJkNk=; b=JxKbK0MtgiScGie2FkSCNqZ8wKZBy8ysNfnU0XSfZRk1a+4KMxeEPxngMW+GNadRjH s0znaLE4O4flqHyqQIW865J23Kn17GAZ0bb5+9q8jCFIwhsFTeceO+pXFGzDIuFMJXPP vtFuWtHnZqSr73Lw2u992zvl0r5JaeltwMWIY= 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=O8S9XHxlX5yuHkKFrwJHy+BTCttInk+nbJPnVjet/aZwhlf2pS56+LgEqXt8LgEDLT aq4/y7ZDAZo9pxaafUQOgEparIOCW6nc6+PD3TGuM/VjTY1gG3umKfFjcs+NUjAVRZSZ bmWwVs7MfLPp9RVHYbW72W5+czjiOSBT7XNZw= Received: by 10.150.133.18 with SMTP id g18mr6518255ybd.247.1231195217799; Mon, 05 Jan 2009 14:40:17 -0800 (PST) Received: by 10.151.130.13 with HTTP; Mon, 5 Jan 2009 14:40:17 -0800 (PST) Message-ID: <25aac9fc0901051440m13202868jf79819f37cc3eab6@mail.gmail.com> Date: Mon, 5 Jan 2009 22:40:17 +0000 From: sebb To: "Commons Developers List" Subject: Re: [SCXML] test should fail if serialisation work dir cannot be created In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <25aac9fc0901050457y4497c58fv77ab96008befebc5@mail.gmail.com> <25aac9fc0901051252r68620833g763a838ed67dd8f4@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org On 05/01/2009, Rahul Akolkar wrote: > On Mon, Jan 5, 2009 at 3:52 PM, sebb wrote: > > On 05/01/2009, Rahul Akolkar wrote: > >> On Mon, Jan 5, 2009 at 7:57 AM, sebb wrote: > >> > SCXMLTestHelper currently allows the test to continue if it cannot > >> > create the serialisation work directory. > >> > > >> > Given that it now fails the test if it cannot create/read the > >> > serialisation files, it seems to me that directory creation failure > >> > should also cause the test to fail. > >> > > >> > WDYT? > >> > > >> > >> > >> > >> Confused by the predicate in 2nd para since in case of NSEs the test continues. > > > > The test does not continue if the file cannot be created/written. > > > >> WRT the directory creation, if you'd rather have the build fail if > >> creation fails, there would ideally be a nice message stating the > >> problem (rather than a generic x failures and y errors kind of thing) > > > > I was thinking of throwing an IOException("Failed to create > > serialisation work directory",e). > > > > However it's going to be a pretty unlikely occurrence - indeed I'm not > > sure why the check is needed at all as failure to create the directory > > would cause an IO error on the file creation which follows. > > > > > > I went looking through the svn log since I don't recollect its > origins, and I think it had to do with failures when running the tests > outside Maven. The only thing I see is cases where we can't assume the > existence of the parent 'target' directory -- which has been fixed by > changing the mkdir() call to mkdirs(). At this point, I agree the > check is not needed. > OK, I'll remove the check then. > >> and additonally, there'd be a build time switch that allows folks to > >> say "we don't care about serialization" which would cause the build to > >> succeed (this could also help the NSE catches you are looking at > >> eliminating -- all NSEs could then cause tests to error out by > >> default). So maybe the approach of providing such a switch helps both > >> cases we're discussing. > > > > Not sure I know how to do that in Maven. Why not do a single test for > > NSE and skip any further serialisation tests if the the initial test > > fails? > > > > > > You mean single JUnit test? That'll cause the build to fail on JDKs > like Sun 1.4 (unless the tests are skipped), which seems suboptimal > given its an optional feature users may not need and an environment > configuration, rather than code, issue. Yes, the idea would be to use a separate JUnit test to probe for the specific NSE error and skip the other tests that would fail. The NSE exceptions would then no longer need to be caught. This would make it much easier to detect other serialisation errors, e.g. if any of the classes are updated in future. There would be no need to check what class was involved - i.e. the present "fragile" check would not be needed. > When I weight the pros and > cons of a build failure vs. current outcome (warnings to console) in > this context, the latter seems better to me. > Now that the test output is shorter, the serialisation warning messages stand out better, but I think NSEs which are not caused by the faulty Sun 1.4 DOM should cause failures. > -Rahul > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org