Add test case for scheduler.addPeriodicEvent.