Example usage for org.springframework.context.annotation AnnotationConfigApplicationContext AnnotationConfigApplicationContext

List of usage examples for org.springframework.context.annotation AnnotationConfigApplicationContext AnnotationConfigApplicationContext

Introduction

In this page you can find the example usage for org.springframework.context.annotation AnnotationConfigApplicationContext AnnotationConfigApplicationContext.

Prototype

public AnnotationConfigApplicationContext(String... basePackages) 

Source Link

Document

Create a new AnnotationConfigApplicationContext, scanning for bean definitions in the given packages and automatically refreshing the context.

Usage

From source file:com.startup.musicstore.test.repository.AddressRepoTest.java

@BeforeClass
public static void setUpClass() throws Exception {
    // INITIALISE THE TEST CONTEST
    ctx = new AnnotationConfigApplicationContext(ConnectionConfigTest.class);
}

From source file:com.stratio.decision.functions.ActionBaseContext.java

private ActionBaseContext() {
    if (context == null) {
        context = new AnnotationConfigApplicationContext(BaseConfiguration.class);

        log.debug("SPRING CONTEXT INITIALIZED: {}" + context.toString());
    }/*from   w ww  .  j av  a 2  s  . com*/
}

From source file:com.abdul.onlinemobi.repository.CreditCardRepositoryTest.java

@BeforeClass
public static void setUpClass() throws Exception {
    ctx = new AnnotationConfigApplicationContext(ConnectionConfig.class);
}

From source file:org.sbq.batch.mains.SchedulerRunner.java

public SchedulerRunner() {
    super();// ww w. jav a2  s . c o m
    appCtx = new AnnotationConfigApplicationContext(SchedulerRunnerConfiguration.class);
    scheduler = appCtx.getBean(Scheduler.class);
}

From source file:com.nkosy.designpatterns.creational.singleton.test.SingletonExampleTest.java

@AfterMethod
public void tearDownMethod() throws Exception {
    ApplicationContext ctx = new AnnotationConfigApplicationContext(AppConfig.class);
    obj = (SingletonExample) ctx.getBean("singletonTest");
}

From source file:org.mcplissken.repository.cassandra.CassandraContext.java

public void init() {

    context = new AnnotationConfigApplicationContext(CassandraConfig.class);

    printNodeInfo();
}

From source file:com.ngcamango.rehabcetreweb.test.repository.RoomRepositoryTest.java

@BeforeClass
public static void setUpClass() throws Exception {
    ctx = new AnnotationConfigApplicationContext(ConnectionConfig.class);
    //beds = new Bed.Builder("Single").build();
}

From source file:org.cellcore.code.exec.ExecAddSingle.java

@Override
protected void execute(CommandLine commandLine) {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ContextConfig.class);
    FetchGathererData fgd = context.getBean(FetchGathererData.class);
    fgd.extractSingle(commandLine.getOptionValue("cardSet"), commandLine.getOptionValue("cardId"));
}

From source file:com.abdul.onlinemobi.repository.CustomerRepositoryTest.java

@BeforeClass
public static void setUpClass() throws Exception {
    ctx = new AnnotationConfigApplicationContext(ConnectionConfig.class);

}

From source file:cf.spring.servicebroker.ServiceBrokerConfigTest.java

@Test
public void serviceBrokerRequiresProvisionAnnotation() {
    try (ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(
            MissingProvisionAnnotationServiceBrokerConfig.class)) {
        fail("Should have thrown " + BeanCreationException.class.getName());
    } catch (BeanCreationException e) {
        assertTrue(e.getMessage().contains("must have method with @cf.spring.servicebroker.Provision"));
    }/*w  w w  .ja  v  a2 s . c om*/
}