本文整理匯總了Java中org.springframework.context.support.ClassPathXmlApplicationContext.refresh方法的典型用法代碼示例。如果您正苦於以下問題:Java ClassPathXmlApplicationContext.refresh方法的具體用法?Java ClassPathXmlApplicationContext.refresh怎麽用?Java ClassPathXmlApplicationContext.refresh使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.context.support.ClassPathXmlApplicationContext
的用法示例。
在下文中一共展示了ClassPathXmlApplicationContext.refresh方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testStarted
import org.springframework.context.support.ClassPathXmlApplicationContext; //導入方法依賴的package包/類
private void testStarted(String[] configLocations) {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(configLocations);
context.registerShutdownHook();
context.refresh();
eventManager = context.getBean(EventManager.class);
suiteIdentifier = context.getBean(SuiteIdentifier.class);
eventManager.publishBeforeSuite(this, suiteIdentifier);
ref.set(context);
}
示例2: test
import org.springframework.context.support.ClassPathXmlApplicationContext; //導入方法依賴的package包/類
@Test
public void test() throws Exception {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("hekate.xml");
Hekate node = null;
for (int i = 0; i < 1; i++) {
node = ctx.getBean("hekate", Hekate.class);
assertSame(Hekate.State.UP, node.state());
verifyInjection(node);
verifyResource(node);
ctx.refresh();
assertSame(Hekate.State.DOWN, node.state());
}
ctx.close();
assertSame(Hekate.State.DOWN, node.state());
}