Package org.osgi.service.blueprint.reflect

Examples of org.osgi.service.blueprint.reflect.BeanMetadata


  }
 
  @Test
  public void testUnitNoName_110() {
    Element e = getTestElement("unitNoName", root_110);
    BeanMetadata bean =
      (BeanMetadata) sut.decorate(e, new BeanMetadataImpl(), parserCtx);
    BeanProperty property = (BeanProperty) bean.getProperties().get(0);
    ReferenceMetadata reference = (ReferenceMetadata) property.getValue();
   
    assertEquals("emf2", property.getName());
    assertEquals("(&(!(org.apache.aries.jpa.proxy.factory=*))"+NSHandler.EMPTY_UNIT_NAME_FILTER+")",
        reference.getFilter());
View Full Code Here


  }
 
  @Test
  public void testEmptyUnitName() {
    Element e = getTestElement("emptyUnitName", root);
    BeanMetadata bean =
      (BeanMetadata) sut.decorate(e, new BeanMetadataImpl(), parserCtx);
    BeanProperty property = (BeanProperty) bean.getProperties().get(0);
    ReferenceMetadata reference = (ReferenceMetadata) property.getValue();
   
    assertEquals("emf3", property.getName());
    assertEquals("(&(!(org.apache.aries.jpa.proxy.factory=*))"+NSHandler.EMPTY_UNIT_NAME_FILTER+")",
        reference.getFilter());
View Full Code Here

  }
 
  @Test
  public void testEmptyUnitName_110() {
    Element e = getTestElement("emptyUnitName", root_110);
    BeanMetadata bean =
      (BeanMetadata) sut.decorate(e, new BeanMetadataImpl(), parserCtx);
    BeanProperty property = (BeanProperty) bean.getProperties().get(0);
    ReferenceMetadata reference = (ReferenceMetadata) property.getValue();
   
    assertEquals("emf3", property.getName());
    assertEquals("(&(!(org.apache.aries.jpa.proxy.factory=*))"+NSHandler.EMPTY_UNIT_NAME_FILTER+")",
        reference.getFilter());
View Full Code Here

    Element e = getTestElement("unit", root);
    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());
   
    assertTrue(registeredComponents.isEmpty());
  }
View Full Code Here

    Element e = getTestElement("unit", root);
    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());
   
    assertTrue(registeredComponents.isEmpty());
  }
View Full Code Here

  }

  @Test
  public void testDefaultContext() {
    Element e = getTestElement("context", root);
    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());

    assertEquals(1, registeredComponents.size());
    ReferenceMetadata reference = (ReferenceMetadata) registeredComponents.get(0);
   
    assertEquals(EntityManagerFactory.class.getName(), reference.getInterface());
View Full Code Here

  }
 
  @Test
  public void testDefaultContext_110() {
    Element e = getTestElement("context", root_110);
    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());

    assertEquals(1, registeredComponents.size());
    ReferenceMetadata reference = (ReferenceMetadata) registeredComponents.get(0);
   
    assertEquals(EntityManagerFactory.class.getName(), reference.getInterface());
View Full Code Here

  @Test
  public void testContextNoPersistenceContextProvider() {
   
    sut.contextUnavailable(null);
    Element e = getTestElement("context", root);
    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());

    assertEquals(1, registeredComponents.size());
    ReferenceMetadata reference = (ReferenceMetadata) registeredComponents.get(0);
   
    assertEquals(EntityManagerFactory.class.getName(), reference.getInterface());
View Full Code Here

  @Test
  public void testContextNoPersistenceContextProvider_110() {
   
    sut.contextUnavailable(null);
    Element e = getTestElement("context", root_110);
    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());

    assertEquals(1, registeredComponents.size());
    ReferenceMetadata reference = (ReferenceMetadata) registeredComponents.get(0);
   
    assertEquals(EntityManagerFactory.class.getName(), reference.getInterface());
View Full Code Here

  }
 
  @Test
  public void testContextWithProps() {
    Element e = getTestElement("contextWithProps", root);
    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());
    ReferenceMetadata reference = (ReferenceMetadata) registeredComponents.get(0);
   
    assertEquals(EntityManagerFactory.class.getName(), reference.getInterface());
View Full Code Here

TOP

Related Classes of org.osgi.service.blueprint.reflect.BeanMetadata

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.