Package org.apache.webbeans.newtests.interceptors.resolution.beans

Examples of org.apache.webbeans.newtests.interceptors.resolution.beans.FooImpl


        beanClasses.add(FooImpl.class);

        startContainer(beanClasses, beanXmls);

        final Bean<FooImpl> bean = getBean(FooImpl.class);
        FooImpl instance = FooImpl.class.cast(getBeanManager().getReference(bean, FooImpl.class, null));
        Assert.assertNotNull(instance);

        instance.doSomething("test1");

        // Ensure the method call was intercepted, and value was set
        Assert.assertEquals(TestInterceptor1.invocationCount, 1);
        Assert.assertEquals(instance.getValue(), "test1");

        // Cast FooImpl to Foo, testing if the call becoming doSomething(Object)
        // breaks the interception
        Foo castInstance = (Foo) instance;
        castInstance.doSomething("test2");

        // Ensure the method call on to doSomethign(Object) was intercepted, and
        // value was set
        Assert.assertEquals(TestInterceptor1.invocationCount, 2);
        Assert.assertEquals(instance.getValue(), "test2");
       
        shutDownContainer();
    }
View Full Code Here

TOP

Related Classes of org.apache.webbeans.newtests.interceptors.resolution.beans.FooImpl

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.