Buggy code:
public class TestFileServer extends JMeterTestCase { private static final FileServer FS = FileServer . getFileServer ( ) ; public TestFileServer ( ) { } public TestFileServer ( String arg0 ) { } @ Override public void tearDown ( ) throws IOException { } public void testopen ( ) throws Exception { try { TestFileServer . FS . readLine ( "test" ) ; fail ( "Expected<seq2seq4repair_space>IOException" ) ; } catch ( IOException ignored ) { } try { TestFileServer . FS . write ( "test" , "" ) ; fail ( "Expected<seq2seq4repair_space>IOException" ) ; } catch ( IOException ignored ) { } assertFalse ( "Should<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>any<seq2seq4repair_space>files<seq2seq4repair_space>open" , TestFileServer . FS . filesOpen ( ) ) ; TestFileServer . FS . closeFile ( "xxx" ) ; assertFalse ( "Should<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>any<seq2seq4repair_space>files<seq2seq4repair_space>open" , TestFileServer . FS . filesOpen ( ) ) ; String infile = findTestPath ( "testfiles//test.csv" ) ; TestFileServer . FS . reserveFile ( infile ) ; assertFalse ( "Should<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>any<seq2seq4repair_space>files<seq2seq4repair_space>open" , TestFileServer . FS . filesOpen ( ) ) ; assertEquals ( "a1,b1,c1,d1" , TestFileServer . FS . readLine ( infile ) ) ; assertTrue ( "Should<seq2seq4repair_space>have<seq2seq4repair_space>some<seq2seq4repair_space>files<seq2seq4repair_space>open" , TestFileServer . FS . filesOpen ( ) ) ; assertNotNull ( TestFileServer . FS . readLine ( infile ) ) ; assertNotNull ( TestFileServer . FS . readLine ( infile ) ) ; assertNotNull ( TestFileServer . FS . readLine ( infile ) ) ; assertEquals ( "a1,b1,c1,d1" , TestFileServer . FS . readLine ( infile ) ) ; assertNotNull ( TestFileServer . FS . readLine ( infile ) ) ; try { TestFileServer . FS . write ( infile , "" ) ; fail ( "Expected<seq2seq4repair_space>IOException" ) ; } catch ( IOException ignored ) { } TestFileServer . FS . closeFile ( infile ) ; assertFalse ( "Should<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>any<seq2seq4repair_space>files<seq2seq4repair_space>open" , TestFileServer . FS . filesOpen ( ) ) ; assertEquals ( "a1,b1,c1,d1" , TestFileServer . FS . readLine ( infile ) ) ; assertTrue ( "Should<seq2seq4repair_space>have<seq2seq4repair_space>some<seq2seq4repair_space>files<seq2seq4repair_space>open" , TestFileServer . FS . filesOpen ( ) ) ; TestFileServer . FS . closeFiles ( ) ; assertFalse ( "Should<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>any<seq2seq4repair_space>files<seq2seq4repair_space>open" , TestFileServer . FS . filesOpen ( ) ) ; try { TestFileServer . FS . readLine ( infile ) ; fail ( "Expected<seq2seq4repair_space>IOException" ) ; } catch ( IOException ignored ) { } <START_BUG> infile = findTestPath ( "//testfiles//test.csv" ) ; <END_BUG> TestFileServer . FS . reserveFile ( infile ) ; assertFalse ( "Should<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>any<seq2seq4repair_space>files<seq2seq4repair_space>open" , TestFileServer . FS . filesOpen ( ) ) ; assertEquals ( "a1,b1,c1,d1" , TestFileServer . FS . readLine ( infile ) ) ; try { TestFileServer . FS . setBasedir ( "x" ) ; fail ( "Expected<seq2seq4repair_space>IOException" ) ; } catch ( IOException ignored ) { } TestFileServer . FS . closeFile ( infile ) ; TestFileServer . FS . setBasedir ( "y" ) ; TestFileServer . FS . closeFiles ( ) ; TestFileServer . FS . setBasedir ( System . getProperty ( "user.dir" ) ) ; } }

Fix:
infile = findTestPath ( "testfiles//test.csv" ) ;