Skip to content

Instantly share code, notes, and snippets.

@sforteln
Created July 9, 2012 02:52
Show Gist options
  • Save sforteln/3073934 to your computer and use it in GitHub Desktop.
Save sforteln/3073934 to your computer and use it in GitHub Desktop.
package test.spring;
import org.junit.Test;
import static org.junit.Assert.*;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import javax.sql.DataSource;
public class ApplicationContext {
static final String[] CONTEXT_FILES = new String[] {"datasource.xml","beans.xml"};
@Test
public void createAppContext() {
ApplicationContext context = new ClassPathXmlApplicationContext(CONTEXT_FILES);
DataSource ds = (DataSource)context.getBean("datasource");
assertNotNull(ds);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment