monitorable.setNotificationSupport("sv.id1", true);
map.put(new MonitorableMockServiceReference("com.acme.pid"), monitorable);
osgiVisitor.setReferences(map);
MonitorAdmin monitorAdmin = new MonitorAdminImpl(logVisitor, common, bundle);
StatusVariable sv = monitorAdmin.getStatusVariable("com.acme.pid/sv.id1");
Assert.assertNotNull(sv);
Assert.assertEquals(0, sv.getInteger());
monitorable.setNewStatusVariableValue("sv.id1", "15");
sv = monitorAdmin.getStatusVariable("com.acme.pid/sv.id1");
Assert.assertNotNull(sv);
Assert.assertEquals(15, sv.getInteger());
try {
monitorAdmin.resetStatusVariable(null);
Assert.fail();
} catch (IllegalArgumentException e) {
}
try {
monitorAdmin.resetStatusVariable("/&%(/=");
Assert.fail();
} catch (IllegalArgumentException e) {
}
try {
monitorAdmin.resetStatusVariable("com.aaa/sv.id");
Assert.fail();
} catch (IllegalArgumentException e) {
}
try {
monitorAdmin.resetStatusVariable("com.acme.pid/sv.id_u");
Assert.fail();
} catch (IllegalArgumentException e) {
}
boolean result = monitorAdmin.resetStatusVariable("com.acme.pid/sv.id1");
Assert.assertTrue(result);
sv = monitorAdmin.getStatusVariable("com.acme.pid/sv.id1");
Assert.assertNotNull(sv);
Assert.assertEquals(0, sv.getInteger());
}