A foul-mouthed Sunderland man made a rookie policeman reconsider his career choice by firing vile racist abuse at him, a court heard.