Buggy code:
private static void setDirectories ( String scriptName , Properties sp ) throws FileNotFoundException , IOException , ClassNotFoundException { } private static void getProperties ( Properties sp ) throws Exception { } private static String createPropString ( ) throws FileNotFoundException , IOException , ClassNotFoundException { } public static String setTestJavaFlags ( String tflags ) { } private static void loadProps ( Properties p , File f ) throws Exception { } private static void mergeProps ( Properties to , Properties from ) { } private static void frameworkProtocol ( Properties p ) throws Exception { } private static void encryptionProtocol ( Properties p ) throws Exception { } private static void cleanupBaseDir ( File baseDir ) { } private static void doCleanup ( String javaVersion ) throws IOException { } public static void deleteFile ( File f ) { } static void addToFailures ( String testName ) throws IOException { } static void addToSuccesses ( String testName ) throws IOException { } static void addToListFile ( String fileName , String testName ) throws IOException { } static void appendStderr ( BufferedOutputStream bos , InputStream is ) throws IOException { } static void verifyTestType ( ) throws FileNotFoundException , IOException , ClassNotFoundException { } public static void addStandardTestJvmProps ( Vector testJvmProps , String derbySystemHome , String userDirName , jvm jvm ) { } private static String [ ] buildTestCommand ( String propString , String systemHome , String scriptPath ) throws FileNotFoundException , IOException , Exception { } private static void execTestProcess ( String [ ] testCmd ) throws Exception { } private static void execTestNoProcess ( Properties sysProp , String systemHome , String propString , String scriptPath ) throws Exception { String olduserdir = ( ( String ) ( sysProp . get ( "user.dir" ) ) ) ; Properties ptmp = System . getProperties ( ) ; ptmp . put ( "derby.system.home" , systemHome ) ; ptmp . put ( "derby.infolog.append" , "true" ) ; System . setProperties ( ptmp ) ; PrintStream stdout = System . out ; PrintStream stderr = System . err ; String pathStr = "" ; try { pathStr = RunTest . tmpOutFile . getCanonicalPath ( ) . replace ( File . separatorChar , RunTest . fileSep ) ; } catch ( IOException e ) { FileWriter fw = new FileWriter ( RunTest . tmpOutFile ) ; fw . close ( ) ; pathStr = RunTest . tmpOutFile . getCanonicalPath ( ) . replace ( File . separatorChar , RunTest . fileSep ) ; } PrintStream ps = new PrintStream ( new FileOutputStream ( pathStr ) , true ) ; System . setOut ( ps ) ; System . setErr ( ps ) ; if ( RunTest . testType . equals ( "sql" ) ) { String [ ] ijarg = new String [ 3 ] ; ijarg [ 0 ] = "-p" ; ijarg [ 1 ] = propString ; ijarg [ 2 ] = scriptPath ; RunIJ ij = new RunIJ ( ijarg ) ; Thread ijThread = new Thread ( ij ) ; try { ijThread . start ( ) ; if ( ( RunTest . timeout ) < 0 ) { ijThread . join ( ) ; } else { ijThread . join ( ( ( ( RunTest . timeout ) * 60 ) * 1000 ) ) ; } } catch ( Exception e ) { System . out . println ( ( "Aiiie!<seq2seq4repair_space>Got<seq2seq4repair_space>some<seq2seq4repair_space>kind<seq2seq4repair_space>of<seq2seq4repair_space>exception<seq2seq4repair_space>" + e ) ) ; } if ( ( RunTest . shutdownurl ) != null ) { String [ ] sdargs = new String [ 2 ] ; sdargs [ 0 ] = systemHome ; sdargs [ 1 ] = RunTest . shutdownurl ; shutdown . main ( sdargs ) ; } ptmp = System . getProperties ( ) ; ptmp . put ( "ij.defaultResourcePackage" , "//org//apache//derbyTesting//" ) ; ptmp . put ( "usesystem" , "" ) ; System . setProperties ( ptmp ) ; } else if ( RunTest . testType . equals ( "java" ) ) { sysProp . put ( "user.dir" , RunTest . outDir . getCanonicalPath ( ) ) ; <START_BUG> RunTest . javaPath = "org.apache.derbyTesting." + ( RunTest . testDirName ) ; <END_BUG> String [ ] args = new String [ 2 ] ; args [ 0 ] = "-p" ; args [ 1 ] = propString ; Class [ ] classArray = new Class [ 1 ] ; classArray [ 0 ] = args . getClass ( ) ; String testName = ( ( RunTest . javaPath ) + "." ) + ( RunTest . testBase ) ; Class JavaTest = Class . forName ( testName ) ; Method testMain = JavaTest . getMethod ( "main" , classArray ) ; Object [ ] argObj = new Object [ 1 ] ; argObj [ 0 ] = args ; RunClass testObject = new RunClass ( JavaTest , testMain , argObj ) ; Thread testThread = new Thread ( testObject ) ; try { testThread . start ( ) ; if ( ( RunTest . timeout ) < 0 ) { testThread . join ( ) ; } else { testThread . join ( ( ( RunTest . timeout ) * 1000 ) ) ; } } catch ( Exception e ) { System . out . println ( ( "Exception<seq2seq4repair_space>upon<seq2seq4repair_space>invoking<seq2seq4repair_space>test..." + e ) ) ; e . printStackTrace ( ) ; } try { DriverManager . getConnection ( "jdbc:derby:;shutdown=true" ) ; } catch ( SQLException e ) { } sysProp . put ( "user.dir" , olduserdir ) ; } else if ( RunTest . testType . equals ( "multi" ) ) { System . out . println ( ( "scriptiflename<seq2seq4repair_space>is:<seq2seq4repair_space>later<seq2seq4repair_space>" + ( RunTest . scriptFileName ) ) ) ; String [ ] args = new String [ 5 ] ; args [ 0 ] = RunTest . scriptFileName ; args [ 1 ] = "-i" ; args [ 2 ] = RunTest . mtestdir ;

Fix:
RunTest . javaPath = "org.apache.derbyTesting.functionTests.tests." + ( RunTest . testDirName ) ;