/*
 * Created on Jan 24, 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package org.opennms.core.utils;

import java.util.Calendar;
import java.util.Properties;

import javax.mail.Address;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

import junit.framework.TestCase;
import alt.dev.jmta.JMTA;

/**
 * @author david
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class JavaMailerTest extends TestCase {
	    
    public void testMTA() throws Exception {
        
        Properties props = new Properties();
        Session session = Session.getInstance(props, null);
        MimeMessage message = new MimeMessage(session);
        message.setContent("Hello", "text/plain");
        message.setText("Hello");
        message.setSubject(Calendar.getInstance().getTime() + ": testMTA message");
        
        String to = "david@opennms.org";
        String from = "david@opennms.org";
        

        Address address = new InternetAddress(from);
        message.setFrom(address);
        address = new InternetAddress(to);
        message.setRecipients(Message.RecipientType.TO, to);
        message.saveChanges();
        
        JMTA.send(message);
        
    }

}

@@ -181,24 +181,27 @@
 ore.utils;%0A%0A
+/*%0A
 import java.
@@ -422,58 +422,61 @@
 ort 
-junit.framework.TestCase;%0Aimport alt.dev.jmta.JMTA
+alt.dev.jmta.JMTA;%0A*/%0Aimport junit.framework.TestCase
 ;%0A%0A/
@@ -686,16 +686,18 @@
 %0A%09    %0A 
+/*
    publi
@@ -1448,11 +1448,13 @@
  %0A    %7D%0A
+*/
 %0A%7D%0A

Comment testMTA() test case to prevent sending mail on every build.