Examples of EasyBeansSLSBLifeCycle


Examples of org.ow2.easybeans.api.bean.lifecycle.EasyBeansSLSBLifeCycle

     * Test the stateless bean callbacks.
     */
    @Test
    public void testStatelessBeanCallbacks() {
        assertEquals(0, statelessBean.getCounter());
        EasyBeansSLSBLifeCycle lifeCycle = getSLSBLifeCycle();

        // postConstruct should increment the counter
        lifeCycle.postConstructEasyBeansLifeCycle();
        assertEquals(1, statelessBean.getCounter());

        // preDestroy should decrement counter
        lifeCycle.preDestroyEasyBeansLifeCycle();
        assertEquals(0, statelessBean.getCounter());
    }
View Full Code Here

Examples of org.ow2.easybeans.api.bean.lifecycle.EasyBeansSLSBLifeCycle

     * Test the postConstruct on stateless bean.
     */
    @Test
    public void testStatelessPostConstruct() {
        assertFalse(statelessBean.isPostConstructCalled());
        EasyBeansSLSBLifeCycle lifeCycle = getSLSBLifeCycle();
        lifeCycle.postConstructEasyBeansLifeCycle();

        assertTrue(statelessBean.isPostConstructCalled());
    }
View Full Code Here

Examples of org.ow2.easybeans.api.bean.lifecycle.EasyBeansSLSBLifeCycle

     * Test the preDestroy on stateless bean.
     */
    @Test
    public void testStatelessPreDestroy() {
        assertFalse(statelessBean.isPreDestroyCalled());
        EasyBeansSLSBLifeCycle lifeCycle = getSLSBLifeCycle();
        lifeCycle.preDestroyEasyBeansLifeCycle();

        assertTrue(statelessBean.isPreDestroyCalled());
    }
View Full Code Here

Examples of org.ow2.easybeans.api.bean.lifecycle.EasyBeansSLSBLifeCycle

     * Test the postConstruct on stateless bean.
     */
    @Test
    public void testStateless2PostConstruct() {
        assertFalse(statelessBean2.isPostConstructCalled());
        EasyBeansSLSBLifeCycle lifeCycle = getSLSB2LifeCycle();
        lifeCycle.postConstructEasyBeansLifeCycle();

        assertTrue(statelessBean2.isPostConstructCalled());
    }
View Full Code Here

Examples of org.ow2.easybeans.api.bean.lifecycle.EasyBeansSLSBLifeCycle

     * Test the preDestroy on stateless bean.
     */
    @Test
    public void testStateless2PreDestroy() {
        assertFalse(statelessBean2.isPreDestroyCalled());
        EasyBeansSLSBLifeCycle lifeCycle = getSLSB2LifeCycle();
        lifeCycle.preDestroyEasyBeansLifeCycle();

        assertTrue(statelessBean2.isPreDestroyCalled());
    }
View Full Code Here

Examples of org.ow2.easybeans.api.bean.lifecycle.EasyBeansSLSBLifeCycle

     */
    @Test
    public void testStateless3() {
        assertEquals(0, statelessBean3.getCounter());

        EasyBeansSLSBLifeCycle lifeCycle = getSLSB3LifeCycle();

        // postConstruct should increment the counter
        lifeCycle.postConstructEasyBeansLifeCycle();
        assertEquals(1, statelessBean3.getCounter());

        // preDestroy should decrement the counter
        lifeCycle.preDestroyEasyBeansLifeCycle();
        assertEquals(0, statelessBean3.getCounter());
    }
View Full Code Here

Examples of org.ow2.easybeans.api.bean.lifecycle.EasyBeansSLSBLifeCycle

    @Test
    public void testInheritanceBeanLifeCycleStateless() {
        assertEquals(0, statelessBean.getCounter());
        assertEquals(0, statelessBean.getSuperLifeCycleCounter());

        EasyBeansSLSBLifeCycle lifeCycle = getSLSBLifeCycle();

        // postConstruct should increment the counter
        lifeCycle.postConstructEasyBeansLifeCycle();
        assertEquals(1, statelessBean.getCounter());
        // and the counter of the super class
        assertEquals(1, statelessBean.getSuperLifeCycleCounter());

        // preDestroy should decrement the counter
        lifeCycle.preDestroyEasyBeansLifeCycle();
        assertEquals(0, statelessBean.getCounter());
        assertEquals(0, statelessBean.getSuperLifeCycleCounter());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.