use of org.opennms.test.FileAnticipator in project opennms by OpenNMS.
the class GenericIndexResourceTypeTest method setUp.
@Before
public void setUp() throws IOException {
m_fileAnticipator = new FileAnticipator();
m_resourceStorageDao = new FilesystemResourceStorageDao();
m_resourceStorageDao.setRrdDirectory(m_fileAnticipator.getTempDir());
m_resourceStorageDao.setRrdStrategy(new NullRrdStrategy());
}
use of org.opennms.test.FileAnticipator in project opennms by OpenNMS.
the class JRobinRrdStrategyTest method setUp.
@Before
public void setUp() throws Exception {
Locale.setDefault(Locale.US);
// Make sure that AWT headless mode is enabled
System.setProperty("java.awt.headless", "true");
MockLogAppender.setupLogging(true, "DEBUG");
m_strategy = new JRobinRrdStrategy();
// Don't initialize by default since not all tests need it.
m_fileAnticipator = new FileAnticipator(false);
}
use of org.opennms.test.FileAnticipator in project opennms by OpenNMS.
the class CollectableServiceTest method setUp.
@Before
public void setUp() throws Exception {
MockLogAppender.setupLogging();
rrdStrategy = new JRobinRrdStrategy();
fileAnticipator = new FileAnticipator();
MockEventIpcManager mockEventIpcManager = new MockEventIpcManager();
EventIpcManagerFactory.setIpcManager(mockEventIpcManager);
}
use of org.opennms.test.FileAnticipator in project opennms by OpenNMS.
the class FindTopLevelResourcesTest method setUp.
@Before
public void setUp() throws Exception {
m_fileAnticipator = new FileAnticipator();
m_easyMockUtils = new EasyMockUtils();
m_nodeDao = m_easyMockUtils.createMock(NodeDao.class);
m_locationMonitorDao = m_easyMockUtils.createMock(LocationMonitorDao.class);
m_resourceTypesDao = m_easyMockUtils.createMock(ResourceTypesDao.class);
m_filterDao = m_easyMockUtils.createMock(FilterDao.class);
FilterDaoFactory.setInstance(m_filterDao);
expect(m_filterDao.getActiveIPAddressList("IPADDR IPLIKE *.*.*.*")).andReturn(new ArrayList<InetAddress>(0)).anyTimes();
RrdStrategy<?, ?> rrdStrategy = new JRobinRrdStrategy();
m_rrdFileExtension = rrdStrategy.getDefaultFileExtension();
m_resourceStorageDao.setRrdDirectory(m_fileAnticipator.getTempDir());
m_resourceStorageDao.setRrdStrategy(rrdStrategy);
m_easyMockUtils.replayAll();
InputStream stream = ConfigurationTestUtils.getInputStreamForResource(this, "/collectdconfiguration-testdata.xml");
m_collectdConfig = new CollectdConfigFactory(stream, "localhost", false);
m_easyMockUtils.verifyAll();
m_resourceDao = new DefaultResourceDao();
m_resourceDao.setNodeDao(m_nodeDao);
m_resourceDao.setLocationMonitorDao(m_locationMonitorDao);
m_resourceDao.setCollectdConfig(m_collectdConfig);
m_resourceDao.setResourceTypesDao(m_resourceTypesDao);
m_resourceDao.setResourceStorageDao(m_resourceStorageDao);
}
Aggregations