Package org.apache.aries.blueprint.testbundlea

Examples of org.apache.aries.blueprint.testbundlea.ProcessableBean


       
        //ProcessedBean is a test to ensure that BeanProcessors are called..
        //The test has the BeanProcessor look for ProcessableBeans, and log itself with them
        Object obj4 = beanContainer.getComponentInstance("ProcessedBean");
        assertTrue(obj4 instanceof ProcessableBean);
        ProcessableBean pb = (ProcessableBean)obj4;
       
        //Note, the BeanProcessor exists in the same container as the beans it processes!!
        Object bp = beanContainer.getComponentInstance("http://ns.handler.three/BeanProcessor");
        assertNotNull(bp);
        assertTrue(bp instanceof BeanProcessor);
        assertEquals(1,pb.getProcessedBy().size());
        //check we were invoked..
        assertEquals(pb.getProcessedBy().get(0),bp);
        //check invocation for each phase.
        assertEquals(pb.getProcessedBy(Phase.BEFORE_INIT).get(0),bp);
        assertEquals(pb.getProcessedBy(Phase.AFTER_INIT).get(0),bp);
        //destroy invocation will only occur at tear down.. TODO, how to test after teardown.
        //assertEquals(pb.getProcessedBy(Phase.BEFORE_DESTROY).get(0),bp);
        //assertEquals(pb.getProcessedBy(Phase.AFTER_DESTROY).get(0),bp);
    }
View Full Code Here


       
        //ProcessedBean is a test to ensure that BeanProcessors are called..
        //The test has the BeanProcessor look for ProcessableBeans, and log itself with them
        Object obj4 = beanContainer.getComponentInstance("ProcessedBean");
        assertTrue(obj4 instanceof ProcessableBean);
        ProcessableBean pb = (ProcessableBean)obj4;
       
        //Note, the BeanProcessor exists in the same container as the beans it processes!!
        Object bp = beanContainer.getComponentInstance("http://ns.handler.three/BeanProcessor");
        assertNotNull(bp);
        assertTrue(bp instanceof BeanProcessor);
        assertEquals(1,pb.getProcessedBy().size());
        //check we were invoked..
        assertEquals(pb.getProcessedBy().get(0),bp);
        //check invocation for each phase.
        assertEquals(pb.getProcessedBy(Phase.BEFORE_INIT).get(0),bp);
        assertEquals(pb.getProcessedBy(Phase.AFTER_INIT).get(0),bp);
        //destroy invocation will only occur at tear down.. TODO, how to test after teardown.
        //assertEquals(pb.getProcessedBy(Phase.BEFORE_DESTROY).get(0),bp);
        //assertEquals(pb.getProcessedBy(Phase.AFTER_DESTROY).get(0),bp);
    }
View Full Code Here

       
        //ProcessedBean is a test to ensure that BeanProcessors are called..
        //The test has the BeanProcessor look for ProcessableBeans, and log itself with them
        Object obj4 = beanContainer.getComponentInstance("ProcessedBean");
        assertTrue(obj4 instanceof ProcessableBean);
        ProcessableBean pb = (ProcessableBean)obj4;
       
        //Note, the BeanProcessor exists in the same container as the beans it processes!!
        Object bp = beanContainer.getComponentInstance("http://ns.handler.three/BeanProcessor");
        assertNotNull(bp);
        assertTrue(bp instanceof BeanProcessor);
        assertEquals(1,pb.getProcessedBy().size());
        //check we were invoked..
        assertEquals(pb.getProcessedBy().get(0),bp);
        //check invocation for each phase.
        assertEquals(pb.getProcessedBy(Phase.BEFORE_INIT).get(0),bp);
        assertEquals(pb.getProcessedBy(Phase.AFTER_INIT).get(0),bp);
        //destroy invocation will only occur at tear down.. TODO, how to test after teardown.
        //assertEquals(pb.getProcessedBy(Phase.BEFORE_DESTROY).get(0),bp);
        //assertEquals(pb.getProcessedBy(Phase.AFTER_DESTROY).get(0),bp);
    }
View Full Code Here

       
        //ProcessedBean is a test to ensure that BeanProcessors are called..
        //The test has the BeanProcessor look for ProcessableBeans, and log itself with them
        Object obj4 = beanContainer.getComponentInstance("ProcessedBean");
        assertTrue(obj4 instanceof ProcessableBean);
        ProcessableBean pb = (ProcessableBean)obj4;
       
        //Note, the BeanProcessor exists in the same container as the beans it processes!!
        Object bp = beanContainer.getComponentInstance("http://ns.handler.three/BeanProcessor");
        assertNotNull(bp);
        assertTrue(bp instanceof BeanProcessor);
        assertEquals(1,pb.getProcessedBy().size());
        //check we were invoked..
        assertEquals(pb.getProcessedBy().get(0),bp);
        //check invocation for each phase.
        assertEquals(pb.getProcessedBy(Phase.BEFORE_INIT).get(0),bp);
        assertEquals(pb.getProcessedBy(Phase.AFTER_INIT).get(0),bp);
        //destroy invocation will only occur at tear down.. TODO, how to test after teardown.
        //assertEquals(pb.getProcessedBy(Phase.BEFORE_DESTROY).get(0),bp);
        //assertEquals(pb.getProcessedBy(Phase.AFTER_DESTROY).get(0),bp);
       
       
View Full Code Here

TOP

Related Classes of org.apache.aries.blueprint.testbundlea.ProcessableBean

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.