I would like the following to be printed
test1
test2
test3
test4
But I can\'t seem to get the text to the next line.
Plea
Considering you have an empty catch block, it could be that you're getting an exception and hiding it. Remove the catch block and add throw IOException to your method definition so if you're getting an exception you can see it.
catch
throw IOException