Ex-cop testifies in his own defense over shooting case