use of org.opennms.netmgt.snmp.NamedSnmpVar in project opennms by OpenNMS.
the class SnmpStoreTest method testStoreResultWithValueThenEndOfMibView.
public void testStoreResultWithValueThenEndOfMibView() {
String baseOid = ".1.3.6.1.2.1.31.1.1.1.18";
String ifAliasName = "ifAlias";
String ifAliasValue = "Foo!";
SnmpStore store = new SnmpStore(new NamedSnmpVar[] { new NamedSnmpVar(NamedSnmpVar.SNMPOCTETSTRING, ifAliasName, baseOid, 18) });
SnmpObjId base = SnmpObjId.get(baseOid);
SnmpInstId inst = new SnmpInstId("1");
store.storeResult(new SnmpResult(base, inst, SnmpUtils.getValueFactory().getOctetString(ifAliasValue.getBytes())));
store.storeResult(new SnmpResult(base, inst, SnmpUtils.getValueFactory().getValue(SnmpValue.SNMP_END_OF_MIB, null)));
assertEquals("ifAlias value", ifAliasValue, store.getDisplayString(ifAliasName));
}
Aggregations