use of org.springframework.core.io.FileSystemResource in project opennms by OpenNMS.
the class BSFNorthbounderIT method setUp.
/**
* Sets up the test.
*
* @throws Exception the exception
*/
@Before
public void setUp() throws Exception {
MockLogAppender.setupLogging();
// Setup the BSF northbounder configuration DAO
System.setProperty("opennms.home", "src/test/resources");
BSFNorthbounderConfigDao configDao = new BSFNorthbounderConfigDao();
configDao.setConfigResource(new FileSystemResource(new File("src/test/resources/etc/bsf-northbounder-config.xml")));
configDao.afterPropertiesSet();
// Setup the northbounder
nbi = new BSFNorthbounder(configDao, "JUnit");
nbi.afterPropertiesSet();
}
use of org.springframework.core.io.FileSystemResource in project opennms by OpenNMS.
the class DroolsNorthbounderConfigDaoIT method setUp.
/**
* Sets up the test..
*
* @throws Exception the exception
*/
@Before
public void setUp() throws Exception {
FileUtils.copyDirectory(new File("src/test/resources/etc"), tempFolder.newFolder("etc"));
System.setProperty("opennms.home", tempFolder.getRoot().getAbsolutePath());
// Setup the configuration DAO
FileSystemResource resource = new FileSystemResource(new File(tempFolder.getRoot(), "etc/drools-northbounder-config.xml"));
configDao = new DroolsNorthbounderConfigDao();
configDao.setConfigResource(resource);
configDao.afterPropertiesSet();
}
use of org.springframework.core.io.FileSystemResource in project opennms by OpenNMS.
the class EmailNorthbounderConfigDaoTest method setUp.
/**
* Sets up the test..
*
* @throws Exception the exception
*/
@Before
public void setUp() throws Exception {
FileUtils.copyDirectory(new File("src/test/resources/etc"), tempFolder.newFolder("etc"));
System.setProperty("opennms.home", tempFolder.getRoot().getAbsolutePath());
// Setup the configuration DAO
FileSystemResource resource = new FileSystemResource(new File(tempFolder.getRoot(), "etc/email-northbounder-config.xml"));
configDao = new EmailNorthbounderConfigDao();
configDao.setConfigResource(resource);
configDao.afterPropertiesSet();
}
use of org.springframework.core.io.FileSystemResource 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();
}
use of org.springframework.core.io.FileSystemResource in project opennms by OpenNMS.
the class SnmpTrapNorthbounderConfigDaoTest method setUp.
/**
* Sets up the test.
*
* @throws Exception the exception
*/
@Before
public void setUp() throws Exception {
FileUtils.copyDirectory(new File("src/test/resources/etc"), tempFolder.newFolder("etc"));
System.setProperty("opennms.home", tempFolder.getRoot().getAbsolutePath());
// Setup the configuration DAO
FileSystemResource resource = new FileSystemResource(new File(tempFolder.getRoot(), "etc/snmptrap-northbounder-config.xml"));
configDao = new SnmpTrapNorthbounderConfigDao();
configDao.setConfigResource(resource);
configDao.afterPropertiesSet();
}
Aggregations