use of org.opennms.netmgt.rrd.NullRrdStrategy in project opennms by OpenNMS.
the class NodeSnmpResourceTypeTest method canGetChildByName.
@Test
public void canGetChildByName() throws IOException {
final RrdStrategy<?, ?> rrdStrategy = new NullRrdStrategy();
final FilesystemResourceStorageDao resourceStorageDao = new FilesystemResourceStorageDao();
resourceStorageDao.setRrdDirectory(tempFolder.getRoot());
resourceStorageDao.setRrdStrategy(rrdStrategy);
File nodeSnmpFolder = tempFolder.newFolder("snmp", "1");
File rrd = new File(nodeSnmpFolder, "ds" + rrdStrategy.getDefaultFileExtension());
rrd.createNewFile();
final NodeSnmpResourceType nodeSnmpResourceType = new NodeSnmpResourceType(resourceStorageDao);
final OnmsResource parent = getNodeResource(1);
final OnmsResource resource = nodeSnmpResourceType.getChildByName(parent, new String(""));
assertEquals("node[1].nodeSnmp[]", resource.getId().toString());
assertEquals(parent, resource.getParent());
}
use of org.opennms.netmgt.rrd.NullRrdStrategy 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());
}
Aggregations