当前位置: 首页>>代码示例>>Java>>正文


Java BeanContextServiceRevokedEvent类代码示例

本文整理汇总了Java中java.beans.beancontext.BeanContextServiceRevokedEvent的典型用法代码示例。如果您正苦于以下问题:Java BeanContextServiceRevokedEvent类的具体用法?Java BeanContextServiceRevokedEvent怎么用?Java BeanContextServiceRevokedEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BeanContextServiceRevokedEvent类属于java.beans.beancontext包,在下文中一共展示了BeanContextServiceRevokedEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: assertEqualsSerially

import java.beans.beancontext.BeanContextServiceRevokedEvent; //导入依赖的package包/类
private void assertEqualsSerially(BeanContextServiceRevokedEvent orig,
        BeanContextServiceRevokedEvent ser) {
    assertNull(ser.getSource());

    // check propagatedFrom
    if (orig.getPropagatedFrom() instanceof Serializable) {
        BeanContext origFrom = orig.getPropagatedFrom();
        BeanContext serFrom = ser.getPropagatedFrom();
        assertEquals(origFrom.getClass(), serFrom.getClass());
        if (origFrom instanceof MockBeanContextDelegateS) {
            assertEquals(((MockBeanContextDelegateS) origFrom).id,
                    ((MockBeanContextDelegateS) serFrom).id);
        }
    }

    // check serviceClass
    assertEquals(orig.getServiceClass(), ser.getServiceClass());

    // check invalidateRefs
    assertEquals(orig.isCurrentServiceInvalidNow(), ser
            .isCurrentServiceInvalidNow());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:23,代码来源:BeanContextServiceRevokedEventTest.java

示例2: testFireServiceRevokedBeanContextServiceRevokedEvent

import java.beans.beancontext.BeanContextServiceRevokedEvent; //导入依赖的package包/类
public void testFireServiceRevokedBeanContextServiceRevokedEvent() {
    MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
    MockBeanContextServicesSupport childSupport = new MockBeanContextServicesSupport();
    support.add(childSupport);
    MockBeanContextServicesListener l1 = new MockBeanContextServicesListener();
    MockBeanContextServicesListener l2 = new MockBeanContextServicesListener();
    support.addBeanContextServicesListener(l1);
    childSupport.addBeanContextServicesListener(l2);
    support.records.assertRecord("initialize", null);
    childSupport.records.assertRecord("initialize", null);

    BeanContextServiceRevokedEvent evt = new BeanContextServiceRevokedEvent(
            support, Collection.class, false);
    support.publicFireServiceRevoked(evt);

    support.records.assertEndOfRecords();
    childSupport.records.assertEndOfRecords();
    assertSame(evt, l1.lastRevokedEvent);
    assertNull(l2.lastRevokedEvent);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:21,代码来源:BeanContextServicesSupportTest.java

示例3: test_serviceRevoked_LBeanContextServiceRevokedEvent

import java.beans.beancontext.BeanContextServiceRevokedEvent; //导入依赖的package包/类
public void test_serviceRevoked_LBeanContextServiceRevokedEvent() {
	BeanContextServicesSupport support = new BeanContextServicesSupport();

	support.add(new MySupport());
	support.addBeanContextServicesListener(new MyListener());
	Class c = Object.class;

	support.addService(c, new MyProvider());

	BeanContextServiceRevokedEvent revokeEvent = new BeanContextServiceRevokedEvent(
			support, c, false);

	support.serviceRevoked(revokeEvent);
       assertEquals(0, serviceRevoked);
       assertEquals(2, serviceAvailable);
       
}
 
开发者ID:shannah,项目名称:cn1,代码行数:18,代码来源:BeanContextServicesSupportTest.java

示例4: testBeanContextServiceRevokedEvent

import java.beans.beancontext.BeanContextServiceRevokedEvent; //导入依赖的package包/类
public void testBeanContextServiceRevokedEvent() {
    BeanContextServices services = new MockBeanContextServices();
    BeanContextServiceRevokedEvent event = new MockBeanContextServiceRevokedEvent(
            services, BeanContext.class, true);
    assertSame(BeanContext.class, event.getServiceClass());
    assertSame(services, event.getSource());
    assertSame(services, event.getSourceAsBeanContextServices());
    assertTrue(event.isCurrentServiceInvalidNow());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:10,代码来源:BeanContextServiceRevokedEventTest.java

示例5: testIsServiceClass

import java.beans.beancontext.BeanContextServiceRevokedEvent; //导入依赖的package包/类
public void testIsServiceClass() {
    BeanContextServices services = new MockBeanContextServices();
    BeanContextServiceRevokedEvent event = new MockBeanContextServiceRevokedEvent(
            services, BeanContext.class, true);
    assertTrue(event.isServiceClass(BeanContext.class));
    assertFalse(event.isServiceClass(Integer.class));

    // Regression for HARMONY-1516
    assertFalse(event.isServiceClass(null));
}
 
开发者ID:shannah,项目名称:cn1,代码行数:11,代码来源:BeanContextServiceRevokedEventTest.java

示例6: testIsCurrentServiceInvalidNow

import java.beans.beancontext.BeanContextServiceRevokedEvent; //导入依赖的package包/类
public void testIsCurrentServiceInvalidNow() {
    BeanContextServices services = new MockBeanContextServices();
    BeanContextServiceRevokedEvent event = new MockBeanContextServiceRevokedEvent(
            services, BeanContext.class, true);
    assertTrue(event.isCurrentServiceInvalidNow());
    event = new MockBeanContextServiceRevokedEvent(services,
            BeanContext.class, false);
    assertFalse(event.isCurrentServiceInvalidNow());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:10,代码来源:BeanContextServiceRevokedEventTest.java

示例7: testSerialization

import java.beans.beancontext.BeanContextServiceRevokedEvent; //导入依赖的package包/类
public void testSerialization() throws IOException, ClassNotFoundException {
    BeanContextServiceRevokedEvent event = new BeanContextServiceRevokedEvent(
            new MockBeanContextServices(), ArrayList.class, true);
    event.setPropagatedFrom(new MockBeanContextDelegateS("from ID"));

    assertEqualsSerially(event,
            (BeanContextServiceRevokedEvent) SerializationTester
                    .getDeserilizedObject(event));

}
 
开发者ID:shannah,项目名称:cn1,代码行数:11,代码来源:BeanContextServiceRevokedEventTest.java

示例8: testSerialization_Compatibility

import java.beans.beancontext.BeanContextServiceRevokedEvent; //导入依赖的package包/类
public void testSerialization_Compatibility() throws Exception {
    BeanContextServiceRevokedEvent event = new BeanContextServiceRevokedEvent(
            new MockBeanContextServices(), ArrayList.class, true);
    event.setPropagatedFrom(new MockBeanContextDelegateS("from ID"));
    SerializationTest.verifyGolden(this, event, new SerializableAssert() {
        public void assertDeserialized(Serializable orig, Serializable ser) {
            assertEqualsSerially((BeanContextServiceRevokedEvent) orig,
                    (BeanContextServiceRevokedEvent) ser);
        }
    });
}
 
开发者ID:shannah,项目名称:cn1,代码行数:12,代码来源:BeanContextServiceRevokedEventTest.java

示例9: testConstructor

import java.beans.beancontext.BeanContextServiceRevokedEvent; //导入依赖的package包/类
public void testConstructor() throws Exception {
    BeanContextServices bcs = new MockBeanContextServices();
    BeanContextServiceRevokedEvent event = new BeanContextServiceRevokedEvent(
            bcs, ArrayList.class, true);
    assertEquals(null, event.getPropagatedFrom());
    assertEquals(ArrayList.class, event.getServiceClass());
    assertSame(bcs, event.getSource());
    assertSame(bcs, event.getBeanContext());
    assertSame(bcs, event.getSourceAsBeanContextServices());
    assertFalse(event.isPropagated());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:12,代码来源:BeanContextServiceRevokedEventTest.java

示例10: testServiceRevoked

import java.beans.beancontext.BeanContextServiceRevokedEvent; //导入依赖的package包/类
public void testServiceRevoked() {
    MockChildBeanContextServicesSupport mockChildBeanContextServicesSupport = new MockChildBeanContextServicesSupport();
    BeanContextServicesSupport beanContextServicesSupport = new BeanContextServicesSupport();
    beanContextServicesSupport.add(mockChildBeanContextServicesSupport);
    BeanContextServiceRevokedEvent beanContextServiceRevokedEvent = new BeanContextServiceRevokedEvent(new BeanContextServicesSupport(), Collection.class,false);
    beanContextServicesSupport.serviceRevoked(beanContextServiceRevokedEvent);
    assertTrue(mockChildBeanContextServicesSupport.revokeCalled);        
}
 
开发者ID:shannah,项目名称:cn1,代码行数:9,代码来源:BeanContextServicesSupportTest.java

示例11: testSerialization

import java.beans.beancontext.BeanContextServiceRevokedEvent; //导入依赖的package包/类
public void testSerialization() throws IOException, ClassNotFoundException {
    BeanContextServiceRevokedEvent event = new BeanContextServiceRevokedEvent(
            new MockBeanContextServices(), ArrayList.class, true);
    event.setPropagatedFrom(new MockBeanContextDelegateS("from ID"));

    assertEqualsSerially(event,
            (BeanContextServiceRevokedEvent) SerializationTester
                    .getDeserilizedObject(event));
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:10,代码来源:BeanContextServiceRevokedEventTest.java

示例12: testSerialization_Compatibility

import java.beans.beancontext.BeanContextServiceRevokedEvent; //导入依赖的package包/类
public void testSerialization_Compatibility() throws Exception {
    BeanContextServiceRevokedEvent event = new BeanContextServiceRevokedEvent(
            new MockBeanContextServices(), ArrayList.class, true);
    event.setPropagatedFrom(new MockBeanContextDelegateS("from ID"));

    assertEqualsSerially(
            event,
            (BeanContextServiceRevokedEvent) SerializationTester
                    .readObject(event,
                            "serialization/java/beans/beancontext/BeanContextServiceRevokedEvent.ser"));
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:12,代码来源:BeanContextServiceRevokedEventTest.java

示例13: serviceRevoked

import java.beans.beancontext.BeanContextServiceRevokedEvent; //导入依赖的package包/类
/**
 * @param bcsre the BeanContextServiceRevokedEvent
 */
public void serviceRevoked(BeanContextServiceRevokedEvent bcsre) {
    
    System.out.println("Sservice is revoked");
    counterRevokedEvent++;
    this.bcsre = bcsre;
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:10,代码来源:ServiceBean.java

示例14: serviceRevoked

import java.beans.beancontext.BeanContextServiceRevokedEvent; //导入依赖的package包/类
public void serviceRevoked(BeanContextServiceRevokedEvent p0) {
    return;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:4,代码来源:BeanContextServiceRevokedEventTest.java

示例15: testGetServiceClass

import java.beans.beancontext.BeanContextServiceRevokedEvent; //导入依赖的package包/类
public void testGetServiceClass() {
    BeanContextServices services = new MockBeanContextServices();
    BeanContextServiceRevokedEvent event = new MockBeanContextServiceRevokedEvent(
            services, BeanContext.class, true);
    assertSame(BeanContext.class, event.getServiceClass());
}
 
开发者ID:shannah,项目名称:cn1,代码行数:7,代码来源:BeanContextServiceRevokedEventTest.java


注:本文中的java.beans.beancontext.BeanContextServiceRevokedEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。