Package org.springframework.ide.eclipse.beans.core.model

Examples of org.springframework.ide.eclipse.beans.core.model.IBean


        && severity != IMarker.SEVERITY_WARNING);
  }
 
  @Test
  public void testAutowireDefaultParentConstructor() throws Exception {
    IBean bean = BeansModelUtils.getBean("autowireDefaultParentConstructr", beansConfig);
    assertNotNull(bean);
    int severity = MarkerUtils.getHighestSeverityFromMarkersInRange(resource, bean
        .getElementStartLine(), bean.getElementEndLine());
    assertTrue("No error expected for bean", severity != IMarker.SEVERITY_ERROR
        && severity != IMarker.SEVERITY_WARNING);
  }
View Full Code Here


      }
      return config.getElementName();
    }
    if (P_ID_PARENT.equals(id)) {
      String parentName = bean.getParentName();
      IBean parentBean = BeansModelUtils.getConfig(bean).getBean(
          parentName);
      if (parentBean != null) {
        if (parentBean.isRootBean()) {
          return new RootBeanProperties(parentBean);
        } else if (parentBean.isChildBean()) {
          return new ChildBeanProperties(parentBean);
        } else {
          // FIXME add factory bean support
          // return new FactoryBeanProperties(parentBean);
        }
View Full Code Here

    Map<String, Integer[]> allowedRefs = new HashMap<String, Integer[]>();
    allowedRefs.put("testBean", new Integer[] { 42, 48 });

    AutowireDependencyProvider provider = new AutowireDependencyProvider(config, config);
    Map<IBean, Set<IBeanReference>> references = provider.resolveAutowiredDependencies();
    IBean bean = BeansModelUtils.getBean("annotatedBean", config);

    assertEquals(1, references.size());
    assertTrue(references.containsKey(bean));

    Set<IBeanReference> refs = references.get(bean);
View Full Code Here

        && severity != IMarker.SEVERITY_WARNING);
  }
 
  @Test
  public void testAutowireConstructorParentConstructor() throws Exception {
    IBean bean = BeansModelUtils.getBean("autowireConstructorParentConstructor", beansConfig);
    assertNotNull(bean);
    int severity = MarkerUtils.getHighestSeverityFromMarkersInRange(resource, bean
        .getElementStartLine(), bean.getElementEndLine());
    assertTrue("No error expected for bean", severity != IMarker.SEVERITY_ERROR
        && severity != IMarker.SEVERITY_WARNING);
  }
View Full Code Here

    IType configClass = javaProject.findType("org.test.spring.SimpleConfigurationClass");
    BeansJavaConfig config = new BeansJavaConfig(beansProject, configClass, "org.test.spring.SimpleConfigurationClass", IBeansConfig.Type.MANUAL);
   
    assertEquals("java:org.test.spring.SimpleConfigurationClass", config.getElementName());
   
    IBean configBean = BeansModelUtils.getBean("simpleConfigurationClass", config);
    assertEquals("simpleConfigurationClass", configBean.getElementName());
   
    IBean bean = BeansModelUtils.getBean("simpleScannedBean", config);
    assertEquals("simpleScannedBean", bean.getElementName());

    IBean processor1 = BeansModelUtils.getBean(AnnotationConfigUtils.CONFIGURATION_ANNOTATION_PROCESSOR_BEAN_NAME, config);
    assertNotNull(processor1);
   
    IBean processor2 = BeansModelUtils.getBean(AnnotationConfigUtils.AUTOWIRED_ANNOTATION_PROCESSOR_BEAN_NAME, config);
    assertNotNull(processor2);

    IBean processor3 = BeansModelUtils.getBean(AnnotationConfigUtils.REQUIRED_ANNOTATION_PROCESSOR_BEAN_NAME, config);
    assertNotNull(processor3);
   
    IBean processor4 = BeansModelUtils.getBean(AnnotationConfigUtils.COMMON_ANNOTATION_PROCESSOR_BEAN_NAME, config);
    assertNotNull(processor4);
   
    IBean processor5 = BeansModelUtils.getBean(AnnotationConfigUtils.PERSISTENCE_ANNOTATION_PROCESSOR_BEAN_NAME, config);
    assertNotNull(processor5);

    Set<IBean> beans = BeansModelUtils.getBeans(config);
    assertEquals(7, beans.size());
View Full Code Here

    allowedRefs.put("nestedTestBean", new Integer[] { 87 });
    allowedRefs.put("beanFactory", new Integer[] { 98 });

    AutowireDependencyProvider provider = new AutowireDependencyProvider(config, config);
    Map<IBean, Set<IBeanReference>> references = provider.resolveAutowiredDependencies();
    IBean bean = BeansModelUtils.getBean("annotatedBean", config);

    assertEquals(1, references.size());
    assertTrue(references.containsKey(bean));

    Set<IBeanReference> refs = references.get(bean);
View Full Code Here

    IType configClass = javaProject.findType("org.test.advanced.AdvancedConfigurationClass");
    BeansJavaConfig config = new BeansJavaConfig(beansProject, configClass, "org.test.advanced.AdvancedConfigurationClass", IBeansConfig.Type.MANUAL);
   
    assertEquals("java:org.test.advanced.AdvancedConfigurationClass", config.getElementName());

    IBean simpleBean = BeansModelUtils.getBean("simpleScannedBean", config);
    assertEquals("simpleScannedBean", simpleBean.getElementName());

    IBean bean = BeansModelUtils.getBean("advancedConfigurationClass", config);
    assertEquals("advancedConfigurationClass", bean.getElementName());
   
    IBean transactionBean = BeansModelUtils.getBean("org.springframework.transaction.config.internalTransactionAdvisor", config);
    assertEquals("org.springframework.transaction.config.internalTransactionAdvisor", transactionBean.getElementName());

    IBean aspectjBean = BeansModelUtils.getBean("org.springframework.aop.config.internalAutoProxyCreator", config);
    assertNotNull(aspectjBean);
    assertEquals("org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator", aspectjBean.getClassName());
  }
View Full Code Here

    allowedRefs.put("nestedTestBean", new Integer[] { 87 });
    allowedRefs.put("beanFactory", new Integer[] { 98 });
   
    AutowireDependencyProvider provider = new AutowireDependencyProvider(config, config);
    Map<IBean, Set<IBeanReference>> references = provider.resolveAutowiredDependencies();
    IBean bean = BeansModelUtils.getBean("annotatedBean", config);

    assertEquals(1, references.size());
    assertTrue(references.containsKey(bean));

    Set<IBeanReference> refs = references.get(bean);
View Full Code Here

    allowedRefs.put("testBean", new Integer[] { 42, 68, 87, 93, 140 });
    allowedRefs.put("nestedTestBean", new Integer[] { 87 });

    AutowireDependencyProvider provider = new AutowireDependencyProvider(config, config);
    Map<IBean, Set<IBeanReference>> references = provider.resolveAutowiredDependencies();
    IBean bean = BeansModelUtils.getBean("annotatedBean", config);

    assertEquals(1, references.size());
    assertTrue(references.containsKey(bean));

    Set<IBeanReference> refs = references.get(bean);
View Full Code Here

  @Test
  public void testComponentScanningWithProfile() throws Exception {
    IType configClass = javaProject.findType("org.test.profile.ProfileConfigurationClass");
    BeansJavaConfig config = new BeansJavaConfig(beansProject, configClass, "org.test.profile.ProfileConfigurationClass", IBeansConfig.Type.MANUAL);
   
    IBean simpleBean = BeansModelUtils.getBean("simpleScannedBean", config);
    assertEquals("simpleScannedBean", simpleBean.getElementName());

    IBean configClassBean = BeansModelUtils.getBean("profileConfigurationClass", config);
    assertEquals("profileConfigurationClass", configClassBean.getElementName());
   
    assertEquals(1, getProfiles(simpleBean).size());
    assertEquals("testProfile", getProfiles(simpleBean).iterator().next());
   
    assertEquals(0, getProfiles(configClassBean).size());
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.beans.core.model.IBean

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.