/** * Executes the test using the current classloader that created the instance of the JUnit Runner. The result is * serialized to transfer the result across classloader boundaries. * * @param testClass * the class to be executed * * @return a binary representation of the {@link org.junit.runner.Result} * * @throws Exception * if the test execution or result serialization failed. */ public byte[] run(Class<?> testClass) throws Exception { final Computer computer = new Computer(); final JUnitCore core = new JUnitCore(); return new ResultHelper().serialize(core.run(computer, testClass)); }