|
From: Markus B. <mba...@us...> - 2005-10-04 22:53:28
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22510/src/org/rubypeople/rdt/testunit Modified Files: TestunitPlugin.java Log Message: merged from SRB_0-6-1_3 Index: TestunitPlugin.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/TestunitPlugin.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestunitPlugin.java 12 Mar 2005 15:29:58 -0000 1.7 --- TestunitPlugin.java 4 Oct 2005 22:53:19 -0000 1.8 *************** *** 30,34 **** import org.rubypeople.rdt.core.IType; import org.rubypeople.rdt.core.RubyCore; - import org.rubypeople.rdt.testunit.launcher.SocketUtil; import org.rubypeople.rdt.testunit.launcher.TestUnitLaunchConfigurationDelegate; import org.rubypeople.rdt.testunit.views.TestUnitView; --- 30,33 ---- *************** *** 40,44 **** public static final String PLUGIN_ID = "org.rubypeople.rdt.testunit"; //$NON-NLS-1$ ! //The shared instance. private static TestunitPlugin plugin; --- 39,43 ---- public static final String PLUGIN_ID = "org.rubypeople.rdt.testunit"; //$NON-NLS-1$ ! public static final String TESTUNIT_PORT_ATTR = "org.rubypeople.rdt.testunit.port"; //$NON-NLS-1$ //The shared instance. private static TestunitPlugin plugin; *************** *** 246,282 **** ILaunchConfiguration config = launch.getLaunchConfiguration(); IType launchedType= null; - int port = -1; if (config != null) { ! try { ! // test whether the launch defines the TestUnit port attribute ! port = config.getAttribute(TestUnitLaunchConfigurationDelegate.PORT_ATTR, -1); ! String typeStr= launch.getAttribute(TestUnitLaunchConfigurationDelegate.TESTTYPE_ATTR); ! //String fileName= launch.getAttribute(TestUnitLaunchConfigurationDelegate.LAUNCH_CONTAINER_ATTR); ! ! if (typeStr != null) { ! // FIXME Get the handle on the test type from the model somehow! ! // IFile script = RubyCore.find(fileName); ! // if (element instanceof IRubyType) ! // launchedType= (IRubyType) element; ! } ! } catch (CoreException e) { ! e.printStackTrace(); } - } - if(port == -1) { - log("Failed to get a port from the launch! Trying to generate a new one."); - port = SocketUtil.findFreePort(); - } - fTrackedLaunches.remove(launch); - if (port == -1) { - log("Failed to generate a port!"); - return; } final IType finalType= launchedType; ! final int finalPort = port; getDisplay().asyncExec(new Runnable() { - public void run() { connectTestRunner(launch, finalType, finalPort); --- 245,266 ---- ILaunchConfiguration config = launch.getLaunchConfiguration(); IType launchedType= null; if (config != null) { ! ! String typeStr = launch.getAttribute(TestUnitLaunchConfigurationDelegate.TESTTYPE_ATTR); ! // String fileName= launch.getAttribute(TestUnitLaunchConfigurationDelegate.LAUNCH_CONTAINER_ATTR); ! ! if (typeStr != null) { ! // FIXME Get the handle on the test type from the model somehow! ! // IFile script = RubyCore.find(fileName); ! // if (element instanceof IRubyType) ! // launchedType= (IRubyType) element; } } + fTrackedLaunches.remove(launch); final IType finalType= launchedType; ! final int finalPort = Integer.parseInt(launch.getAttribute(TESTUNIT_PORT_ATTR)) ; getDisplay().asyncExec(new Runnable() { public void run() { connectTestRunner(launch, finalType, finalPort); |