Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Nat Pryce (JIRA) <jira-yCVjj/EcxBJg9hUCZPvPmw <at> public.gmane.org>
Subject: [jira] Issue Comment Edited: (JMOCK-224) ExpectationError is Serializable but cannot be Serialized
Newsgroups: gmane.comp.java.jmock.devel
Date: Monday 11th May 2009 21:23:46 UTC (over 7 years ago)
[ http://jira.codehaus.org/browse/JMOCK-224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=175374#action_175374
] 

Nat Pryce edited comment on JMOCK-224 at 5/11/09 4:22 PM:
----------------------------------------------------------

Why do you care? What exactly are you trying to achieve?

The Throwable base class implements Serializable, so we can't make an
ExpectationError non-serializable.  However, it makes no sense to serialize
an ExpectationError because it refers to the Mockery and other information
that is used to diagnose test failures.

      was (Author: npryce):
    Why do you care?

The Throwable base class implements Serializable, so we can't make an
ExpectationError non-serializable.  However, it makes no sense to serialize
an ExpectationError because it refers to the Mockery and other information
that is used to diagnose test failures.
  
> ExpectationError is Serializable but cannot be Serialized
> ---------------------------------------------------------
>
>                 Key: JMOCK-224
>                 URL: http://jira.codehaus.org/browse/JMOCK-224
>             Project: jMock
>          Issue Type: Bug
>          Components: JMock 2.x.x Library
>    Affects Versions: 2.5.1
>            Reporter: Peter Lawrey
>
> In the following test ExpectationError cannot be Serialized as it has a
number of non-transient fields whichc annot be serialized.
> {code:java}
> private static final Mockery MOCKERY = new Mockery();
> public static void test_expectationErrorSerialization() throws
IOException {
>     try {
>         final List list = MOCKERY.mock(List.class);
>         MOCKERY.checking(new Expectations() {{
>             oneOf(list).add(1);
>         }});
>         list.add(2);
>         MOCKERY.assertIsSatisfied();
>     } catch (Throwable e) {
>         assertTrue(e instanceof Serializable);
>         ObjectOutputStream oos = new ObjectOutputStream(new
ByteArrayOutputStream());
>         oos.writeObject(e);
>     }
> }
> {code}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
 
CD: 3ms