001    package org.hackystat.sensorbase.mailer;
002    
003    import static org.junit.Assert.assertTrue;
004    
005    import org.hackystat.sensorbase.server.Server;
006    import org.hackystat.sensorbase.server.ServerProperties;
007    import org.junit.Test;
008    
009    /**
010     * Tests the Mailer class.
011     * @author Philip Johnson
012     */
013    public class TestMailer {
014      
015      /**
016       * Checks to see that the Mailer instance works.
017       * @exception Exception if problems occur. 
018       */
019      @Test public void testMailer() throws Exception {
020        ServerProperties properties = new ServerProperties();
021        properties.setTestProperties();
022        Server server = Server.newInstance(properties);
023        Mailer mailer = Mailer.getInstance();
024        assertTrue("Checking mailer", mailer.send("johnson@hackystat.org", "Test Subject", "TestBody"));
025        server.stop();
026      }
027    
028    }