Examples of StandardAnnotationMetadata


Examples of org.springframework.core.type.StandardAnnotationMetadata

   */
  @Test
  public void testRegisterBeanDefinitions() {

    AuditingBeanDefinitionRegistrarSupport registrar = new DummyAuditingBeanDefinitionRegistrarSupport();
    AnnotationMetadata metadata = new StandardAnnotationMetadata(SampleConfig.class);

    registrar.registerBeanDefinitions(metadata, registry);
    verify(registry, times(1)).registerBeanDefinition(anyString(), any(BeanDefinition.class));
  }
View Full Code Here

Examples of org.springframework.core.type.StandardAnnotationMetadata

  ResourceLoader resourceLoader;

  @Before
  public void setUp() {

    AnnotationMetadata annotationMetadata = new StandardAnnotationMetadata(SampleConfiguration.class, true);
    environment = new StandardEnvironment();
    resourceLoader = new DefaultResourceLoader();
    source = new AnnotationRepositoryConfigurationSource(annotationMetadata, EnableRepositories.class, resourceLoader,
        environment);
  }
View Full Code Here

Examples of org.springframework.core.type.StandardAnnotationMetadata

   * @see DATACMNS-502
   */
  @Test
  public void returnsEmptyStringForBasePackage() throws Exception {

    StandardAnnotationMetadata metadata = new StandardAnnotationMetadata(getClass().getClassLoader().loadClass(
        "TypeInDefaultPackage"), true);
    RepositoryConfigurationSource configurationSource = new AnnotationRepositoryConfigurationSource(metadata,
        EnableRepositories.class, resourceLoader, environment);

    assertThat(configurationSource.getBasePackages(), hasItem(""));
View Full Code Here

Examples of org.springframework.core.type.StandardAnnotationMetadata

    assertThat(getConfigSource(DefaultConfiguration.class).usesExplicitFilters(), is(false));
  }

  private AnnotationRepositoryConfigurationSource getConfigSource(Class<?> type) {

    AnnotationMetadata metadata = new StandardAnnotationMetadata(type, true);
    return new AnnotationRepositoryConfigurationSource(metadata, EnableRepositories.class, resourceLoader, environment);
  }
View Full Code Here

Examples of org.springframework.core.type.StandardAnnotationMetadata

  }

  @Test
  public void registersBeanDefinitionForFoundBean() {

    AnnotationMetadata metadata = new StandardAnnotationMetadata(SampleConfiguration.class, true);

    registrar.registerBeanDefinitions(metadata, registry);

    assertBeanDefinitionRegisteredFor("myRepository");
    assertNoBeanDefinitionRegisteredFor("profileRepository");
View Full Code Here

Examples of org.springframework.core.type.StandardAnnotationMetadata

   * @see DATACMNS-360
   */
  @Test
  public void registeredProfileRepositoriesIfProfileActivated() {

    StandardAnnotationMetadata metadata = new StandardAnnotationMetadata(SampleConfiguration.class, true);
    environment.setActiveProfiles("profile");

    DummyRegistrar registrar = new DummyRegistrar();
    registrar.setEnvironment(environment);

View Full Code Here

Examples of org.springframework.core.type.StandardAnnotationMetadata

   * Create a new AnnotatedGenericBeanDefinition for the given bean class.
   * @param beanClass the loaded bean class
   */
  public AnnotatedGenericBeanDefinition(Class<?> beanClass) {
    setBeanClass(beanClass);
    this.metadata = new StandardAnnotationMetadata(beanClass, true);
  }
View Full Code Here

Examples of org.springframework.core.type.StandardAnnotationMetadata

    this.resource = metadataReader.getResource();
    this.beanName = beanName;
  }

  public ConfigurationClass(Class<?> clazz, String beanName) {
    this.metadata = new StandardAnnotationMetadata(clazz);
    this.resource = new DescriptiveResource(clazz.toString());
    this.beanName = beanName;
  }
View Full Code Here

Examples of org.springframework.core.type.StandardAnnotationMetadata

      doProcessConfigurationClass(configClass, metadata);
      String superClassName = metadata.getSuperClassName();
      if (superClassName != null && !Object.class.getName().equals(superClassName)) {
        if (metadata instanceof StandardAnnotationMetadata) {
          Class<?> clazz = ((StandardAnnotationMetadata) metadata).getIntrospectedClass();
          metadata = new StandardAnnotationMetadata(clazz.getSuperclass());
        }
        else {
          MetadataReader reader = this.metadataReaderFactory.getMetadataReader(superClassName);
          metadata = reader.getAnnotationMetadata();
        }
View Full Code Here

Examples of org.springframework.core.type.StandardAnnotationMetadata

    AnnotationMetadata metadata = null;

    // Check already loaded Class if present...
    // since we possibly can't even load the class file for this Class.
    if (beanDef instanceof AbstractBeanDefinition && ((AbstractBeanDefinition) beanDef).hasBeanClass()) {
      metadata = new StandardAnnotationMetadata(((AbstractBeanDefinition) beanDef).getBeanClass());
    }
    else {
      String className = beanDef.getBeanClassName();
      if (className != null) {
        try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.