Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 65682 invoked from network); 16 Mar 2007 09:21:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Mar 2007 09:21:33 -0000 Received: (qmail 17196 invoked by uid 500); 16 Mar 2007 09:21:39 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 17165 invoked by uid 500); 16 Mar 2007 09:21:39 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 17066 invoked by uid 99); 16 Mar 2007 09:21:39 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Mar 2007 02:21:39 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Mar 2007 02:21:30 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2BAE9714089 for ; Fri, 16 Mar 2007 02:21:10 -0700 (PDT) Message-ID: <26041840.1174036870176.JavaMail.jira@brutus> Date: Fri, 16 Mar 2007 02:21:10 -0700 (PDT) From: "Richard Liang (JIRA)" To: commits@harmony.apache.org Subject: [jira] Resolved: (HARMONY-3400) [classlib][luni] Add testcase for ObjectInputStream's resolveObject(Object) function In-Reply-To: <20554498.1173945429219.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-3400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Richard Liang resolved HARMONY-3400. ------------------------------------ Resolution: Fixed Hello Sean, The patch has been applied at revision r518898 with minor modifications, thanks a lot for this enhancement. Best regards, Richard > [classlib][luni] Add testcase for ObjectInputStream's resolveObject(Object) function > ------------------------------------------------------------------------------------ > > Key: HARMONY-3400 > URL: https://issues.apache.org/jira/browse/HARMONY-3400 > Project: Harmony > Issue Type: Improvement > Components: Classlib > Environment: ubuntu > Reporter: Sean Qiu > Assigned To: Richard Liang > Attachments: Harmony-3400.diff > > > Add missing test case for java.io.ObjectInputStream#resolveObject(Object) > Exist testcase only test the subclass' resolveObject rather than testing the super one. > --------- Add test in ObjectInputStreamTest.java--------------------- > static class ObjectInputStreamWithResolveObject extends ObjectInputStream { > public ObjectInputStreamWithResolveObject(InputStream in) throws IOException { > super(in); > enableResolveObject(true); > } > > protected Object resolveObject(Object obj) throws IOException { > if(obj instanceof Integer){ > obj = new Integer(1000); > } > return super.resolveObject(obj); > } > } > > /** > * @tests java.io.ObjectInputStream#resolveObject(Object) > */ > public void test_resolveObjectLjava_lang_Object() throws Exception { > // Write an Integer object into memory > Integer original = new Integer(10); > ByteArrayOutputStream baos = new ByteArrayOutputStream(); > ObjectOutputStream oos = new ObjectOutputStream(baos); > oos.writeObject(original); > oos.flush(); > oos.close(); > // Read the object from memory > byte[] bytes = baos.toByteArray(); > ByteArrayInputStream bais = new ByteArrayInputStream(bytes); > ObjectInputStreamWithResolveObject ois = > new ObjectInputStreamWithResolveObject(bais); > Integer actual = (Integer) ois.readObject(); > ois.close(); > // object should be resolved from 10 to 1000 > assertEquals(new Integer(1000), actual); > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.