Package org.springframework.beans.factory.parsing

Examples of org.springframework.beans.factory.parsing.ComponentDefinition


    ComponentDefinition[] nestedComponentDefs = compositeDef.getNestedComponents();
    assertEquals("Incorrect number of inner components", 2, nestedComponentDefs.length);
    AdvisorComponentDefinition acd = null;
    for (int i = 0; i < nestedComponentDefs.length; i++) {
      ComponentDefinition componentDefinition = nestedComponentDefs[i];
      if (componentDefinition instanceof AdvisorComponentDefinition) {
        acd = (AdvisorComponentDefinition) componentDefinition;
        break;
      }
    }
View Full Code Here


    ComponentDefinition[] nestedComponentDefs = compositeDef.getNestedComponents();
    assertEquals("Incorrect number of inner components", 2, nestedComponentDefs.length);
    AspectComponentDefinition acd = null;
    for (int i = 0; i < nestedComponentDefs.length; i++) {
      ComponentDefinition componentDefinition = nestedComponentDefs[i];
      if (componentDefinition instanceof AspectComponentDefinition) {
        acd = (AspectComponentDefinition) componentDefinition;
        break;
      }
    }
View Full Code Here

    assertEquals("true", defaults.getMerge());
    assertTrue(defaults.getSource() instanceof Element);
  }

  public void testBeanEventReceived() throws Exception {
    ComponentDefinition componentDefinition1 = this.eventListener.getComponentDefinition("testBean");
    assertTrue(componentDefinition1 instanceof BeanComponentDefinition);
    assertEquals(1, componentDefinition1.getBeanDefinitions().length);
    BeanDefinition beanDefinition1 = componentDefinition1.getBeanDefinitions()[0];
    assertEquals(new TypedStringValue("Rob Harrop"),
        beanDefinition1.getConstructorArgumentValues().getGenericArgumentValue(String.class).getValue());
    assertEquals(1, componentDefinition1.getBeanReferences().length);
    assertEquals("testBean2", componentDefinition1.getBeanReferences()[0].getBeanName());
    assertEquals(1, componentDefinition1.getInnerBeanDefinitions().length);
    BeanDefinition innerBd1 = componentDefinition1.getInnerBeanDefinitions()[0];
    assertEquals(new TypedStringValue("ACME"),
        innerBd1.getConstructorArgumentValues().getGenericArgumentValue(String.class).getValue());
    assertTrue(componentDefinition1.getSource() instanceof Element);

    ComponentDefinition componentDefinition2 = this.eventListener.getComponentDefinition("testBean2");
    assertTrue(componentDefinition2 instanceof BeanComponentDefinition);
    assertEquals(1, componentDefinition1.getBeanDefinitions().length);
    BeanDefinition beanDefinition2 = componentDefinition2.getBeanDefinitions()[0];
    assertEquals(new TypedStringValue("Juergen Hoeller"),
        beanDefinition2.getPropertyValues().getPropertyValue("name").getValue());
    assertEquals(0, componentDefinition2.getBeanReferences().length);
    assertEquals(1, componentDefinition2.getInnerBeanDefinitions().length);
    BeanDefinition innerBd2 = componentDefinition2.getInnerBeanDefinitions()[0];
    assertEquals(new TypedStringValue("Eva Schallmeiner"),
        innerBd2.getPropertyValues().getPropertyValue("name").getValue());
    assertTrue(componentDefinition2.getSource() instanceof Element);
  }
View Full Code Here

    this.reader.loadBeanDefinitions(new ClassPathResource("jeeNamespaceHandlerTests.xml", getClass()));
  }

  @Test
  public void testJndiLookupComponentEventReceived() {
    ComponentDefinition component = this.eventListener.getComponentDefinition("simple");
    assertTrue(component instanceof BeanComponentDefinition);
  }
View Full Code Here

    assertTrue(component instanceof BeanComponentDefinition);
  }

  @Test
  public void testLocalSlsbComponentEventReceived() {
    ComponentDefinition component = this.eventListener.getComponentDefinition("simpleLocalEjb");
    assertTrue(component instanceof BeanComponentDefinition);
  }
View Full Code Here

    assertTrue(component instanceof BeanComponentDefinition);
  }

  @Test
  public void testRemoteSlsbComponentEventReceived() {
    ComponentDefinition component = this.eventListener.getComponentDefinition("simpleRemoteEjb");
    assertTrue(component instanceof BeanComponentDefinition);
  }
View Full Code Here

    assertEquals(Integer.MAX_VALUE, max.intValue());
  }

  @Test
  public void testEvents() {
    ComponentDefinition propertiesComponent = this.listener.getComponentDefinition("myProperties");
    assertNotNull("Event for 'myProperties' not sent", propertiesComponent);
    AbstractBeanDefinition propertiesBean = (AbstractBeanDefinition) propertiesComponent.getBeanDefinitions()[0];
    assertEquals("Incorrect BeanDefinition", PropertiesFactoryBean.class, propertiesBean.getBeanClass());

    ComponentDefinition constantComponent = this.listener.getComponentDefinition("min");
    assertNotNull("Event for 'min' not sent", propertiesComponent);
    AbstractBeanDefinition constantBean = (AbstractBeanDefinition) constantComponent.getBeanDefinitions()[0];
    assertEquals("Incorrect BeanDefinition", FieldRetrievingFactoryBean.class, constantBean.getBeanClass());
  }
View Full Code Here

    reader.setEventListener(this.eventListener);
    reader.loadBeanDefinitions(new ClassPathResource("txNamespaceHandlerTests.xml", getClass()));
  }

  public void testComponentEventReceived() {
    ComponentDefinition component = this.eventListener.getComponentDefinition("txAdvice");
    assertTrue(component instanceof BeanComponentDefinition);
  }
View Full Code Here

    ComponentDefinition[] nestedComponentDefs = compositeDef.getNestedComponents();
    assertEquals("Incorrect number of inner components", 2, nestedComponentDefs.length);
    PointcutComponentDefinition pcd = null;
    for (int i = 0; i < nestedComponentDefs.length; i++) {
      ComponentDefinition componentDefinition = nestedComponentDefs[i];
      if (componentDefinition instanceof PointcutComponentDefinition) {
        pcd = (PointcutComponentDefinition) componentDefinition;
        break;
      }
    }
View Full Code Here

    ComponentDefinition[] nestedComponentDefs = compositeDef.getNestedComponents();
    assertEquals("Incorrect number of inner components", 3, nestedComponentDefs.length);
    AdvisorComponentDefinition acd = null;
    for (int i = 0; i < nestedComponentDefs.length; i++) {
      ComponentDefinition componentDefinition = nestedComponentDefs[i];
      if (componentDefinition instanceof AdvisorComponentDefinition) {
        acd = (AdvisorComponentDefinition) componentDefinition;
        break;
      }
    }
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.parsing.ComponentDefinition

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.