-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.7.0
-
Component/s: None
-
Labels:
-
Story Points:2
Issue:
Notification listener app event() is not getting called when notification is send from test app.
1) schemaRegistry is null - fixed
2) Exception in ytb - not fixed
Test steps:
1) Activate yms, ymstest & restconf apps
2) Run testcase testNbiNotification
onos> app activate org.onosproject.yms
onos> app activate org.onosproject.ymstest
onos> app activate org.onosproject.restconf
onos> yms-test testNbiNotification
Test code snippet:
MultiNotificationManger multiNotificationManger = new MultiNotificationManger();
ymsService.registerService(multiNotificationManger, MultiNotification.class, null);
print("Registered Service");
MultiNotificationListener multiNotificationListener = new MultiNotificationListener();
YangNotificationService yangNotificationService = ymsService.getYangNotificationService();
yangNotificationService.addListener(multiNotificationListener);
print("Added notification listener");
multiNotificationManger.sendNotification();
print("Notification Send");
Test output:
— schemaRegistry is null - fixed ----
https://github.com/GauravAgrawal-Huawei/ymsm/commit/05e3031eb265d2498bda45051aaa093a98a2c21a
— exception not fixed ----
onos> display
2016-09-05 09:53:41,474 | WARN | er-event-handler | YangNotificationManager | 170 - org.onosproject.onos-app-yms - 1.7.0.SNAPSHOT | Failed to process MultiNotificationEvent
java.lang.NullPointerException
at org.onosproject.yms.app.ytb.YdtBuilderFromYo.getYangObjectOfNotification(YdtBuilderFromYo.java:807)[170:org.onosproject.onos-app-yms:1.7.0.SNAPSHOT]
at org.onosproject.yms.app.ytb.YdtBuilderFromYo.createModuleNodeInYdt(YdtBuilderFromYo.java:222)[170:org.onosproject.onos-app-yms:1.7.0.SNAPSHOT]
at org.onosproject.yms.app.ytb.DefaultYangTreeBuilder.getYdtForNotification(DefaultYangTreeBuilder.java:75)
at org.onosproject.yms.app.ynh.YangNotificationManager$YnhAbstractListener.lambda$event$0(YangNotificationManager.java:118)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_101]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_101]
Confimed and fixed 1st issue by: Gaurav