BeanContextEventTest.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:freeVM 作者:
public void testSerialization() throws Exception {
    final BeanContextServicesSupport ctx = new BeanContextServicesSupport(
            null, Locale.FRANCE, false, false);
    final BeanContextServicesSupport ctx2 = new BeanContextServicesSupport(
            ctx, Locale.ITALY, true, true);
    BeanContextEvent event = new MockBeanContextEvent(ctx2);
    event.setPropagatedFrom(ctx);
    SerializationTest.verifySelf(event, new SerializableAssert(){
        public void assertDeserialized(Serializable arg0, Serializable arg1) {
            BeanContextEvent e1 = (BeanContextEvent)arg0;
            BeanContextEvent e2 = (BeanContextEvent)arg1;
            assertNull((BeanContextServicesSupport)e2.getSource());
            assertNotNull((BeanContextServicesSupport)e1.getSource());
            assertEqualsSerially((BeanContextServicesSupport)e1.getPropagatedFrom(), (BeanContextServicesSupport)e2.getPropagatedFrom());
            assertEqualsSerially(ctx, (BeanContextServicesSupport)e2.getPropagatedFrom());
        }
    });
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号