Buggy code:
public class TestHTMLParser extends JMeterTestCase { private static final Logger log = LoggingManager . getLoggerForClass ( ) ; public TestHTMLParser ( String arg0 ) { } private String parserName ; private int testNumber = 0 ; public TestHTMLParser ( String name , int test ) { } public TestHTMLParser ( String name , String parser , int test ) { } private static class StaticTestClass { private StaticTestClass ( ) { } } private class TestClass { private TestClass ( ) { } } private static class TestData { private String fileName ; private String baseURL ; private String expectedSet ; private String expectedList ; private TestData ( String f , String b , String s , String l ) { } } private static final String [ ] PARSERS = new String [ ] { "org.apache.jmeter.protocol.http.parser.HtmlParserHTMLParser" , "org.apache.jmeter.protocol.http.parser.JTidyHTMLParser" , "org.apache.jmeter.protocol.http.parser.RegexpHTMLParser" } ; private static final TestHTMLParser . TestData [ ] TESTS = new TestHTMLParser . TestData [ ] { new TestHTMLParser . TestData ( "testfiles//HTMLParserTestCase.html" , "http:////localhost//mydir//myfile.html" , "testfiles//HTMLParserTestCase.set" , "testfiles//HTMLParserTestCase.all" ) , new TestHTMLParser . TestData ( "testfiles//HTMLParserTestCaseWithBaseHRef.html" , "http:////localhost//mydir//myfile.html" , "testfiles//HTMLParserTestCaseBase.set" , "testfiles//HTMLParserTestCaseBase.all" ) , new TestHTMLParser . TestData ( "testfiles//HTMLParserTestCaseWithBaseHRef2.html" , "http:////localhost//mydir//myfile.html" , "testfiles//HTMLParserTestCaseBase.set" , "testfiles//HTMLParserTestCaseBase.all" ) , new TestHTMLParser . TestData ( "testfiles//HTMLParserTestCaseWithMissingBaseHRef.html" , "http:////localhost//mydir//images//myfile.html" , "testfiles//HTMLParserTestCaseBase.set" , "testfiles//HTMLParserTestCaseBase.all" ) , new TestHTMLParser . TestData ( "testfiles//HTMLParserTestCase2.html" , "http:" , "" , "" ) , new TestHTMLParser . TestData ( "testfiles//HTMLParserTestCase3.html" , "http:" , "" , "" ) , new TestHTMLParser . TestData ( "testfiles//HTMLParserTestCaseWithComments.html" , "http:////localhost//mydir//myfile.html" , "testfiles//HTMLParserTestCaseBase.set" , "testfiles//HTMLParserTestCaseBase.all" ) , new TestHTMLParser . TestData ( "testfiles//HTMLScript.html" , "http:////localhost//" , "testfiles//HTMLScript.set" , "testfiles//HTMLScript.all" ) , new TestHTMLParser . TestData ( "testfiles//HTMLParserTestFrames.html" , "http:////localhost//" , "testfiles//HTMLParserTestFrames.all" , "testfiles//HTMLParserTestFrames.all" ) , new TestHTMLParser . TestData ( "testfiles//HTMLParserTestFile_2.html" , "file:HTMLParserTestFile_2.html" , "testfiles//HTMLParserTestFile_2.all" , "testfiles//HTMLParserTestFile_2.all" ) } ; public static Test suite ( ) { } public void testParserProperty ( ) throws Exception { } public void testDefaultParser ( ) throws Exception { } public void testParserDefault ( ) throws Exception { } public void testParserMissing ( ) throws Exception { } public void testNotParser ( ) throws Exception { } public void testNotCreatable ( ) throws Exception { } public void testNotCreatableStatic ( ) throws Exception { } public void testParserSet ( ) throws Exception { } public void testParserList ( ) throws Exception { } private static void filetest ( HTMLParser p , String file , String url , String resultFile , Collection < URLString > c , boolean orderMatters ) throws Exception { String parserName = p . getClass ( ) . getName ( ) . substring ( "org.apache.jmeter.protocol.http.parser." . length ( ) ) ; <START_BUG> String fname = file . substring ( ( ( file . indexOf ( "//" ) ) + 1 ) ) ; <END_BUG> TestHTMLParser . log . debug ( ( "file<seq2seq4repair_space>" + file ) ) ; File f = findTestFile ( file ) ; byte [ ] buffer = new byte [ ( ( int ) ( f . length ( ) ) ) ] ; InputStream is = null ; try { is = new FileInputStream ( f ) ; int len = is . read ( buffer ) ; assertEquals ( len , buffer . length ) ; } finally { IOUtils . closeQuietly ( is ) ; } Iterator < URL > result ; if ( c == null ) { result = p . getEmbeddedResourceURLs ( buffer , new URL ( url ) , System . getProperty ( "file.encoding" ) ) ; } else { result = p . getEmbeddedResourceURLs ( buffer , new URL ( url ) , c , System . getProperty ( "file.encoding" ) ) ; } Iterator < String > expected ; if ( orderMatters ) { expected = TestHTMLParser . getFile ( resultFile ) . iterator ( ) ; } else { expected = new TreeSet < String > ( TestHTMLParser . getFile ( resultFile ) ) . iterator ( ) ; TreeSet < URL > temp = new TreeSet < URL > ( new Comparator < Object > ( ) { public int compare ( Object o1 , Object o2 ) { return o1 . toString ( ) . compareTo ( o2 . toString ( ) ) ; } } ) ; while ( result . hasNext ( ) ) { temp . add ( result . next ( ) ) ; } result = temp . iterator ( ) ; } while ( expected . hasNext ( ) ) { Object next = expected . next ( ) ; assertTrue ( ( ( ( ( fname + "::" ) + parserName ) + "::Expecting<seq2seq4repair_space>another<seq2seq4repair_space>result<seq2seq4repair_space>" ) + next ) , result . hasNext ( ) ) ; try { assertEquals ( ( ( ( fname + "::" ) + parserName ) + "(next)" ) , next , result . next ( ) . toString ( ) ) ; } catch ( ClassCastException e ) { fail ( ( ( ( ( fname + "::" ) + parserName ) + "::Expected<seq2seq4repair_space>URL,<seq2seq4repair_space>but<seq2seq4repair_space>got<seq2seq4repair_space>" ) + ( e . toString ( ) ) ) ) ; } } assertFalse ( ( ( ( fname + "::" ) + parserName ) + "::Should<seq2seq4repair_space>have<seq2seq4repair_space>reached<seq2seq4repair_space>the<seq2seq4repair_space>end<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>results" ) , result . hasNext ( ) ) ; } private static List < String > getFile ( String file ) throws Exception { } }

Fix:
String fname = file . substring ( ( ( file . indexOf ( '//' ) ) + 1 ) ) ;