|
From: David C. <dc...@us...> - 2005-09-25 17:57:08
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8072/src/org/rubypeople/rdt/internal/launching/tests Modified Files: TC_RunnerLaunching.java Log Message: Converted all 'launchers' to list-based command line construction. Index: TC_RunnerLaunching.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.launching.tests/src/org/rubypeople/rdt/internal/launching/tests/TC_RunnerLaunching.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TC_RunnerLaunching.java 2 Mar 2005 00:53:28 -0000 1.9 --- TC_RunnerLaunching.java 25 Sep 2005 17:56:58 -0000 1.10 *************** *** 5,8 **** --- 5,9 ---- import java.io.OutputStream; import java.util.ArrayList; + import java.util.Arrays; import java.util.List; import java.util.Map; *************** *** 24,28 **** import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.Launch; - import org.eclipse.debug.internal.core.LaunchConfigurationType; import org.rubypeople.eclipse.shams.debug.core.ShamLaunchConfigurationType; import org.rubypeople.eclipse.testutils.ResourceTools; --- 25,28 ---- *************** *** 36,41 **** private final static String PROJECT_NAME = "Simple Project"; private final static String RUBY_LIB_DIR = "someRubyDir"; // dir inside project ! private final static String RUBY_FILE_NAME = "rubyFile.rb"; ! private final static String INTERPRETER_ARGUMENTS = "interpreterArguments"; private final static String PROGRAM_ARGUMENTS = "programArguments"; private final static String RUBY_COMMAND = "rubyw"; --- 36,41 ---- private final static String PROJECT_NAME = "Simple Project"; private final static String RUBY_LIB_DIR = "someRubyDir"; // dir inside project ! private final static String RUBY_FILE_NAME = "rubyFile.rb"; ! private final static String INTERPRETER_ARGUMENTS = "interpreter Arguments"; private final static String PROGRAM_ARGUMENTS = "programArguments"; private final static String RUBY_COMMAND = "rubyw"; *************** *** 48,56 **** } ! protected String getCommandLine(IProject project, boolean debug) { ! String quotation = BootLoader.getOS().equals(BootLoader.OS_WIN32) ? "\"" : ""; ! StringBuffer commandLine = new StringBuffer(); if (debug) { ! commandLine.append(" -reclipseDebug"); } if (debug) { --- 48,55 ---- } ! protected List getCommandLine(IProject project, boolean debug) { ! List commandLine = new ArrayList(); if (debug) { ! commandLine.add("-reclipseDebug"); } if (debug) { *************** *** 59,76 **** dirOfRubyDebuggerFile = dirOfRubyDebuggerFile.substring(1) ; } ! commandLine.append( ! " -I " ! + quotation ! + dirOfRubyDebuggerFile ! + quotation); } ! commandLine.append(" -I " + quotation + project.getLocation().toOSString() + quotation); ! commandLine.append(" -I " + quotation + project.getLocation().toOSString() + File.separator + RUBY_LIB_DIR + quotation) ; ! commandLine.append(" " + INTERPRETER_ARGUMENTS + " -- "); // use always forward slashes for path relative to project dir ! commandLine.append( ! quotation + project.getLocation().toOSString() + "/" + RUBY_LIB_DIR + "/" + RUBY_FILE_NAME + quotation); ! commandLine.append(" " + PROGRAM_ARGUMENTS); ! return commandLine.toString(); } --- 58,74 ---- dirOfRubyDebuggerFile = dirOfRubyDebuggerFile.substring(1) ; } ! commandLine.add("-I"); ! commandLine.add(dirOfRubyDebuggerFile); } ! commandLine.add("-I"); ! commandLine.add( project.getLocation().toOSString()); ! commandLine.add("-I"); ! commandLine.add(project.getLocation().toOSString() + File.separator + RUBY_LIB_DIR) ; ! commandLine.addAll(Arrays.asList(INTERPRETER_ARGUMENTS.split("\\s+"))); ! commandLine.add("--"); // use always forward slashes for path relative to project dir ! commandLine.add(project.getLocation().toOSString() + "/" + RUBY_LIB_DIR + "/" + RUBY_FILE_NAME); ! commandLine.add(PROGRAM_ARGUMENTS); ! return commandLine; } *************** *** 107,111 **** assertEquals("One process has been spawned", 1, launch.getProcesses().length); ! assertEquals("Assembled command line.", getCommandLine(project, debug), interpreter.getArguments()); assertEquals( "Process label.", --- 105,111 ---- assertEquals("One process has been spawned", 1, launch.getProcesses().length); ! List expected = getCommandLine(project, debug); ! List actual = interpreter.getArguments(); ! assertEquals("Assembled command line.", expected, actual); assertEquals( "Process label.", *************** *** 239,244 **** super(aName, validInstallLocation); } ! private String arguments; ! public String getArguments() { return arguments; } --- 239,244 ---- super(aName, validInstallLocation); } ! private List arguments; ! public List getArguments() { return arguments; } *************** *** 246,250 **** return RUBY_COMMAND; } ! public Process exec(String args, File workingDirectory) { arguments = args; return new ShamProcess(); --- 246,250 ---- return RUBY_COMMAND; } ! public Process exec(List args, File workingDirectory) { arguments = args; return new ShamProcess(); |