Search in sources :

Example 1 with DefaultJavamailConfigurationDao

use of org.opennms.netmgt.dao.jaxb.DefaultJavamailConfigurationDao in project opennms by OpenNMS.

the class EmailNorthbounderTest method setUp.

/**
 * Sets up the test.
 *
 * @throws Exception the exception
 */
@Before
public void setUp() throws Exception {
    MockLogAppender.setupLogging();
    // Setup the Email northbounder configuration DAO
    System.setProperty("opennms.home", "src/test/resources");
    EmailNorthbounderConfigDao configDao = new EmailNorthbounderConfigDao();
    configDao.setConfigResource(new FileSystemResource(new File("src/test/resources/etc/email-northbounder-config.xml")));
    configDao.afterPropertiesSet();
    // Setup JavaMail configuration DAO
    DefaultJavamailConfigurationDao javaMailDao = new DefaultJavamailConfigurationDao();
    javaMailDao.setConfigResource(new FileSystemResource(new File("src/test/resources/etc/javamail-configuration.xml")));
    javaMailDao.afterPropertiesSet();
    // Setup the trap northbounder (overriding the settings of the first sink to use the test trap receiver)
    nbi = new EmailNorthbounder(configDao, javaMailDao, "google");
    nbi.afterPropertiesSet();
}
Also used : DefaultJavamailConfigurationDao(org.opennms.netmgt.dao.jaxb.DefaultJavamailConfigurationDao) FileSystemResource(org.springframework.core.io.FileSystemResource) File(java.io.File) Before(org.junit.Before)

Aggregations

File (java.io.File)1 Before (org.junit.Before)1 DefaultJavamailConfigurationDao (org.opennms.netmgt.dao.jaxb.DefaultJavamailConfigurationDao)1 FileSystemResource (org.springframework.core.io.FileSystemResource)1