For Cain, it was his second time facing live batters while Hudson was doing so for the first time.
"Both of them threw well," Bochy said. "I thought Huddy was really impressive for the first time facing hitters. He's further than I thought. He'll face hitters again, and Matt looked fine. Matt, that's his second time facing hitters. I believe he's going to pitch in a game his next outing."
Cain is recovering from elbow and ankle surgery, while Hudson is working his way back from offseason ankle surgery.
William Boor is a reporter for MLB.com. Follow him on Twitter at @wboor. This story was not subject to the approval of Major League Baseball or its clubs.