Return-Path: Delivered-To: apmail-commons-dev-archive@www.apache.org Received: (qmail 35480 invoked from network); 5 Jan 2009 04:01:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Jan 2009 04:01:24 -0000 Received: (qmail 79337 invoked by uid 500); 5 Jan 2009 04:01:22 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 79250 invoked by uid 500); 5 Jan 2009 04:01:22 -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 79239 invoked by uid 99); 5 Jan 2009 04:01:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Jan 2009 20:01:22 -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 rahul.akolkar@gmail.com designates 74.125.78.144 as permitted sender) Received: from [74.125.78.144] (HELO ey-out-1920.google.com) (74.125.78.144) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jan 2009 04:01:14 +0000 Received: by ey-out-1920.google.com with SMTP id 4so720713eyg.60 for ; Sun, 04 Jan 2009 20:00:53 -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:mime-version:content-type:content-transfer-encoding :content-disposition; bh=vTXzGYZez8GEJSUDXNaR015UW+oTMiPz38YyQl5hGY8=; b=IP80L6KAn4vJUkcjqhTPGcM5CTyNkcaFJPAkxgnqjMQ24DQGXuZP5VHjJOhXWjgFR/ k3g8cYlSrn37vMp8Ybt5mHfoNr4Viq+JViEzY24twHCYtL4iQm6h6H7jYtoro+f4sEzQ qIx2w1sWqmXHug4BfHKmX8FFQmLWyyJ4CTsOU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=rt55kp0XDrXNdhSriofDxoeBqJDUaLqYqD89pMk9s3cHWmae1/Pp5Pn7vAYAIhBFdv I1lM5SGyvV/KmdtrTRasABFZuogM1ikn8UjwfLUslOpA5hFdFf3I1ObTLVtz3wVyj35U JmsVV53JbO8vzXZcrkyyRQAH9xcmzMdgErU5k= Received: by 10.210.59.14 with SMTP id h14mr9630381eba.16.1231128053942; Sun, 04 Jan 2009 20:00:53 -0800 (PST) Received: by 10.210.53.9 with HTTP; Sun, 4 Jan 2009 20:00:53 -0800 (PST) Message-ID: Date: Sun, 4 Jan 2009 23:00:53 -0500 From: "Rahul Akolkar" To: dev@commons.apache.org Subject: Re: [SCXML] svn commit: r731387 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org On Sun, Jan 4, 2009 at 6:36 PM, wrote: > Author: sebb > Date: Sun Jan 4 15:36:29 2009 > New Revision: 731387 > > URL: http://svn.apache.org/viewvc?rev=731387&view=rev > Log: > Remove try/catch blocks for Exceptions that are not expected in testing > > Modified: > commons/proper/scxml/branches/J6/src/test/java/org/apache/commons/scxml/SCXMLTestHelper.java > The two changes below to treat NSEs as test errors are probably OK, given that most JDKs 1.6 and above seem to use a sensible DOM implementation (and general XML support). The same doesn't hold for this class in trunk, however. -Rahul > > - public static SCXML testModelSerializability(final SCXML scxml) { > + public static SCXML testModelSerializability(final SCXML scxml) throws Exception { > File fileDir = new File(SERIALIZATION_DIR); > if (!fileDir.exists() && !fileDir.mkdir()) { > System.err.println("SKIPPED SERIALIZATION: Failed directory creation"); > @@ -293,29 +259,18 @@ > String filename = SERIALIZATION_FILE_PREFIX > + getSequenceNumber() + SERIALIZATION_FILE_SUFFIX; > SCXML roundtrip = null; > - try { > - ObjectOutputStream out = > - new ObjectOutputStream(new FileOutputStream(filename)); > - out.writeObject(scxml); > - out.close(); > - ObjectInputStream in = > - new ObjectInputStream(new FileInputStream(filename)); > - roundtrip = (SCXML) in.readObject(); > - in.close(); > - } catch (NotSerializableException nse) { > - // nodes failed serialization > - System.err.println("SERIALIZATION ERROR: The DOM implementation" > - + " in use is not serializable"); > - return scxml; > - } catch(IOException ex) { > - throw new RuntimeException(ex); > - } catch(ClassNotFoundException ex) { > - throw new RuntimeException(ex); > - } > + ObjectOutputStream out = > + new ObjectOutputStream(new FileOutputStream(filename)); > + out.writeObject(scxml); > + out.close(); > + ObjectInputStream in = > + new ObjectInputStream(new FileInputStream(filename)); > + roundtrip = (SCXML) in.readObject(); > + in.close(); > return roundtrip; > } > > - public static SCXMLExecutor testExecutorSerializability(final SCXMLExecutor exec) { > + public static SCXMLExecutor testExecutorSerializability(final SCXMLExecutor exec) throws Exception { > File fileDir = new File(SERIALIZATION_DIR); > if (!fileDir.exists() && !fileDir.mkdir()) { > System.err.println("SKIPPED SERIALIZATION: Failed directory creation"); > @@ -324,26 +279,14 @@ > String filename = SERIALIZATION_FILE_PREFIX > + getSequenceNumber() + SERIALIZATION_FILE_SUFFIX; > SCXMLExecutor roundtrip = null; > - try { > - ObjectOutputStream out = > - new ObjectOutputStream(new FileOutputStream(filename)); > - out.writeObject(exec); > - out.close(); > - ObjectInputStream in = > - new ObjectInputStream(new FileInputStream(filename)); > - roundtrip = (SCXMLExecutor) in.readObject(); > - in.close(); > - } catch (NotSerializableException nse) { > - // nodes failed serialization, test cases do not add > - // other non-serializable context data > - System.err.println("SERIALIZATION ERROR: The DOM implementation" > - + " in use is not serializable"); > - return exec; > - } catch(IOException ex) { > - throw new RuntimeException(ex); > - } catch(ClassNotFoundException ex) { > - throw new RuntimeException(ex); > - } > + ObjectOutputStream out = > + new ObjectOutputStream(new FileOutputStream(filename)); > + out.writeObject(exec); > + out.close(); > + ObjectInputStream in = > + new ObjectInputStream(new FileInputStream(filename)); > + roundtrip = (SCXMLExecutor) in.readObject(); > + in.close(); > return roundtrip; > } > > @@ -355,4 +298,3 @@ > } > > } > - > > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org