use of org.opennms.netmgt.model.ExternalValueAttribute in project opennms by OpenNMS.
the class PropertiesGraphDaoIT method testGetPrefabGraphsForResourceWithSuppressUnused.
@Test
public void testGetPrefabGraphsForResourceWithSuppressUnused() {
MockResourceType resourceType = new MockResourceType();
resourceType.setName("interface");
HashSet<OnmsAttribute> attributes = new HashSet<OnmsAttribute>(0);
attributes.add(new RrdGraphAttribute("ifHCInOctets", "", ""));
attributes.add(new RrdGraphAttribute("ifHCOutOctets", "", ""));
attributes.add(new ExternalValueAttribute("ifSpeed", ""));
OnmsResource resource = new OnmsResource("node", "1", resourceType, attributes, ResourcePath.get("foo"));
PrefabGraph[] graphs = m_dao.getPrefabGraphsForResource(resource);
assertEquals("prefab graph array size", 1, graphs.length);
assertEquals("prefab graph[0] name", "mib2.HCbits", graphs[0].getName());
}
use of org.opennms.netmgt.model.ExternalValueAttribute in project opennms by OpenNMS.
the class PropertiesGraphDaoIT method testGetPrefabGraphsForResourceWithSuppress.
@Test
public void testGetPrefabGraphsForResourceWithSuppress() {
MockResourceType resourceType = new MockResourceType();
resourceType.setName("interface");
HashSet<OnmsAttribute> attributes = new HashSet<OnmsAttribute>(0);
attributes.add(new RrdGraphAttribute("ifInOctets", "", ""));
attributes.add(new RrdGraphAttribute("ifOutOctets", "", ""));
attributes.add(new RrdGraphAttribute("ifHCInOctets", "", ""));
attributes.add(new RrdGraphAttribute("ifHCOutOctets", "", ""));
attributes.add(new ExternalValueAttribute("ifSpeed", ""));
OnmsResource resource = new OnmsResource("node", "1", resourceType, attributes, ResourcePath.get("foo"));
PrefabGraph[] graphs = m_dao.getPrefabGraphsForResource(resource);
assertEquals("prefab graph array size", 1, graphs.length);
assertEquals("prefab graph[0] name", "mib2.HCbits", graphs[0].getName());
}
Aggregations