Clayton McMahon (19) is alleged to have charged at the officer, punched him and kicked him after trying to encourage his fellow inmates not to follow his orders during a routine morning cell cleanout.
He denies the charge and the case against him was adjourned at Dublin District Court.
McMahon, of Clogher Road, Crumlin pleaded not guilty to assaulting Officer Graham Kelly at St Patrick's on April 10, 2011.
Officer Kelly told the court he was on duty unlocking cells for breakfast. The accused was "somewhat disagreeable and irate", throwing rubbish from his cell on to the landing.
At around 10am, he ordered inmates to clear the landing and go out to the yard.
McMahon said he would go when he was ready. Officer Kelly alleged the defendant shouted at other inmates not to listen to him and disobey him.
"Eventually, he turned and came towards me with his fists balled," he continued. "I feared he was going to strike me, at which point I turned into the cell and tried to restrain him." They fell onto the bed and the defendant punched him in the eye and kicked him in the testicles, he said.
Cross-examined by Diana Stuart, Officer Kelly accepted that he may have ended up on the bed by slipping on the floor. He also accepted he could not be sure it was the accused who had kicked him in the groin.
The case continues.