BeanContextEventTest.java 文件源码

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

项目:cn1 作者:
public void testSerializationComptibility() throws Exception {
    final BeanContextServicesSupport ctx = new BeanContextServicesSupport(
            null, Locale.ITALY, true, true);
    final BeanContextServicesSupport ctx2 = new BeanContextServicesSupport(
            null, Locale.CHINA, true, true);

    BeanContextEvent event = new MockBeanContextEvent(ctx);
    event.setPropagatedFrom(ctx2);
    SerializationTest.verifyGolden(this, 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(ctx2, (BeanContextServicesSupport)e2.getPropagatedFrom());
        }
    });
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号