Package org.jboss.joinpoint.spi

Examples of org.jboss.joinpoint.spi.JoinpointFactory


      super(name);
   }

   public void testSimpleConstructor() throws Throwable
   {
      JoinpointFactory jpf = getJointpointFactory(SimpleBean.class);
      Object object = Config.instantiate(jpf, new String[0], new Object[0]);
      assertNotNull(object);
      assertTrue(object instanceof SimpleBean);
      SimpleBean bean = (SimpleBean) object;
      assertEquals("()", bean.getConstructorUsed());
View Full Code Here


      assertEquals("()", bean.getConstructorUsed());
   }

   public void testConstructorOneParam() throws Throwable
   {
      JoinpointFactory jpf = getJointpointFactory(SimpleBean.class);
      Object object = Config.instantiate(jpf, new String[] { String.class.getName() }, new Object[] { "String" });
      assertNotNull(object);
      assertTrue(object instanceof SimpleBean);
      SimpleBean bean = (SimpleBean) object;
      assertEquals("String", bean.getConstructorUsed());
View Full Code Here

      assertEquals("String", bean.getConstructorUsed());
   }

   public void testConstructorTwoParam() throws Throwable
   {
      JoinpointFactory jpf = getJointpointFactory(SimpleBean.class);
      Object object = Config.instantiate(jpf, new String[] { String.class.getName(), Object.class.getName() }, new Object[] { "StringObject", new Object() });
      assertNotNull(object);
      assertTrue(object instanceof SimpleBean);
      SimpleBean bean = (SimpleBean) object;
      assertEquals("StringObject", bean.getConstructorUsed());
View Full Code Here

      assertEquals("StringObject", bean.getConstructorUsed());
   }

   public void testSetField() throws Throwable
   {
      JoinpointFactory jpf = getJointpointFactory(SimpleBean.class);
      SimpleBean bean = new SimpleBean();
      Config.configure(bean, jpf, "publicField", "Hello");
      assertEquals("Hello", bean.publicField);
   }
View Full Code Here

      assertEquals("Hello", bean.publicField);
   }

   public void testUnSetField() throws Throwable
   {
      JoinpointFactory jpf = getJointpointFactory(SimpleBean.class);
      SimpleBean bean = new SimpleBean();
      Config.unconfigure(bean, jpf, "publicField");
      assertEquals(null, bean.publicField);
   }
View Full Code Here

      assertEquals(null, bean.publicField);
   }

   public void testGetField() throws Throwable
   {
      JoinpointFactory jpf = getJointpointFactory(SimpleBean.class);
      SimpleBean bean = new SimpleBean();
      Joinpoint joinpoint = Config.getFieldGetJoinpoint(bean, jpf, "publicField");
      assertEquals("DefaultValue", joinpoint.dispatch());
   }
View Full Code Here

      assertEquals("DefaultValue", joinpoint.dispatch());
   }

   public void testMethodInvoke() throws Throwable
   {
      JoinpointFactory jpf = getJointpointFactory(SimpleBean.class);
      SimpleBean bean = new SimpleBean();
      Joinpoint joinpoint = Config.getMethodJoinpoint(bean, jpf, "echo", new String[] { String.class.getName() }, new Object[] { "ping" });
      assertEquals("ping", joinpoint.dispatch());
   }
View Full Code Here

      assertEquals("ping", joinpoint.dispatch());
   }

   public void testObjectMethodInvoke() throws Throwable
   {
      JoinpointFactory jpf = getJointpointFactory(SimpleBean.class);
      SimpleBean bean = new SimpleBean();
      Joinpoint joinpoint = Config.getMethodJoinpoint(bean, jpf, "toString", new String[0], new Object[0]);
      assertEquals(bean.toString(), joinpoint.dispatch());
   }
View Full Code Here

   }

   protected MethodJoinpoint getMethodJoinpoint(KernelConfig config, Class clazz, String string) throws Throwable
   {
      BeanInfo info = config.getBeanInfo(clazz);
      JoinpointFactory jpf = info.getJoinpointFactory();
      return Config.getMethodJoinpoint(null, jpf, string, null, null);
   }
View Full Code Here

    * @throws Exception for any error
    */
   public static ConstructorJoinpoint findConstructor(boolean trace, BeanInfo info, ConstructorMetaData metaData, BeanMetaData beanMetaData) throws Exception
   {
      ConstructorInfo cinfo = resolveConstructor(trace, info, metaData);
      JoinpointFactory jpf = info.getJoinpointFactory();
      return jpf.getConstructorJoinpoint(cinfo);
   }
View Full Code Here

TOP

Related Classes of org.jboss.joinpoint.spi.JoinpointFactory

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.