本文整理汇总了Java中java.beans.beancontext.BeanContextEvent.setPropagatedFrom方法的典型用法代码示例。如果您正苦于以下问题:Java BeanContextEvent.setPropagatedFrom方法的具体用法?Java BeanContextEvent.setPropagatedFrom怎么用?Java BeanContextEvent.setPropagatedFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.beans.beancontext.BeanContextEvent
的用法示例。
在下文中一共展示了BeanContextEvent.setPropagatedFrom方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSerialization
import java.beans.beancontext.BeanContextEvent; //导入方法依赖的package包/类
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());
}
});
}
示例2: testSerializationComptibility
import java.beans.beancontext.BeanContextEvent; //导入方法依赖的package包/类
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());
}
});
}
示例3: testGetPropagatedFrom
import java.beans.beancontext.BeanContextEvent; //导入方法依赖的package包/类
public void testGetPropagatedFrom() {
BeanContext ctx = new MockBeanContext();
BeanContextEvent event = new MockBeanContextEvent(ctx);
assertNull(event.getPropagatedFrom());
BeanContext ctx2 = new MockBeanContext();
event.setPropagatedFrom(ctx2);
assertSame(ctx2, event.getPropagatedFrom());
event.setPropagatedFrom(ctx);
assertSame(ctx, event.getPropagatedFrom());
event.setPropagatedFrom(null);
assertNull(event.getPropagatedFrom());
}
示例4: testIsPropagated
import java.beans.beancontext.BeanContextEvent; //导入方法依赖的package包/类
public void testIsPropagated() {
BeanContext ctx = new MockBeanContext();
BeanContextEvent event = new MockBeanContextEvent(ctx);
assertFalse(event.isPropagated());
BeanContext ctx2 = new MockBeanContext();
event.setPropagatedFrom(ctx2);
assertTrue(event.isPropagated());
event.setPropagatedFrom(ctx);
assertTrue(event.isPropagated());
event.setPropagatedFrom(null);
assertFalse(event.isPropagated());
}
示例5: testSetPropagatedFrom
import java.beans.beancontext.BeanContextEvent; //导入方法依赖的package包/类
public void testSetPropagatedFrom() {
BeanContext ctx = new MockBeanContext();
BeanContextEvent event = new MockBeanContextEvent(ctx);
assertNull(event.getPropagatedFrom());
BeanContext ctx2 = new MockBeanContext();
event.setPropagatedFrom(ctx2);
assertSame(ctx2, event.getPropagatedFrom());
event.setPropagatedFrom(ctx);
assertSame(ctx, event.getPropagatedFrom());
event.setPropagatedFrom(null);
assertNull(event.getPropagatedFrom());
}