当前位置: 首页>>代码示例>>Java>>正文


Java AnnotationConfigApplicationContext.start方法代码示例

本文整理汇总了Java中org.springframework.context.annotation.AnnotationConfigApplicationContext.start方法的典型用法代码示例。如果您正苦于以下问题:Java AnnotationConfigApplicationContext.start方法的具体用法?Java AnnotationConfigApplicationContext.start怎么用?Java AnnotationConfigApplicationContext.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.context.annotation.AnnotationConfigApplicationContext的用法示例。


在下文中一共展示了AnnotationConfigApplicationContext.start方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSpring

import org.springframework.context.annotation.AnnotationConfigApplicationContext; //导入方法依赖的package包/类
@Test
public void testSpring() throws InterruptedException {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(TestConfig.class);
    ctx.start();

    try {
        Engine engine = ctx.getBean(Engine.class);

        await().atMost(30, TimeUnit.SECONDS).until(() -> engine.getOperations().getVariable(String.class, "springBeanValue") != null);

        assertEquals(BEAN_VALUE, engine.getOperations().getVariable(String.class, "springBeanValue"));
        assertFalse(engine.isError());
    } finally {
        ctx.close();
    }
}
 
开发者ID:softelnet,项目名称:sponge,代码行数:17,代码来源:SpringTest.java

示例2: start

import org.springframework.context.annotation.AnnotationConfigApplicationContext; //导入方法依赖的package包/类
public void start() {
    String configPath = ConfigUtils.getProperty(SPRING_JAVACONFIG);
    if (configPath == null || configPath.length() == 0) {
        configPath = DEFAULT_SPRING_JAVACONFIG;
    }
    context = new AnnotationConfigApplicationContext(configPath);
    context.start();
}
 
开发者ID:zhuxiaolei,项目名称:dubbo2,代码行数:9,代码来源:JavaConfigContainer.java

示例3: setUp

import org.springframework.context.annotation.AnnotationConfigApplicationContext; //导入方法依赖的package包/类
@Before
public void setUp() {
    context = new AnnotationConfigApplicationContext(SearchConfiguration.class);
    context.start();

    repository = context.getBean(GaeSearchRepository.class);

    repository.save(new SearchData(1L, 10, "Baz"));
}
 
开发者ID:snowdrop,项目名称:spring-data-snowdrop,代码行数:10,代码来源:SearchTest.java

示例4: testSpringAutoStartupTrue

import org.springframework.context.annotation.AnnotationConfigApplicationContext; //导入方法依赖的package包/类
@Test
public void testSpringAutoStartupTrue() throws InterruptedException {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(TestConfigAutoStartupTrue.class);
    ctx.start();

    try {
        Engine engine = ctx.getBean(Engine.class);

        assertTrue(engine.isRunning());
        assertFalse(engine.isError());
    } finally {
        ctx.close();
    }
}
 
开发者ID:softelnet,项目名称:sponge,代码行数:15,代码来源:SpringAutoStartupTest.java

示例5: testSpringAutoStartupFalse

import org.springframework.context.annotation.AnnotationConfigApplicationContext; //导入方法依赖的package包/类
@Test
public void testSpringAutoStartupFalse() throws InterruptedException {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(TestConfigAutoStartupFalse.class);
    ctx.start();

    try {
        Engine engine = ctx.getBean(Engine.class);

        assertFalse(engine.isRunning());
        assertFalse(engine.isError());
    } finally {
        ctx.close();
    }
}
 
开发者ID:softelnet,项目名称:sponge,代码行数:15,代码来源:SpringAutoStartupTest.java

示例6: setupContext

import org.springframework.context.annotation.AnnotationConfigApplicationContext; //导入方法依赖的package包/类
@SneakyThrows
public static void setupContext(Class<?>... classes) {
    DatabaseTestContext.setupContext(System.getProperty("database"));

    setProperty("no.nav.modig.security.sts.url", "111111");
    setProperty("no.nav.modig.security.systemuser.username", "username");
    setProperty("no.nav.modig.security.systemuser.password", "password");

    annotationConfigApplicationContext = new AnnotationConfigApplicationContext(classes);
    annotationConfigApplicationContext.start();
    platformTransactionManager = getBean(PlatformTransactionManager.class);

    MigrationUtils.createTables(getBean(DataSource.class));
}
 
开发者ID:navikt,项目名称:fo-veilarbjobbsokerkompetanse,代码行数:15,代码来源:AbstractIntegrasjonsTest.java


注:本文中的org.springframework.context.annotation.AnnotationConfigApplicationContext.start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。