William Gowan, 38, had received details of driving test candidates weeks in advance.
Gowan, from Ardminnan Road, Portaferry, County Down, pleaded guilty to six counts of misconduct.
He received details of 21 candidates sitting driving tests before their test dates. The court was told texts had been received from two mobile phones.
The court also heard that Gowan had run to the toilet with his phone in his hand when the police arrived to speak to him.
Sentencing him, the judge said Gowan had betrayed the trust placed in him.
He said the offence would fully deserve a custodial sentence, but giving him some credit for his guilty plea and taking into account his clean record and low risk of re-offending, he was prepared to mark this "quite disgraceful behaviour" with a non-custodial sentence.
Gowan received the maximum community service order of 240 hours. The judge warned him he was escaping prison "by the skin of his teeth" and would not get a second chance.
A driving examiner has been sentenced to 240 hours community service for misconduct in public office.