Package org.springframework.context.annotation

Examples of org.springframework.context.annotation.AnnotationConfigApplicationContext.scan()


            }
        }
        if (getBasedPackages() != null) {
            String[] basePackages = getBasedPackages().split(";");
            for (String basePackage : basePackages) {
                acApplicationContext.scan(basePackage);
            }
        }
        acApplicationContext.refresh();
        return acApplicationContext;
       
View Full Code Here


        for (Class<?> configClass : configClasses) {
            context.register(configClass);
        }
       
        for (String basePackage : basePackages) {
            context.scan(basePackage);
        }
       
        context.refresh();

        // Have to create a child context that implements BeanDefinitionRegistry
View Full Code Here

        for (Class<?> configClass : configClasses) {
            context.register(configClass);
        }
       
        for (String basePackage : basePackages) {
            context.scan(basePackage);
        }
       
        context.refresh();

        // Have to create a child context that implements BeanDefinitionRegistry
View Full Code Here

  }

  @Test
  public void withACAC() {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
    ctx.scan("com.example");
    ctx.refresh();
  }

}
View Full Code Here

public class Spr10918Test {
    @Test
    public void shouldInvokeRegistrarOnlyOnce() {
        final AnnotationConfigApplicationContext myContext = new AnnotationConfigApplicationContext();
        myContext.scan(getClass().getPackage().getName());
        myContext.refresh();
        assertThat(TestImport.theInvocations, is(1));
    }
}
View Full Code Here

public class Spr8955Tests {

  @Test
  public void repro() {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
    ctx.scan("org.springframework.context.annotation.configuration.spr8955");
    ctx.refresh();
    //ctx.containsBean("child");
  }

}
View Full Code Here

  public void init()
  {
    super.init();

    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
    ctx.scan("org.wicketTutorial.ejbBean");
    ctx.refresh();
   
    getComponentInstantiationListeners().add(new SpringComponentInjector(this, ctx));
  }
}
View Full Code Here

   */
  @Test
  public void enclosingConfigFirstParentDefinesBeanWithScanning() {
    AnnotationConfigApplicationContext ctx= new AnnotationConfigApplicationContext();
    context = ctx;
    ctx.scan(AEnclosingConfig.class.getPackage().getName());
    ctx.refresh();
    assertThat(context.getBean("myBean",String.class), equalTo("myBean"));
  }

  @Test
View Full Code Here

  @Test
  public void shouldNotScanTwice() {
    TestImport.scanned = false;

    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
    context.scan(TestImport.class.getPackage().getName());
    context.refresh();
    context.getBean(TestConfiguration.class);
  }

View Full Code Here

   * annotation was being falsely considered as a 'lite' Configuration class candidate.
   */
  @Test
  public void repro() {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
    ctx.scan(getClass().getPackage().getName());
    ctx.refresh();
    assertThat(ctx.containsBean("withNestedAnnotation"), is(true));
  }

}
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.