You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Berin Loritsch <bl...@apache.org> on 2003/07/11 17:06:42 UTC

FYI: Re: cvs commit: avalon-sandbox/meta/api/src/test/org/apache/avalon/meta/info/test InfoDescriptorTestCase.java

mcconnell@apache.org wrote:

> mcconnell    2003/07/11 07:58:06
> 
>   Added:       meta/api/src/test/org/apache/avalon/meta/info/test
>                         InfoDescriptorTestCase.java
>   Log:
>   InfoDescriptor test-case addition.
>   

<snip/>

Just so you know, the AbstractDescriptorTestCase takse care of testing
serialization, so in your derived test cases, you only have to worry about
testing additional features of the particular descriptor type.

>   
>       public void testSerialization() throws IOException, ClassNotFoundException
>       {
>           File file = new File("name.test");
>           InfoDescriptor original = (InfoDescriptor) getDescriptor();
>           ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file));
>           oos.writeObject(original);
>           oos.close();
>   
>           ObjectInputStream ois = new ObjectInputStream( new FileInputStream(file));
>           InfoDescriptor serialized = (InfoDescriptor)ois.readObject();
>           ois.close();
>           file.delete();
>   
>           checkDescriptor( serialized );
>           assertEquals( original, serialized );
>           assertEquals( original.hashCode(), serialized.hashCode() );
>       }
>   
>   }
>   
>   
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
> For additional commands, e-mail: cvs-help@avalon.apache.org
> 
> 
> 


-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org