Examples of SimpleBean


Examples of org.jboss.test.microcontainer.support.SimpleBean

   public void testInterceptorWithDependencyCorrectOrder() throws Exception
   {
      deploy("InterceptorWithDependencyTestCaseNotAutomatic0.xml");
      try
      {
         SimpleBean dependency = (SimpleBean) getBean("Dependency");
         assertNotNull(dependency);
         deploy("InterceptorWithDependencyTestCaseNotAutomatic1.xml");
         try
         {
            validate();
            SimpleBean bean = (SimpleBean) getBean("Intercepted");
            assertNotNull(bean);
            bean.someMethod();
            assertTrue(dependency == InterceptorWithDependency.intercepted);
         }
         finally
         {
            undeploy("InterceptorWithDependencyTestCaseNotAutomatic1.xml");
View Full Code Here

Examples of org.jboss.test.microcontainer.support.jndi.SimpleBean

      super.enableTrace("org.jboss");
      Properties env = new Properties();
      env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.test.microcontainer.support.jndi.MockInitialContextFactory");
      InitialContext ctx = new InitialContext(env);

      SimpleBean bean0 = (SimpleBean) ctx.lookup("beans/SimpleBean0");
      assertNotNull(bean0);
      assertEquals("bean0.prop1", bean0.getProp1());
      SimpleBean alias0 = (SimpleBean) ctx.lookup("beans/XmlAnnotatedSimpleBean0");
      assertNotNull(alias0);
      assertEquals("bean0.prop1", alias0.getProp1());
      SimpleBeanAnnotatedImpl bean1 = (SimpleBeanAnnotatedImpl) ctx.lookup("beans/SimpleBean1");
      assertEquals("bean1.prop1", bean1.getProp1());
      SimpleBean alias1 = (SimpleBean) ctx.lookup("beans/AnnotatedSimpleBean1");
      assertNotNull(alias1);
      assertEquals("bean1.prop1", alias1.getProp1());
   }
View Full Code Here

Examples of org.jboss.test.proxyfactory.support.SimpleBean

public class NonInterfaceAdvisedTestCase extends AbstractProxyTest
{
   public void testSimple() throws Exception
   {
      SimpleInterceptor.invoked = null;
      SimpleBean bean = new SimpleBean();
      SimpleBean proxy = (SimpleBean) assertCreateProxy(bean, SimpleBean.class);
      proxy.doSomethingElse();
      assertTrue(bean.invoked);
      Method invoked = SimpleInterceptor.invoked;
      assertNotNull(invoked);
      assertEquals("doSomethingElse", invoked.getName());
   }
View Full Code Here

Examples of org.jboss.test.proxyfactory.support.SimpleBean

{
   private static final int iterations = 1000;
  
   public void testSimple() throws Exception
   {
      SimpleBean bean = new SimpleBean();
      Simple simple = (Simple) assertCreateProxy(bean, Simple.class);
      SimpleInterceptor.invoked = null;
      simple.doSomething();
      assertTrue(bean.invoked);
      Method invoked = SimpleInterceptor.invoked;
View Full Code Here

Examples of org.jboss.test.proxyfactory.support.SimpleBean

  
   public void testStressNoProxy() throws Exception
   {
      for (int i = 0; i < iterations; ++i)
      {
         SimpleBean bean = new SimpleBean();
         bean.doSomething();
      }
   }
View Full Code Here

Examples of org.jboss.test.proxyfactory.support.SimpleBean

   {
      Class[] interfaces = new Class[] { Simple.class };
      ClassLoader cl = Simple.class.getClassLoader();
      for (int i = 0; i < iterations; ++i)
      {
         SimpleBean bean = new SimpleBean();
         InvocationHandler ih = new MyInvocationHandler(bean);
         Simple simple = (Simple) Proxy.newProxyInstance(cl, interfaces, ih);
         simple.doSomething();
      }
   }
View Full Code Here

Examples of org.jboss.test.proxyfactory.support.SimpleBean

  
   public void testStressProxyFactory() throws Exception
   {
      for (int i = 0; i < iterations; ++i)
      {
         SimpleBean bean = new SimpleBean();
         Simple simple = (Simple) createProxy(bean);
         simple.doSomething();
      }
   }
View Full Code Here

Examples of org.jboss.test.proxyfactory.support.SimpleBean

*/
public class InstanceAdvisedTestCase extends AbstractProxyTest
{
   public void testInstanceAdvised() throws Exception
   {
      SimpleBean bean1 = new SimpleBean();
      Simple simple1 = (Simple) assertCreateProxy(bean1, Simple.class);
      SimpleBean bean2 = new SimpleBean();
      Simple simple2 = (Simple) assertCreateProxy(bean2, Simple.class);
      InstanceInterceptor.last = null;
      simple1.doSomething();
      assertTrue(bean1.invoked);
      Object instance1 = InstanceInterceptor.last;
View Full Code Here

Examples of org.jboss.test.proxyfactory.support.SimpleBean

*/
public class ProxyCacheTestCase extends AbstractProxyTest
{
   public void testCache() throws Exception
   {
      SimpleBean bean = new SimpleBean();
      assertCreateProxy(bean, Simple.class);
      assertCreateProxy(bean, new Class[] { Tagging.class }, Tagging.class);
   }
View Full Code Here

Examples of org.jboss.test.proxyfactory.support.SimpleBean

*/
public class FieldTestCase extends AbstractProxyTest
{
   public void testField() throws Exception
   {
      SimpleBean bean = new SimpleBean();
      Simple simple = (Simple) assertCreateProxy(bean, Simple.class);
      SimpleInterceptor.invoked = null;
      simple.doSomething();
      assertTrue(bean.invoked);
      Method invoked = SimpleInterceptor.invoked;
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.