|
From: <caw...@us...> - 2007-05-16 16:58:34
|
Revision: 2490
http://svn.sourceforge.net/rubyeclipse/?rev=2490&view=rev
Author: cawilliams
Date: 2007-05-16 09:58:11 -0700 (Wed, 16 May 2007)
Log Message:
-----------
fix launching Test::Unit
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceFolder.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchConfigurationDelegate.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceFolder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceFolder.java 2007-05-16 16:37:33 UTC (rev 2489)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceFolder.java 2007-05-16 16:58:11 UTC (rev 2490)
@@ -1,5 +1,6 @@
package org.rubypeople.rdt.internal.core;
+import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Map;
@@ -98,7 +99,7 @@
@Override
public String getElementName() {
if (names.length == 0) return "";
- return names[names.length - 1];
+ return Util.concatWith(this.names, File.separatorChar);
}
public boolean containsRubyResources() throws RubyModelException {
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-05-16 16:37:33 UTC (rev 2489)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-05-16 16:58:11 UTC (rev 2490)
@@ -207,13 +207,6 @@
// options like '-client' & '-server' which are required to be the first option
String[] allVMArgs = combineVmArgs(config, fVMInstance);
addArguments(allVMArgs, arguments);
- // FIXME Find a way to set stderr and stdout to sync/auto-flush without messing up value of __FILE__ (becomes absolute which messes up the 'if __FILE__ == $0' idiom)
-// arguments.add("-e");
-// arguments.add("STDOUT.sync=true");
-// arguments.add("-e");
-// arguments.add("STDERR.sync=true");
-// arguments.add("-e");
-// arguments.add("load($0=ARGV.shift)");
String[] lp= config.getLoadPath();
if (lp.length > 0) {
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchConfigurationDelegate.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchConfigurationDelegate.java 2007-05-16 16:37:33 UTC (rev 2489)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchConfigurationDelegate.java 2007-05-16 16:58:11 UTC (rev 2490)
@@ -46,7 +46,7 @@
// setDefaultSourceLocator(launch, configuration);
launch.setAttribute(TestunitPlugin.TESTUNIT_PORT_ATTR, Integer.toString(getPort()));
- if (testTypes.length > 0) launch.setAttribute(TESTTYPE_ATTR, testTypes[0].getHandleIdentifier());
+ if (testTypes != null && testTypes.length > 0) launch.setAttribute(TESTTYPE_ATTR, testTypes[0].getHandleIdentifier());
super.launch(configuration, mode, launch, monitor);
@@ -65,7 +65,11 @@
if (containerHandle.length() > 0) {
IRubyElement element = RubyCore.create(containerHandle);
IRubyScript script = (IRubyScript) element;
- if (script != null) return new IType[] { script.findPrimaryType() };
+ if (script != null) {
+ IType type = script.findPrimaryType();
+ if (type != null)
+ return new IType[] { type };
+ }
}
String testTypeName= configuration.getAttribute(TESTTYPE_ATTR, (String) null);
if (testTypeName != null && testTypeName.length() > 0) {
@@ -143,8 +147,10 @@
String container = configuration.getAttribute(TestUnitLaunchConfigurationDelegate.LAUNCH_CONTAINER_ATTR, "");
IRubyElement element = (IRubyElement) RubyCore.create(container);
if (element != null)
- return element.getResource().getLocation().toFile().getAbsolutePath();
- // otherwise it may be an actual path!
+ container = element.getResource().getProjectRelativePath().toOSString();
+ if (!container.startsWith("\"") && container.indexOf(' ') != -1) {
+ container = '"' + container + '"';
+ }
return container;
}
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|