@Test public void successCausesExitCodeOf0() throws Exception {
runClass(getClass().getName() + "$Succeed", 0);
}
private void runClass(String className, int returnCode) {
TestSystem system= new TestSystem();
JUnitCore.runMainAndExit(system, className);
assertEquals(returnCode, system.fCode);
}