Package org.apache.avalon.meta.info

Examples of org.apache.avalon.meta.info.Descriptor


        assertTrue( !hasInvalid );
    }

    public void testSerialization() throws IOException, ClassNotFoundException
    {
        Descriptor desc = getDescriptor();
        checkDescriptor( desc );

        File file = new File( "test.file" );
        ObjectOutputStream oos = new ObjectOutputStream( new FileOutputStream( file ) );
        oos.writeObject( desc );
        oos.close();

        ObjectInputStream ois = new ObjectInputStream( new FileInputStream( file ) );
        Descriptor serialized = (Descriptor) ois.readObject();
        ois.close();
        file.delete();

        assertTrue( desc != serialized ); // Ensure this is not the same instance
        checkDescriptor( serialized );

        assertEquals( desc, serialized );
        assertEquals( desc.hashCode(), serialized.hashCode() );
    }
View Full Code Here

TOP

Related Classes of org.apache.avalon.meta.info.Descriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.