Running shorter races can be an excellent method of training for ultras. The races act as a quality training run and allow you to go through your pre-race routine. If the race is shorter, like a 5k, it will serve as good speedwork. If it is longer, like a half marathon, it will serve as a good long run.
Another great technique is to do a long run by running a race course prior to the race, then running the race afterward. I learned this technique from my friend Phil Stapert. He uses this idea to train for 100 milers.
This method can be especially useful if the race is run on the same course as your ultra. Check with the race director. They will usually be familiar with other races run on the same trails or roads