Printing JUnit test results in file by changing and using the 'out' static variable of 'System' class
Looks good enough, but there's some improvements in the io API you're not using. Consider:

try (OutputStream outFile = Files.newOutputStream(Paths.get("result.txt"), 
       StandardOpenOption.WRITE, StandardOpenOption.CREATE);
     PrintStream newSysOut = new PrintStream(outFile)) {
     System.setOut(newSysOut);
     Result result = JUnitCore.runClasses(TestSuite.class);
     printResults(result);
} catch (IOException ex) {
     // your code here
} finally {
     System.setOut(oldPrintStream);
}


This should give you more fine-grained Exceptions when your operations fail (not that I'm using it here).
Also you don't need to close the Resources you use yourself, because of the try-with-resources-block.  

Small additional note: Your comments are extraneous for this example. I'd suggest removing them.