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

Examples of org.springframework.ide.eclipse.beans.core.internal.model.BeansJavaConfig


    project.delete(true, null);
  }
 
  @Test
  public void testConfigWithoutClass() throws Exception {
    BeansJavaConfig config = new BeansJavaConfig(beansProject, null, "org.test.spring.SimpleConfigurationClass", IBeansConfig.Type.MANUAL);
   
    assertNull(config.getConfigClass());
    assertEquals("org.test.spring.SimpleConfigurationClass", config.getConfigClassName());
   
    IModelElement[] children = config.getElementChildren();
    assertEquals(0, children.length);

    assertNull(config.getElementResource());
  }
View Full Code Here


  }

  @Test
  public void testBasicConfigBeans() throws Exception {
    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());

    IModelElement[] children = config.getElementChildren();
    assertEquals(7, children.length);
  }
View Full Code Here

  }

  @Test
  public void testComponentScanningWithEnableAnnotations() throws Exception {
    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);
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);
View Full Code Here

    }
  }

  public static void appendBeansConfigLabel(IBeansConfig config, int flags, StringBuffer buf) {
    if (config instanceof BeansJavaConfig) {
      BeansJavaConfig javaConfig = (BeansJavaConfig) config;
      buf.append(javaConfig.getConfigClass().getElementName());
    }
    else {
      String configName = config.getElementName();
      if (config.isElementArchived()) {
        ZipEntryStorage storage = new ZipEntryStorage(config);
View Full Code Here

    project.delete(true, null);
  }
 
  @Test
  public void testConfigWithoutClass() throws Exception {
    BeansJavaConfig config = new BeansJavaConfig(beansProject, null, "org.test.spring.SimpleConfigurationClass", IBeansConfig.Type.MANUAL);
   
    assertNull(config.getConfigClass());
    assertEquals("org.test.spring.SimpleConfigurationClass", config.getConfigClassName());
   
    IModelElement[] children = config.getElementChildren();
    assertEquals(0, children.length);

    assertNull(config.getElementResource());
  }
View Full Code Here

  }

  @Test
  public void testBasicConfigBeans() throws Exception {
    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());

    IModelElement[] children = config.getElementChildren();
    assertEquals(7, children.length);
  }
View Full Code Here

  }

  @Test
  public void testComponentScanningWithEnableAnnotations() throws Exception {
    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);
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);
View Full Code Here

      if (isDecorationg) {
        image = getDecoratedImage(image, element, context);
      }
      return image;
    } else if (element instanceof BeansJavaConfig) {
      BeansJavaConfig javaConfig = (BeansJavaConfig) element;
      Image image = WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider().getImage(javaConfig.getConfigClass());
      if (isDecorationg) {
        image = getDecoratedImage(image, element, context);
      }
      return image;
    } else if (element instanceof IBeansConfigSet) {
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.beans.core.internal.model.BeansJavaConfig

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.