Skip to content

Instantly share code, notes, and snippets.

@nhniches
Last active December 10, 2015 20:39
Show Gist options
  • Save nhniches/4489899 to your computer and use it in GitHub Desktop.
Save nhniches/4489899 to your computer and use it in GitHub Desktop.
simple spring context loader test class
public class SpringLoadTester {
// this just is a quick main method to test to see if the spring stuff loads
// correctly...
public static void main(String[] args) {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
"classpath:spring-applicationContext.xml");
DataSource ds = (DataSource) ctx.getBean("dataSource");
DefaultSqlSessionFactory ssf = (DefaultSqlSessionFactory) ctx.getBean("sqlSessionFactory");
System.out.println("completed load of application context...");
ClassPathXmlApplicationContext ctx2 = new ClassPathXmlApplicationContext(
"classpath:AbstractServiceTests-context.xml");
System.out.println("completed load of application context...");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment