Package org.apache.aries.blueprint.reflect

Examples of org.apache.aries.blueprint.reflect.BeanMetadataImpl


  }
 
  @Test
  public void testBeanMetadataOverwrite() {
    Element e = getTestElement("unit");
    BeanMetadataImpl oldBean = new BeanMetadataImpl();
    oldBean.setId("myid");
    oldBean.setProperties(Arrays.asList(Skeleton.newMock(BeanProperty.class)));
   
    BeanMetadata bean = (BeanMetadata) sut.decorate(e, oldBean, parserCtx);

    assertEquals("myid", bean.getId());
    assertEquals(2, bean.getProperties().size());
View Full Code Here


  @Test
  public void testDefaultContext() {
    Element e = getTestElement("context");
    BeanMetadata bean =
      (BeanMetadata) sut.decorate(e, new BeanMetadataImpl(), parserCtx);
    BeanMetadata innerBean = (BeanMetadata) ((BeanProperty) bean.getProperties().get(0)).getValue();

    assertEquals("createEntityManager", innerBean.getFactoryMethod());
    assertEquals("internalClose", innerBean.getDestroyMethod());
View Full Code Here

  public void testContextNoPersistenceContextProvider() {
   
    sut.contextUnavailable(null);
    Element e = getTestElement("context");
    BeanMetadata bean =
      (BeanMetadata) sut.decorate(e, new BeanMetadataImpl(), parserCtx);
    BeanMetadata innerBean = (BeanMetadata) ((BeanProperty) bean.getProperties().get(0)).getValue();

    assertEquals("createEntityManager", innerBean.getFactoryMethod());
    assertEquals("internalClose", innerBean.getDestroyMethod());
View Full Code Here

 
  @Test
  public void testContextWithProps() {
    Element e = getTestElement("contextWithProps");
    BeanMetadata bean =
      (BeanMetadata) sut.decorate(e, new BeanMetadataImpl(), parserCtx);
    BeanMetadata innerBean = (BeanMetadata) ((BeanProperty) bean.getProperties().get(0)).getValue();
   
    assertEquals("createEntityManager", innerBean.getFactoryMethod());
   
    assertEquals(1, registeredComponents.size());
View Full Code Here

  }
 
  @Test
  public void testNoMoreProxying() {
      Element e = getTestElement("contextWithProps");
      BeanMetadata input = new BeanMetadataImpl();
      Object output = sut.decorate(e, input, parserCtx);
      assertTrue(input == output);
  }
View Full Code Here

        parser = new AnnotationParser(cdr, i, helper);
  }
 
  @Test
  public void testFindAnnotation() {
    MutableBeanMetadata mbm = new BeanMetadataImpl();
    mbm.setId("testPojo");
    mbm.setClassName(AnnotatedPojo.class.getName());
      parser.beforeInit(new AnnotatedPojo(), "testPojo", null, mbm);
     
      Skeleton.getSkeleton(helper).assertCalledExactNumberOfTimes(new MethodCall(TxComponentMetaDataHelper.class,
          "getComponentMethodTxAttribute", mbm, String.class), 3);
     
View Full Code Here

  }
 
  @Test
  public void testAnnotationsOverridenByXML() {
   
    MutableBeanMetadata mbm = new BeanMetadataImpl();
    mbm.setId("testPojo");
    mbm.setClassName(AnnotatedPojo.class.getName());
     
    Skeleton.getSkeleton(helper).registerMethodCallHandler(new MethodCall(TxComponentMetaDataHelper.class,
          "getComponentMethodTxAttribute", ComponentMetadata.class, String.class), new MethodCallHandler() {
         
          public Object handle(MethodCall arg0, Skeleton arg1) throws Exception {
View Full Code Here

  }
 
 
  @Test(expected=IllegalArgumentException.class)
  public void testNoPrivateAnnotation() {
    MutableBeanMetadata mbm = new BeanMetadataImpl();
    mbm.setId("testPojo");
    mbm.setClassName(BadlyAnnotatedPojo1.class.getName());
      parser.beforeInit(new BadlyAnnotatedPojo1(), "testPojo", null, mbm);
  }
View Full Code Here

      parser.beforeInit(new BadlyAnnotatedPojo1(), "testPojo", null, mbm);
  }
 
  @Test(expected=IllegalArgumentException.class)
  public void testNoStaticAnnotation() {
    MutableBeanMetadata mbm = new BeanMetadataImpl();
    mbm.setId("testPojo");
    mbm.setClassName(BadlyAnnotatedPojo2.class.getName());
      parser.beforeInit(new BadlyAnnotatedPojo2(), "testPojo", null, mbm);
  }
View Full Code Here

TOP

Related Classes of org.apache.aries.blueprint.reflect.BeanMetadataImpl

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.