package edu.northwestern.bioinformatics.studycalendar.core;

import gov.nih.nci.cabig.ctms.testing.MoreJUnitAssertions;
import gov.nih.nci.cabig.ctms.tools.BuildInfo;
import org.springframework.context.ApplicationContext;

import java.util.Date;

/**
 * These tests are intended to verify that the various application contexts will all load when
 * the application is deployed.
 *
 * @author Rhett Sutphin
 */
public class ApplicationContextInitializationTest extends StudyCalendarTestCase {
    public void testApplicationContextItself() throws Exception {
        ApplicationContext context = StudyCalendarApplicationContextBuilder.getDeployedApplicationContext();
        // no exceptions
        assertPositive("No bean definitions loaded", context.getBeanDefinitionCount());
    }

    public void testBuildInfoTimestampIsParsed() throws Exception {
        BuildInfo buildInfo = (BuildInfo) StudyCalendarTestCase.getDeployedApplicationContext().getBean("buildInfo");
        assertNotNull(buildInfo.getTimestamp());
        // note that this assertion will fail if you build and then run the tests much later
        MoreJUnitAssertions.assertDatesClose("Build timestamp is not recent (this test will fail if you run it a long time after you build)",
            new Date(), buildInfo.getTimestamp(), 3 * 60 * 60 * 1000 /* 3 hours */);
    }
}

@@ -58,67 +58,8 @@
 e;%0A%0A
-import gov.nih.nci.cabig.ctms.testing.MoreJUnitAssertions;%0A
 impo
@@ -161,32 +161,8 @@
 t;%0A%0A
-import java.util.Date;%0A%0A
 /**%0A
@@ -936,328 +936,8 @@
 ));%0A
-        // note that this assertion will fail if you build and then run the tests much later%0A        MoreJUnitAssertions.assertDatesClose(%22Build timestamp is not recent (this test will fail if you run it a long time after you build)%22,%0A            new Date(), buildInfo.getTimestamp(), 3 * 60 * 60 * 1000 /* 3 hours */);%0A
     

Remove test that's incompatible with the new build process. #151.