In this test we just make an error in js and try to check whether the error dialogue appears. Actually this test should be visually verified, but if an error dialogue appears an exception should thrown. Thats why i just used 
"resourceFileStream.close();"