@@ -0,0 +1,2024 @@
+package edu.northwestern.bioinformatics.studycalendar;%0A%0Aimport edu.northwestern.bioinformatics.studycalendar.testing.StudyCalendarTestCase;%0Aimport org.springframework.context.ApplicationContext;%0Aimport org.springframework.core.io.FileSystemResourceLoader;%0Aimport org.springframework.mock.web.MockServletContext;%0Aimport org.springframework.web.context.support.XmlWebApplicationContext;%0A%0A/**%0A * These tests are intended to verify that the various application contexts will all load when%0A * the application is deployed.%0A *%0A * @author Rhett Sutphin%0A */%0Apublic class ApplicationContextInitializationTest extends StudyCalendarTestCase %7B%0A%0A    private MockServletContext servletContext;%0A%0A    protected void setUp() throws Exception %7B%0A        super.setUp();%0A        servletContext = new MockServletContext(%22web%22, new FileSystemResourceLoader());%0A    %7D%0A%0A    public void testApplicationContextItself() throws Exception %7B%0A        getDeployedApplicationContext();%0A        // no exceptions%0A    %7D%0A%0A    public void testSpringServletContext() throws Exception %7B%0A        assertDispatcherServletConfigLoads(%22spring%22);%0A    %7D%0A%0A    public void testPublicServletContext() throws Exception %7B%0A        assertDispatcherServletConfigLoads(%22public%22);%0A    %7D%0A%0A    private void assertDispatcherServletConfigLoads(String servletName) %7B%0A        try %7B%0A            createWebApplicationContextForServlet(servletName);%0A        %7D catch (Exception e) %7B%0A            fail(%22Loading the configuration for MVC servlet '%22 + servletName + %22' failed:  %22 + e.getMessage());%0A        %7D%0A    %7D%0A%0A    private XmlWebApplicationContext createWebApplicationContextForServlet(String servletName) %7B%0A        ApplicationContext parent = getDeployedApplicationContext();%0A        XmlWebApplicationContext context = new XmlWebApplicationContext();%0A        context.setParent(parent);%0A        context.setServletContext(servletContext);%0A        context.setConfigLocations(new String%5B%5D %7B %22WEB-INF/%22 + servletName + %22-servlet.xml%22 %7D);%0A        context.refresh();%0A        return context;%0A    %7D%0A%7D%0A

Add tests for *-servlet.xml