Put the tomatoes in a small pan where they fit snugly. Pour over the oil, and add the garlic and rosemary. They should be about half covered. Season, and add the lid. Cook over a low heat for 30-40 mins until soft but still holding their shape.
Heat the oil in saucepan, and fry the onion for 10 mins. Fry the garlic for 2 mins, then tip in the beans with their liquid, stock and herbs. Half fill the cans with water and add this, too. Simmer uncovered for 20-30 mins until thickened and creamy, stirring frequently. Season well.
Spoon some of the tomato oil into a frying pan, and fry the sourdough for 2 mins on each side until golden and crisp. Serve the tomatoes over the beans, and a little more of the tomato oil. Add fresh basil, or thyme. Serve with olive oil toasts.
