Example usage for org.springframework.context.support FileSystemXmlApplicationContext FileSystemXmlApplicationContext

List of usage examples for org.springframework.context.support FileSystemXmlApplicationContext FileSystemXmlApplicationContext

Introduction

In this page you can find the example usage for org.springframework.context.support FileSystemXmlApplicationContext FileSystemXmlApplicationContext.

Prototype

public FileSystemXmlApplicationContext(String... configLocations) throws BeansException 

Source Link

Document

Create a new FileSystemXmlApplicationContext, loading the definitions from the given XML files and automatically refreshing the context.

Usage

From source file:com.pontecultural.flashcards.ReadSpreadsheet.java

public static void main(String[] args) throws Exception {
    FileSystemXmlApplicationContext dbCtx = new FileSystemXmlApplicationContext(
            "src/main/webapp/WEB-INF/spring/appServlet/flashcards-persistence.xml");
    JdbcFlashcardsDao jDao = (JdbcFlashcardsDao) dbCtx.getBean("jdbcFlashcardsDaoTest");
    ReadSpreadsheet ods = new ReadSpreadsheet();
    ods.setJdbcFlashcardsDao(jDao);// w  w  w  .j a va 2 s  .c  o m
    ods.setOdsFile("/home/jkern/workspace/JavaSpring/test/data/FlashCardsTest.ods");
    ods.run();
}

From source file:com.spstudio.modules.workorder.service.test.TestWorkOrderService.java

@BeforeClass
public static void setUpClass() {
    ApplicationContext factory = new FileSystemXmlApplicationContext(
            new String[] { "src/main/java/com/spstudio/common/config/spring-*.xml",
                    "src/main/java/com/spstudio/modules/*/config/spring-*.xml" });
    sessionFactory = (SessionFactory) factory.getBean("sessionFactory");
    workOrderService = (WorkOrderService) factory.getBean("workOrderService");

}

From source file:com.spstudio.modules.product.service.test.TestProductService.java

@BeforeClass
public static void setUpClass() {

    ApplicationContext factory = new FileSystemXmlApplicationContext(
            new String[] { "src/main/java/com/spstudio/common/config/spring-*.xml",
                    "src/main/java/com/spstudio/modules/*/config/spring-*.xml" });
    sessionFactory = (SessionFactory) factory.getBean("sessionFactory");
    productService = (ProductService) factory.getBean("productService");

}

From source file:org.craftercms.cstudio.publishing.PublishingReceiverMain.java

private static Server initializeContext() throws IOException {
    System.setProperty("org.terracotta.quartz.skipUpdateCheck", "true");
    FileSystemXmlApplicationContext context = new FileSystemXmlApplicationContext(
            "classpath:spring/application-context.xml");
    Server server = (Server) context.getBean("Server");
    context.close();//from w ww .j  a  va 2s.com
    return server;
}

From source file:net.beachchou.spring.ioc.AbstractTest.java

@Before
public void setup() {
    //        XmlWebApplicationContext
    //        applicationContext = new ClassPathXmlApplicationContext(XML_FILE);
    applicationContext = new FileSystemXmlApplicationContext("src/main/resources/" + XML_FILE);
}

From source file:com.appdynamicspilot.util.ServiceRegistry.java

public static void initialize(final String[] file) {
    if (context == null) {
        context = new FileSystemXmlApplicationContext(file);
    }//from  w w w  . j  a  va 2 s  .com
}

From source file:org.cagrid.identifiers.namingauthority.TestUtil.java

public TestUtil() {
    ApplicationContext context = new FileSystemXmlApplicationContext(
            new String[] { SpringTestApplicationContextConstants.NA_BASE_LOCATION,
                    SpringTestApplicationContextConstants.TEST_BASE_LOCATION });
    NamingAuthority = (MaintainerNamingAuthority) context.getBean("NamingAuthority", NamingAuthorityImpl.class);
}

From source file:com.snaker.Factory.java

/**
 * Initialize configuration.//  w w  w .  j  a  va2 s  .c  o  m
 */
public static void initConfiguration() {
    /* ApplicationContext applicationContext = */new FileSystemXmlApplicationContext(
            new String[] { "classpath:context.xml", });
}

From source file:com.spstudio.modules.member.service.test.TestMemberService.java

@Before
public void setUp() {
    System.out.println("setUp()...");
    ApplicationContext factory = new FileSystemXmlApplicationContext(
            new String[] { "src/main/java/com/spstudio/common/config/spring-*.xml",
                    "src/main/java/com/spstudio/modules/*/config/spring-*.xml" });
    sessionFactory = (SessionFactory) factory.getBean("sessionFactory");
    memeberService = (MemberService) factory.getBean("memberService");

}

From source file:solidbase.test.spring.SpringBeanTest.java

@Test
public void testSpringUpgrade() throws BeansException, SQLException {
    TestUtil.dropHSQLDBSchema("jdbc:hsqldb:mem:testdb", "sa", null);
    TestUtil.dropHSQLDBSchema("jdbc:hsqldb:mem:testdb2", "sa", null);
    FileSystemXmlApplicationContext context = new FileSystemXmlApplicationContext("spring-upgrade.xml");
}