Put stdout capture in the base test class.

Change-Id: I829b10fdae4def7664f71f4e6f835577075fefcc