Return-Path: Delivered-To: apmail-beehive-dev-archive@www.apache.org Received: (qmail 37442 invoked from network); 17 Jan 2006 20:55:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 Jan 2006 20:55:37 -0000 Received: (qmail 11998 invoked by uid 500); 17 Jan 2006 20:55:36 -0000 Delivered-To: apmail-beehive-dev-archive@beehive.apache.org Received: (qmail 11980 invoked by uid 500); 17 Jan 2006 20:55:36 -0000 Mailing-List: contact dev-help@beehive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Beehive Developers" Delivered-To: mailing list dev@beehive.apache.org Received: (qmail 11965 invoked by uid 99); 17 Jan 2006 20:55:35 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jan 2006 12:55:35 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of chad.schoettger@gmail.com designates 66.249.82.193 as permitted sender) Received: from [66.249.82.193] (HELO xproxy.gmail.com) (66.249.82.193) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jan 2006 12:55:34 -0800 Received: by xproxy.gmail.com with SMTP id h28so2724460wxd for ; Tue, 17 Jan 2006 12:55:14 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=A02upCKR9sYMIRA6Usjx5x8+++9MMkUFB8lQVCB9hcMVE8HRd7dK8/VY1+0ZIuen+cLfKVo8RLQqbzgQ2WUS0C3gH+P/TU0pLLo7v6PcMRBEeGbkV4z4K6nVaZo6CLuFlHfEDDXrbafcDYB3SlJmqre6kcSmPUwRz9anyOt3AIo= Received: by 10.70.14.6 with SMTP id 6mr8339105wxn; Tue, 17 Jan 2006 12:55:13 -0800 (PST) Received: by 10.70.10.6 with HTTP; Tue, 17 Jan 2006 12:55:12 -0800 (PST) Message-ID: Date: Tue, 17 Jan 2006 13:55:13 -0700 From: Chad Schoettger To: Beehive Developers Subject: Control serialization tests... MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_107488_2929994.1137531313568" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_107488_2929994.1137531313568 Content-Type: multipart/alternative; boundary="----=_Part_107489_20069516.1137531313568" ------=_Part_107489_20069516.1137531313568 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I have just started writing some controls serialization tests and have come up with a couple of questions about the expected behavior of a control bein= g serialized/deserialized. 1) When a control is deserialized should it receive an 'onCreate' event? The behavior I am seeing is that this event is not being sent to the control. 2) When I try to serialize a control whose impl contains a reference to ResourceContext, the serialization fails due to a 'NotSerializiable' exception for the ResourceContextImpl class. This doesn't seem right. Here's the code from my test (I've also attached all relevant files) perhap= s I am not serializing the control properly (it seems like the proper method though). Any thoughts /comments from the list are appreciated. @Control private ControlSerialization _serializationControl; public void testSimpleSerialization1() throws Exception { assertNotNull(_serializationControl); _serializationControl.setControlState(6); _serializationControl.clearLifecycleEvents(); // serialize the contents of the ctcc ObjectOutputStream oos =3D new ObjectOutputStream(new FileOutputStream("sertest.tmp")); ControlContainerContext ccc =3D getControlContainerContext(); ControlTestContainerContext ctcc =3D (ControlTestContainerContext)c= cc; ctcc.writeChildren(oos); oos.close(); // change the control state of the in-memory control, sanity check _serializationControl.setControlState(2); // deserialize the ctcc contents ObjectInputStream ois =3D new ObjectInputStream(new FileInputStream= (" sertest.tmp")); ctcc.readChildren(ois); ois.close(); // now find the value of the deserialized control in the ctcc Object[] ctrls =3D ctcc.toArray(); ControlSerialization deserializedControl =3D null; for (Object c : ctrls) { if (c instanceof ControlSerializationBean && !c.equals(_serializationControl)) { deserializedControl =3D (ControlSerialization)c; break; } } assertNotNull(deserializedControl); assertEquals(6, deserializedControl.getControlState()); } ------=_Part_107489_20069516.1137531313568 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I have just started writing some controls serialization tests and have come up with a couple of questions about the expected behavior of a control being serialized/deserialized.

1) When a control is deserialized should it receive an 'onCreate' event?  The behavior I am seeing is that this event is not being sent to the control.

2) When I try to serialize a control whose impl contains a reference to ResourceContext, the serialization fails due to a 'NotSerializiable' exception for the ResourceContextImpl class.  This doesn't seem right.

Here's the code from my test (I've also attached all relevant files) perhaps I am not serializing the control properly (it seems like the proper method though).  Any thoughts /comments from the list are appreciated.

     @Control
    private ControlSerialization _serializationControl;

    public void testSimpleSerialization1() throws Exception = {
        assertNotNull(_serializationCont= rol);

        _serializationControl.setControl= State(6);
        _serializationControl.clearLifec= ycleEvents();

        // serialize the contents of the= ctcc
        ObjectOutputStream oos =3D new O= bjectOutputStream(new FileOutputStream("sertest.tmp"));
        ControlContainerContext ccc =3D = getControlContainerContext();
        ControlTestContainerContext ctcc= =3D (ControlTestContainerContext)ccc;
        ctcc.writeChildren(oos);
        oos.close();

        // change the control state of t= he in-memory control, sanity check
        _serializationControl.setControl= State(2);

        // deserialize the ctcc contents=
        ObjectInputStream ois =3D new Ob= jectInputStream(new FileInputStream("sertest.tmp"));
        ctcc.readChildren(ois);
        ois.close();

        // now find the value of the des= erialized control in the ctcc
        Object[] ctrls =3D ctcc.toArray(= );
        ControlSerialization deserialize= dControl =3D null;
        for (Object c : ctrls) {
            if (c instanceof ControlSerializationBean && !c.equals(_serializationControl)) {
            &nb= sp;   deserializedControl =3D (ControlSerialization)c;
            &nb= sp;   break;
            }
        }

        assertNotNull(deserializedContro= l);
        assertEquals(6, deserializedCont= rol.getControlState());
    }
------=_Part_107489_20069516.1137531313568-- ------=_Part_107488_2929994.1137531313568--