You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
(41) |
Apr
(9) |
May
|
Jun
|
Jul
(39) |
Aug
(38) |
Sep
(135) |
Oct
(220) |
Nov
(75) |
Dec
(74) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(44) |
Feb
(160) |
Mar
(49) |
Apr
(69) |
May
(40) |
Jun
(52) |
Jul
(47) |
Aug
(51) |
Sep
(19) |
Oct
(22) |
Nov
(36) |
Dec
(76) |
| 2007 |
Jan
(154) |
Feb
(165) |
Mar
(186) |
Apr
(143) |
May
(175) |
Jun
(133) |
Jul
(203) |
Aug
(177) |
Sep
(136) |
Oct
|
Nov
|
Dec
|
|
From: Markus B. <mba...@us...> - 2005-10-06 23:30:07
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21432/src/org/rubypeople/rdt/debug/core/tests Modified Files: TC_DebuggerCommunicationTest.java TC_DebuggerProxyTest.java Log Message: RubyExceptionBreakpoints / catchpoints functionality added Index: TC_DebuggerProxyTest.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/TC_DebuggerProxyTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TC_DebuggerProxyTest.java 21 Jan 2003 13:30:13 -0000 1.2 --- TC_DebuggerProxyTest.java 6 Oct 2005 23:29:56 -0000 1.3 *************** *** 1,4 **** --- 1,6 ---- package org.rubypeople.rdt.debug.core.tests; + import java.io.BufferedReader; + import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; *************** *** 9,13 **** --- 11,17 ---- import junit.framework.TestCase; + import org.eclipse.core.runtime.CoreException; import org.rubypeople.rdt.internal.debug.core.RubyDebuggerProxy; + import org.rubypeople.rdt.internal.debug.core.RubyExceptionBreakpoint; import org.rubypeople.rdt.internal.debug.core.model.ThreadInfo; import org.xmlpull.v1.XmlPullParser; *************** *** 18,21 **** --- 22,26 ---- private RubyDebuggerProxy proxy ; private TestRubyDebugTarget target ; + private BufferedReader proxyOutputReader ; public TC_DebuggerProxyTest(String name) { *************** *** 40,47 **** } public void setUp() throws Exception { target = new TestRubyDebugTarget() ; proxy = new RubyDebuggerProxy(target) ; ! proxy.setWriter(new PrintWriter(new OutputStreamWriter(System.out))) ; XmlPullParserFactory factory = XmlPullParserFactory.newInstance("org.kxml2.io.KXmlParser,org.kxml2.io.KXmlSerializer", null); XmlPullParser xpp = factory.newPullParser(); --- 45,60 ---- } + public String getLineFromDebuggerProxy() throws IOException { + + return proxyOutputReader.readLine() ; + } + public void setUp() throws Exception { target = new TestRubyDebugTarget() ; proxy = new RubyDebuggerProxy(target) ; ! PipedInputStream pipedInputStream = new PipedInputStream() ; ! PipedOutputStream pipedOutputStream = new PipedOutputStream(pipedInputStream) ; ! ! proxy.setWriter(new PrintWriter(pipedOutputStream)) ; XmlPullParserFactory factory = XmlPullParserFactory.newInstance("org.kxml2.io.KXmlParser,org.kxml2.io.KXmlSerializer", null); XmlPullParser xpp = factory.newPullParser(); *************** *** 51,55 **** proxy.setXpp(xpp) ; proxy.startRubyLoop() ; ! writer = new PrintWriter(new OutputStreamWriter(outputStream)) ; } --- 64,69 ---- proxy.setXpp(xpp) ; proxy.startRubyLoop() ; ! writer = new PrintWriter(new OutputStreamWriter(outputStream)) ; ! proxyOutputReader = new BufferedReader(new InputStreamReader(pipedInputStream)) ; } *************** *** 78,80 **** --- 92,102 ---- } + + public void testExceptionBreakpoint() throws IOException, CoreException { + RubyExceptionBreakpoint rubyExceptionBreakpoint = new RubyExceptionBreakpoint("MyStandardError") ; + proxy.addBreakpoint( rubyExceptionBreakpoint ) ; + proxy.getWriter().flush() ; + assertEquals("cont", this.getLineFromDebuggerProxy()) ; + assertEquals("catch MyStandardError", this.getLineFromDebuggerProxy()) ; + } } Index: TC_DebuggerCommunicationTest.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/TC_DebuggerCommunicationTest.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** TC_DebuggerCommunicationTest.java 1 Oct 2005 23:10:38 -0000 1.37 --- TC_DebuggerCommunicationTest.java 6 Oct 2005 23:29:56 -0000 1.38 *************** *** 48,53 **** //suite.addTest(new TC_DebuggerCommunicationTest("testVariableInstanceNested")); //suite.addTest(new TC_DebuggerCommunicationTest("testStaticVariableInstanceNested")); ! //suite.addTest(new TC_DebuggerCommunicationTest("testException")); ! suite.addTest(new TC_DebuggerCommunicationTest("testNameError")); //suite.addTest(new TC_DebuggerCommunicationTest("testVariablesInObject")); //suite.addTest(new TC_DebuggerCommunicationTest("testStaticVariables")); --- 48,53 ---- //suite.addTest(new TC_DebuggerCommunicationTest("testVariableInstanceNested")); //suite.addTest(new TC_DebuggerCommunicationTest("testStaticVariableInstanceNested")); ! ! //suite.addTest(new TC_DebuggerCommunicationTest("testNameError")); //suite.addTest(new TC_DebuggerCommunicationTest("testVariablesInObject")); //suite.addTest(new TC_DebuggerCommunicationTest("testStaticVariables")); *************** *** 68,71 **** --- 68,74 ---- //suite.addTest(new TC_DebuggerCommunicationTest("testReloadInRequire")) ; //suite.addTest(new TC_DebuggerCommunicationTest("testReloadInStackFrame")) ; + suite.addTest(new TC_DebuggerCommunicationTest("testIgnoreException")); + suite.addTest(new TC_DebuggerCommunicationTest("testExceptionHierarchy")); + suite.addTest(new TC_DebuggerCommunicationTest("testException")); return suite; *************** *** 309,312 **** --- 312,317 ---- public void testException() throws Exception { + // per default catch is set to StandardError, i.e. every raise of a subclass of StandardError + // will suspend createSocket(new String[] { "puts 'a'", "raise 'message \\dir\\file: <xml/>\n<8>'", "puts 'c'" }); sendRuby("cont"); *************** *** 322,325 **** --- 327,353 ---- } + public void testIgnoreException() throws Exception { + createSocket(new String[] { "puts 'a'", "raise 'dont stop'" }); + sendRuby("catch off"); + sendRuby("cont"); + System.out.println("Waiting for the program to finish without suspending at the raise command"); + SuspensionPoint hit = getSuspensionReader().readSuspension(); + assertNull(hit); + } + + public void testExceptionHierarchy() throws Exception { + createSocket(new String[] { "class MyError < StandardError", "end", "begin", "raise StandardError.new", "rescue", "end", "raise MyError.new"}); + sendRuby("catch MyError"); + sendRuby("cont"); + System.out.println("Waiting for the program to finish without suspending at the raise command"); + SuspensionPoint hit = getSuspensionReader().readSuspension(); + assertNotNull(hit); + assertEquals(7, hit.getLine()); + assertEquals("MyError", ((ExceptionSuspensionPoint) hit).getExceptionType()); + sendRuby("cont"); + hit = getSuspensionReader().readSuspension(); + assertNull(hit); + } + public void testBreakpointNeverReached() throws Exception { createSocket(new String[] { "puts 'a'", "puts 'b'", "puts 'c'" }); |
|
From: Markus B. <mba...@us...> - 2005-10-06 23:29:57
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21414/src/org/rubypeople/rdt/internal/debug/core Modified Files: RubyLineBreakpoint.java RubyDebuggerProxy.java Added Files: RubyExceptionBreakpoint.java Log Message: RubyExceptionBreakpoints / catchpoints functionality added --- NEW FILE: RubyExceptionBreakpoint.java --- /* * Author: Markus Barchfeld * * Copyright (c) 2005 RubyPeople. * * This file is part of the Ruby Development Tools (RDT) plugin for eclipse. RDT is * subject to the "Common Public License (CPL) v 1.0". You may not use RDT except in * compliance with the License. For further information see org.rubypeople.rdt/rdt.license. */ package org.rubypeople.rdt.internal.debug.core; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspaceRunnable; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.model.Breakpoint; public class RubyExceptionBreakpoint extends Breakpoint { private static String RUBY_EXCEPTION_ATTR = "RubyException" ; public RubyExceptionBreakpoint(final String exception) throws CoreException { // we need to have a resource, because the marker needs it (BTW: why the hell do // we need a marker for?) // The workspace root is chosen because JavaExceptionsBreakpoints do so as well final IResource resource = ResourcesPlugin.getWorkspace().getRoot() ; IWorkspaceRunnable wr = new IWorkspaceRunnable() { public void run(IProgressMonitor monitor) throws CoreException { setMarker(resource.createMarker(RubyLineBreakpoint.RUBY_BREAKPOINT_MARKER)); getMarker().setAttribute(RUBY_EXCEPTION_ATTR, exception); // REGISTERED ? getMarker().setAttribute(REGISTERED, false); setRegistered(true); setEnabled(true); } }; try { ResourcesPlugin.getWorkspace().run(wr, null); } catch (CoreException e) { throw new DebugException(e.getStatus()); } } /** * Returns the type of marker associated with this type of breakpoints */ public static String getMarkerType() { return RubyLineBreakpoint.RUBY_BREAKPOINT_MARKER; } public String getModelIdentifier() { return "org.rubypeople.rdt.debug"; } public String getException() throws CoreException { return (String) this.ensureMarker().getAttribute(RUBY_EXCEPTION_ATTR); } public void setException(String newValue) throws CoreException { this.ensureMarker().setAttribute(RUBY_EXCEPTION_ATTR, newValue); } } Index: RubyDebuggerProxy.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebuggerProxy.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** RubyDebuggerProxy.java 3 Oct 2005 07:16:25 -0000 1.17 --- RubyDebuggerProxy.java 6 Oct 2005 23:29:49 -0000 1.18 *************** *** 29,33 **** public class RubyDebuggerProxy { ! public final static String DEBUGGER_ACTIVE_KEY = "org.rubypeople.rdt.debug.ui.debuggerActive" ; private Socket socket; private PrintWriter writer; --- 29,34 ---- public class RubyDebuggerProxy { ! ! public final static String DEBUGGER_ACTIVE_KEY = "org.rubypeople.rdt.debug.ui.debuggerActive"; private Socket socket; private PrintWriter writer; *************** *** 41,54 **** debugTarget.setRubyDebuggerProxy(this); } ! public boolean checkConnection() { try { ! return this.getSocket().isConnected() ; ! } ! catch(DebuggerNotFoundException ex) { ! return false ; ! } ! catch(IOException ex) { ! return false ; } } --- 42,53 ---- debugTarget.setRubyDebuggerProxy(this); } ! public boolean checkConnection() { try { ! return this.getSocket().isConnected(); ! } catch (DebuggerNotFoundException ex) { ! return false; ! } catch (IOException ex) { ! return false; } } *************** *** 58,100 **** this.setBreakPoints(); this.startRubyLoop(); ! } catch (IOException e) { ! } } public void stop() { ! if (rubyLoop == null) { ! // only in tests, where no real connection is established ! return; ! } rubyLoop.setShouldStop(); rubyLoop.interrupt(); } - protected Socket acquireSocket() throws IOException { ! int tryCount = 10; for (int i = 0; i < tryCount; i++) { try { socket = new Socket("localhost", 1098); ! return socket ; } catch (IOException e) { try { Thread.sleep(500); ! } catch (InterruptedException e1) { ! } } } ! return null ; ! } ! protected Socket getSocket() throws IOException, DebuggerNotFoundException { ! if (socket == null) { ! socket = acquireSocket() ; ! if (socket == null) { ! throw new DebuggerNotFoundException() ; ! } } return socket; --- 57,94 ---- this.setBreakPoints(); this.startRubyLoop(); ! } catch (IOException e) {} } public void stop() { ! if (rubyLoop == null) { ! // only in tests, where no real connection is established ! return; ! } rubyLoop.setShouldStop(); rubyLoop.interrupt(); } protected Socket acquireSocket() throws IOException { ! int tryCount = 10; for (int i = 0; i < tryCount; i++) { try { socket = new Socket("localhost", 1098); ! return socket; } catch (IOException e) { try { Thread.sleep(500); ! } catch (InterruptedException e1) {} } } ! return null; ! } ! protected Socket getSocket() throws IOException, DebuggerNotFoundException { ! if (socket == null) { ! socket = acquireSocket(); ! if (socket == null) { throw new DebuggerNotFoundException(); } } return socket; *************** *** 141,145 **** IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(IRubyDebugTarget.MODEL_IDENTIFIER); for (int i = 0; i < breakpoints.length; i++) { ! this.addBreakpoint(breakpoints[i]) ; } } --- 135,139 ---- IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(IRubyDebugTarget.MODEL_IDENTIFIER); for (int i = 0; i < breakpoints.length; i++) { ! this.addBreakpoint(breakpoints[i]); } } *************** *** 148,152 **** try { if (breakpoint.isEnabled()) { ! this.printBreakpoint("add", breakpoint.getMarker().getResource().getName(), breakpoint.getMarker().getAttribute(IMarker.LINE_NUMBER, -1) ); } } catch (IOException e) { --- 142,150 ---- try { if (breakpoint.isEnabled()) { ! if (breakpoint instanceof RubyExceptionBreakpoint) { ! this.println("catch " + ((RubyExceptionBreakpoint) breakpoint).getException()); ! } else { ! this.printBreakpoint("add", breakpoint.getMarker().getResource().getName(), breakpoint.getMarker().getAttribute(IMarker.LINE_NUMBER, -1)); ! } } } catch (IOException e) { *************** *** 159,163 **** public void removeBreakpoint(IBreakpoint breakpoint) { try { ! this.printBreakpoint("remove", breakpoint.getMarker().getResource().getName(), breakpoint.getMarker().getAttribute(IMarker.LINE_NUMBER, -1) ); } catch (IOException e) { RdtDebugCorePlugin.log(e); --- 157,165 ---- public void removeBreakpoint(IBreakpoint breakpoint) { try { ! if (breakpoint instanceof RubyExceptionBreakpoint) { ! this.println("catch off"); ! } else { ! this.printBreakpoint("remove", breakpoint.getMarker().getResource().getName(), breakpoint.getMarker().getAttribute(IMarker.LINE_NUMBER, -1)); ! } } catch (IOException e) { RdtDebugCorePlugin.log(e); *************** *** 165,176 **** } ! public void updateBreakpoint(IBreakpoint breakpoint, IMarkerDelta markerDelta) { // line might have changed or enablement/disablement ! try { ! // remove is called even if it has not been added at program start ! // (happens if enablement changed from disabled at program start to enabled) ! this.printBreakpoint("remove", breakpoint.getMarker().getResource().getName(), markerDelta.getAttribute(IMarker.LINE_NUMBER, -1)); ! this.addBreakpoint(breakpoint) ; } catch (IOException e) { RdtDebugCorePlugin.log(e); --- 167,185 ---- } ! public void updateBreakpoint(IBreakpoint breakpoint, IMarkerDelta markerDelta) { // line might have changed or enablement/disablement ! try { ! if (breakpoint instanceof RubyExceptionBreakpoint) { ! // so far we allow only one catch exception ! // catch off must be set in the case that the enablement has changed to disabled ! this.println("catch off"); ! } else { ! // remove is called even if it has not been added at program start ! // (happens if enablement changed from disabled at program start to ! // enabled) ! this.printBreakpoint("remove", breakpoint.getMarker().getResource().getName(), markerDelta.getAttribute(IMarker.LINE_NUMBER, -1)); ! } ! this.addBreakpoint(breakpoint); } catch (IOException e) { RdtDebugCorePlugin.log(e); *************** *** 241,249 **** RubyVariable[] variables = new VariableReader(getMultiReaderStrategy()).readVariables(frame); if (variables.length == 0) { ! return null ; } - else { - return variables[0] ; - } } catch (IOException ioex) { ioex.printStackTrace(); --- 250,257 ---- RubyVariable[] variables = new VariableReader(getMultiReaderStrategy()).readVariables(frame); if (variables.length == 0) { ! return null; ! } else { ! return variables[0]; } } catch (IOException ioex) { ioex.printStackTrace(); *************** *** 252,256 **** } - public void readStepOverEnd(RubyStackFrame stackFrame) { try { --- 260,263 ---- *************** *** 275,279 **** try { this.println("th " + ((RubyThread) stackFrame.getThread()).getId() + " ; step " + stackFrame.getIndex()); ! /*return new SuspensionReader(getMultiReaderStrategy()).readSuspension(); */ } catch (Exception e) { RdtDebugCorePlugin.log(e); --- 282,289 ---- try { this.println("th " + ((RubyThread) stackFrame.getThread()).getId() + " ; step " + stackFrame.getIndex()); ! /* ! * return new ! * SuspensionReader(getMultiReaderStrategy()).readSuspension(); ! */ } catch (Exception e) { RdtDebugCorePlugin.log(e); *************** *** 301,311 **** } } ! public LoadResultReader.LoadResult readLoadResult(String filename) { try { ! this.println("load " +filename) ; return new LoadResultReader(getMultiReaderStrategy()).readLoadResult(); } catch (Exception e) { ! return null ; } } --- 311,321 ---- } } ! public LoadResultReader.LoadResult readLoadResult(String filename) { try { ! this.println("load " + filename); return new LoadResultReader(getMultiReaderStrategy()).readLoadResult(); } catch (Exception e) { ! return null; } } *************** *** 323,332 **** } ! public void setShouldStop() { ! } public void run() { try { ! System.setProperty(DEBUGGER_ACTIVE_KEY, "true") ; getDebugTarget().updateThreads(); println("cont"); --- 333,341 ---- } ! public void setShouldStop() {} public void run() { try { ! System.setProperty(DEBUGGER_ACTIVE_KEY, "true"); getDebugTarget().updateThreads(); println("cont"); *************** *** 339,355 **** RdtDebugCorePlugin.debug(hit); new Thread() { public void run() { getDebugTarget().suspensionOccurred(hit); } ! } ! .start(); ! } } catch (DebuggerNotFoundException ex) { ! throw ex ; } catch (Exception ex) { ! RdtDebugCorePlugin.debug("Exception in socket reader loop.", ex) ; ! } ! finally { ! System.setProperty(DEBUGGER_ACTIVE_KEY, "false") ; getDebugTarget().terminate(); try { --- 348,363 ---- RdtDebugCorePlugin.debug(hit); new Thread() { + public void run() { getDebugTarget().suspensionOccurred(hit); } ! }.start(); ! } } catch (DebuggerNotFoundException ex) { ! throw ex; } catch (Exception ex) { ! RdtDebugCorePlugin.debug("Exception in socket reader loop.", ex); ! } finally { ! System.setProperty(DEBUGGER_ACTIVE_KEY, "false"); getDebugTarget().terminate(); try { Index: RubyLineBreakpoint.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyLineBreakpoint.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RubyLineBreakpoint.java 1 Oct 2005 23:11:09 -0000 1.6 --- RubyLineBreakpoint.java 6 Oct 2005 23:29:49 -0000 1.7 *************** *** 11,15 **** public class RubyLineBreakpoint extends LineBreakpoint { ! private static final String RUBY_BREAKPOINT_MARKER = "org.rubypeople.rdt.debug.core.RubyBreakpointMarker"; //$NON-NLS-1$ public RubyLineBreakpoint(final IResource resource, final int lineNumber) throws CoreException { --- 11,15 ---- public class RubyLineBreakpoint extends LineBreakpoint { ! protected static final String RUBY_BREAKPOINT_MARKER = "org.rubypeople.rdt.debug.core.RubyBreakpointMarker"; //$NON-NLS-1$ public RubyLineBreakpoint(final IResource resource, final int lineNumber) throws CoreException { |
|
From: Markus B. <mba...@us...> - 2005-10-06 23:29:53
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/ruby In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21390/ruby Modified Files: eclipseDebug.rb Log Message: RubyExceptionBreakpoints / catchpoints functionality added Index: eclipseDebug.rb =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/ruby/eclipseDebug.rb,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** eclipseDebug.rb 18 Jan 2005 22:02:43 -0000 1.14 --- eclipseDebug.rb 6 Oct 2005 23:29:45 -0000 1.15 *************** *** 212,216 **** @finish_pos = 0 @trace = false ! @catch = "StandardError" @suspend_next = false @shouldResume = false --- 212,216 ---- @finish_pos = 0 @trace = false ! @catch = nil # "StandardError" @suspend_next = false @shouldResume = false *************** *** 688,709 **** # end ! # when /^\s*cat(?:ch)?(?:\s+(.+))?$/ ! # if $1 ! # excn = $1 ! # if excn == 'off' ! # @catch = nil ! # stdout.print "Clear catchpoint.\n" ! # else ! # @catch = excn ! # stdout.printf "Set catchpoint %s.\n", @catch ! # end ! # else ! # if @catch ! # stdout.printf "Catchpoint %s.\n", @catch ! # else ! # stdout.print "No catchpoint.\n" ! # end ! # end ! when /^\s*v(?:ar)?\s+/ --- 688,701 ---- # end ! when /^\s*cat(?:ch)?(?:\s+(.+))?$/ ! # $1 can also be nil ! @catch = $1 ! @catch = nil if @catch == 'off' ! if @catch then ! @printer.debug("Catchpoint set to #{@catch}") ! else ! @printer.debug("Catchpoints disabled") ! end ! when /^\s*v(?:ar)?\s+/ |
|
From: Markus B. <mba...@us...> - 2005-10-06 23:29:42
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.ui/icons/full/elcl16 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21319/icons/full/elcl16 Log Message: Directory /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.ui/icons/full/elcl16 added to the repository |
|
From: Markus B. <mba...@us...> - 2005-10-04 22:53:34
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22546 Modified Files: Changelog.txt Log Message: merged from SRB_0-6-1_3 Index: Changelog.txt =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt/Changelog.txt,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Changelog.txt 3 Oct 2005 11:31:38 -0000 1.13 --- Changelog.txt 4 Oct 2005 22:53:24 -0000 1.14 *************** *** 3,7 **** Changes merged from SRB 0.6.1: * SRB_0-6-1_1: Enable/Disable breakpoints, move breakpoints ! * SRB_0-6-1_1: Highlighting: added here docs, fixed ?#, fixed =begin =end with keywords not starting on first column Release 0.6.0: --- 3,10 ---- Changes merged from SRB 0.6.1: * SRB_0-6-1_1: Enable/Disable breakpoints, move breakpoints ! * SRB_0-6-1_2: Highlighting: added here docs, fixed ?#, fixed =begin =end with keywords not starting on first column ! * SRB_0-6-1_3: Fixed Test::Unit problems with finding a free port ! Fixed interpreter error for Test::Unit configuration created from the run configuration dialog with new ! (instead of Run As->Test::Unit which uses the Shortcut) Release 0.6.0: |
|
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); |
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22510/src/org/rubypeople/rdt/testunit/launcher Modified Files: TestUnitLaunchShortcut.java TestUnitRunnerConfiguration.java TestUnitLaunchConfigurationDelegate.java Log Message: merged from SRB_0-6-1_3 Index: TestUnitRunnerConfiguration.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitRunnerConfiguration.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** TestUnitRunnerConfiguration.java 1 Oct 2005 23:10:52 -0000 1.15 --- TestUnitRunnerConfiguration.java 4 Oct 2005 22:53:19 -0000 1.16 *************** *** 13,17 **** public class TestUnitRunnerConfiguration extends InterpreterRunnerConfiguration { ! public TestUnitRunnerConfiguration(ILaunchConfiguration aConfiguration) { super(aConfiguration); --- 13,18 ---- public class TestUnitRunnerConfiguration extends InterpreterRunnerConfiguration { ! private int port = -1 ; ! public TestUnitRunnerConfiguration(ILaunchConfiguration aConfiguration) { super(aConfiguration); *************** *** 48,51 **** --- 49,61 ---- } + public int getPort() { + // the port is needed render the command line for the ruby interpreter call + // and in TestUnitPlugin::launchChanged in order to start the server on + // the java side + if (port == -1) { + port = SocketUtil.findFreePort(); + } + return port ; + } /* * (non-Javadoc) *************** *** 53,58 **** * @see org.rubypeople.rdt.internal.launching.InterpreterRunnerConfiguration#getProgramArguments() */ ! public String getProgramArguments() { ! int port = 6789; String fileName = ""; String testClass = ""; --- 63,67 ---- * @see org.rubypeople.rdt.internal.launching.InterpreterRunnerConfiguration#getProgramArguments() */ ! public String getProgramArguments() { String fileName = ""; String testClass = ""; *************** *** 63,68 **** try { // Pull out the port and other unit testing variables ! // and convert them into command line args ! port = configuration.getAttribute(TestUnitLaunchConfigurationDelegate.PORT_ATTR, 6789); fileName = configuration.getAttribute(TestUnitLaunchConfigurationDelegate.LAUNCH_CONTAINER_ATTR, ""); testClass = configuration.getAttribute(TestUnitLaunchConfigurationDelegate.TESTTYPE_ATTR, ""); --- 72,76 ---- try { // Pull out the port and other unit testing variables ! // and convert them into command line args fileName = configuration.getAttribute(TestUnitLaunchConfigurationDelegate.LAUNCH_CONTAINER_ATTR, ""); testClass = configuration.getAttribute(TestUnitLaunchConfigurationDelegate.TESTTYPE_ATTR, ""); *************** *** 70,76 **** } catch (CoreException e) { TestunitPlugin.log(e); } ! return fileName + " " + port + " " + keepAlive + " " + testClass + " " + testMethod; } --- 78,85 ---- } catch (CoreException e) { TestunitPlugin.log(e); + throw new RuntimeException("Could not get necessary attributes from the launch configuration.") ; } ! return fileName + " " + this.getPort() + " " + keepAlive + " " + testClass + " " + testMethod; } Index: TestUnitLaunchConfigurationDelegate.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchConfigurationDelegate.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TestUnitLaunchConfigurationDelegate.java 2 Mar 2005 01:35:45 -0000 1.2 --- TestUnitLaunchConfigurationDelegate.java 4 Oct 2005 22:53:19 -0000 1.3 *************** *** 1,4 **** --- 1,5 ---- package org.rubypeople.rdt.testunit.launcher; + import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchConfiguration; import org.rubypeople.rdt.internal.launching.InterpreterRunnerConfiguration; *************** *** 7,12 **** public class TestUnitLaunchConfigurationDelegate extends RubyApplicationLaunchConfigurationDelegate { - - public static final String PORT_ATTR = TestunitPlugin.PLUGIN_ID + ".PORT"; //$NON-NLS-1$ /** * The single test type, or "" iff running a launch container. --- 8,11 ---- *************** *** 28,33 **** } ! protected InterpreterRunnerConfiguration wrapConfiguration(ILaunchConfiguration configuration) { ! return new TestUnitRunnerConfiguration(configuration) ; } --- 27,35 ---- } ! protected InterpreterRunnerConfiguration wrapConfigurationAndHandleLaunch(ILaunchConfiguration configuration, ILaunch launch) { ! ! TestUnitRunnerConfiguration testRunnerConfiguration = new TestUnitRunnerConfiguration(configuration) ; ! launch.setAttribute(TestunitPlugin.TESTUNIT_PORT_ATTR, Integer.toString(testRunnerConfiguration.getPort())) ; ! return testRunnerConfiguration ; } Index: TestUnitLaunchShortcut.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TestUnitLaunchShortcut.java 18 Sep 2005 15:18:02 -0000 1.12 --- TestUnitLaunchShortcut.java 4 Oct 2005 22:53:19 -0000 1.13 *************** *** 139,143 **** wc.setAttribute(RubyLaunchConfigurationAttribute.PROJECT_NAME, rubyFile.getProject().getName()); - int port = SocketUtil.findFreePort(); // FIXME Probably shouldn't write this out. It's now ignored at runtime wc.setAttribute(RubyLaunchConfigurationAttribute.FILE_NAME, TestUnitRunnerConfiguration.getTestRunnerPath()); --- 139,142 ---- *************** *** 147,152 **** wc.setAttribute(TestUnitLaunchConfigurationDelegate.TESTNAME_ATTR, testName); wc.setAttribute(TestUnitLaunchConfigurationDelegate.TESTTYPE_ATTR, ""); - // FIXME shouldn't this be determined at RUN time, not LAUNCH creation time? - wc.setAttribute(TestUnitLaunchConfigurationDelegate.PORT_ATTR, port); wc.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, "org.rubypeople.rdt.debug.ui.rubySourceLocator"); config = wc.doSave(); --- 146,149 ---- |
|
From: Markus B. <mba...@us...> - 2005-10-04 22:53:22
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22479/src/org/rubypeople/rdt/internal/launching Modified Files: RubyApplicationLaunchConfigurationDelegate.java InterpreterRunnerConfiguration.java Log Message: merged from SRB_0-6-1_3 Index: RubyApplicationLaunchConfigurationDelegate.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyApplicationLaunchConfigurationDelegate.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** RubyApplicationLaunchConfigurationDelegate.java 25 Sep 2005 16:49:46 -0000 1.11 --- RubyApplicationLaunchConfigurationDelegate.java 4 Oct 2005 22:53:14 -0000 1.12 *************** *** 26,36 **** if (mode.equals("debug")) { ! debuggerRunner.run( this.wrapConfiguration(configuration), launch); } else { ! interpreterRunner.run( this.wrapConfiguration(configuration), launch); } } ! protected InterpreterRunnerConfiguration wrapConfiguration(ILaunchConfiguration configuration) { return new InterpreterRunnerConfiguration(configuration) ; } --- 26,36 ---- if (mode.equals("debug")) { ! debuggerRunner.run( this.wrapConfigurationAndHandleLaunch(configuration, launch), launch); } else { ! interpreterRunner.run( this.wrapConfigurationAndHandleLaunch(configuration, launch), launch); } } ! protected InterpreterRunnerConfiguration wrapConfigurationAndHandleLaunch(ILaunchConfiguration configuration, ILaunch launch) { return new InterpreterRunnerConfiguration(configuration) ; } Index: InterpreterRunnerConfiguration.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunnerConfiguration.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** InterpreterRunnerConfiguration.java 25 Sep 2005 17:57:01 -0000 1.13 --- InterpreterRunnerConfiguration.java 4 Oct 2005 22:53:14 -0000 1.14 *************** *** 70,74 **** RdtLaunchingPlugin.log(e); } ! return new File(file); } --- 70,76 ---- RdtLaunchingPlugin.log(e); } ! // it is valid not to specify a working directroy by returning null ! // whereas new File("") would specify an invalid directory ! return file == "" ? null : new File(file); } |
|
From: Markus B. <mba...@us...> - 2005-10-04 22:42:52
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20612/src/org/rubypeople/rdt/internal/ui Modified Files: RubyUIMessages.properties Log Message: correction to RDocExecutionErrorAdditionalMessageWithStderr Index: RubyUIMessages.properties =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyUIMessages.properties,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RubyUIMessages.properties 25 Sep 2005 16:49:42 -0000 1.7 --- RubyUIMessages.properties 4 Oct 2005 22:42:40 -0000 1.8 *************** *** 125,129 **** RDocExecutionErrorTitle=Ruby process exited with value {0} RDocExecutionError=Ruby running rdoc exited abnormally. A possble reason is a wrong Rdoc path. Please check the path for rdoc in the preference page. ! RDocExecutionErrorAdditionalMessageWithStderr=The process was started with: {0}. The last line of stderr of the ruby process: {0}. RDocExecutionErrorAdditionalMessage=The process was started with: {0}. The process did not write any messages to stderr. ErrorRunningRdocTitle=Error running RDoc \ No newline at end of file --- 125,129 ---- RDocExecutionErrorTitle=Ruby process exited with value {0} RDocExecutionError=Ruby running rdoc exited abnormally. A possble reason is a wrong Rdoc path. Please check the path for rdoc in the preference page. ! RDocExecutionErrorAdditionalMessageWithStderr=The process was started with: {0}. The last line of stderr of the ruby process: {1}. RDocExecutionErrorAdditionalMessage=The process was started with: {0}. The process did not write any messages to stderr. ErrorRunningRdocTitle=Error running RDoc \ No newline at end of file |
|
From: Markus B. <mba...@us...> - 2005-10-04 22:35:27
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19067 Modified Files: Tag: SRB_0-6-1 Changelog.txt Log Message: test::unit problems fixed Index: Changelog.txt =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt/Changelog.txt,v retrieving revision 1.12.2.2 retrieving revision 1.12.2.3 diff -C2 -d -r1.12.2.2 -r1.12.2.3 *** Changelog.txt 3 Oct 2005 11:17:52 -0000 1.12.2.2 --- Changelog.txt 4 Oct 2005 22:35:18 -0000 1.12.2.3 *************** *** 2,5 **** --- 2,8 ---- * Enable/Disable breakpoints, move breakpoints * Highlighting: added here docs, fixed ?#, fixed =begin =end with keywords not starting on first column + * Fixed Test::Unit problems with finding a free port + * Fixed interpreter error for Test::Unit configuration created from the run configuration dialog with new + (instead of Run As->Test::Unit which uses the Shortcut) Release of 0.6.0 |
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18660/src/org/rubypeople/rdt/testunit/launcher Modified Files: Tag: SRB_0-6-1 TestUnitLaunchShortcut.java TestUnitRunnerConfiguration.java TestUnitLaunchConfigurationDelegate.java Log Message: fixed problems with finding free ports. Now the procedure is equal for starting from shortcut and from the run configuration dialog. The port is added as attribute to the launch. Index: TestUnitRunnerConfiguration.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitRunnerConfiguration.java,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -C2 -d -r1.14 -r1.14.2.1 *** TestUnitRunnerConfiguration.java 25 Sep 2005 17:56:54 -0000 1.14 --- TestUnitRunnerConfiguration.java 4 Oct 2005 22:32:55 -0000 1.14.2.1 *************** *** 10,18 **** import org.rubypeople.rdt.core.RubyCore; import org.rubypeople.rdt.internal.launching.InterpreterRunnerConfiguration; - import org.rubypeople.rdt.internal.launching.RdtLaunchingPlugin; import org.rubypeople.rdt.testunit.TestunitPlugin; public class TestUnitRunnerConfiguration extends InterpreterRunnerConfiguration { ! public TestUnitRunnerConfiguration(ILaunchConfiguration aConfiguration) { super(aConfiguration); --- 10,18 ---- import org.rubypeople.rdt.core.RubyCore; import org.rubypeople.rdt.internal.launching.InterpreterRunnerConfiguration; import org.rubypeople.rdt.testunit.TestunitPlugin; public class TestUnitRunnerConfiguration extends InterpreterRunnerConfiguration { ! private int port = -1 ; ! public TestUnitRunnerConfiguration(ILaunchConfiguration aConfiguration) { super(aConfiguration); *************** *** 49,52 **** --- 49,61 ---- } + public int getPort() { + // the port is needed render the command line for the ruby interpreter call + // and in TestUnitPlugin::launchChanged in order to start the server on + // the java side + if (port == -1) { + port = SocketUtil.findFreePort(); + } + return port ; + } /* * (non-Javadoc) *************** *** 54,59 **** * @see org.rubypeople.rdt.internal.launching.InterpreterRunnerConfiguration#getProgramArguments() */ ! public String getProgramArguments() { ! int port = 6789; String fileName = ""; String testClass = ""; --- 63,67 ---- * @see org.rubypeople.rdt.internal.launching.InterpreterRunnerConfiguration#getProgramArguments() */ ! public String getProgramArguments() { String fileName = ""; String testClass = ""; *************** *** 64,69 **** try { // Pull out the port and other unit testing variables ! // and convert them into command line args ! port = configuration.getAttribute(TestUnitLaunchConfigurationDelegate.PORT_ATTR, 6789); fileName = configuration.getAttribute(TestUnitLaunchConfigurationDelegate.LAUNCH_CONTAINER_ATTR, ""); testClass = configuration.getAttribute(TestUnitLaunchConfigurationDelegate.TESTTYPE_ATTR, ""); --- 72,76 ---- try { // Pull out the port and other unit testing variables ! // and convert them into command line args fileName = configuration.getAttribute(TestUnitLaunchConfigurationDelegate.LAUNCH_CONTAINER_ATTR, ""); testClass = configuration.getAttribute(TestUnitLaunchConfigurationDelegate.TESTTYPE_ATTR, ""); *************** *** 71,77 **** } catch (CoreException e) { TestunitPlugin.log(e); } ! return fileName + " " + port + " " + keepAlive + " " + testClass + " " + testMethod; } --- 78,85 ---- } catch (CoreException e) { TestunitPlugin.log(e); + throw new RuntimeException("Could not get necessary attributes from the launch configuration.") ; } ! return fileName + " " + this.getPort() + " " + keepAlive + " " + testClass + " " + testMethod; } Index: TestUnitLaunchConfigurationDelegate.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchConfigurationDelegate.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** TestUnitLaunchConfigurationDelegate.java 2 Mar 2005 01:35:45 -0000 1.2 --- TestUnitLaunchConfigurationDelegate.java 4 Oct 2005 22:32:55 -0000 1.2.2.1 *************** *** 1,4 **** --- 1,5 ---- package org.rubypeople.rdt.testunit.launcher; + import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchConfiguration; import org.rubypeople.rdt.internal.launching.InterpreterRunnerConfiguration; *************** *** 7,12 **** public class TestUnitLaunchConfigurationDelegate extends RubyApplicationLaunchConfigurationDelegate { - - public static final String PORT_ATTR = TestunitPlugin.PLUGIN_ID + ".PORT"; //$NON-NLS-1$ /** * The single test type, or "" iff running a launch container. --- 8,11 ---- *************** *** 28,33 **** } ! protected InterpreterRunnerConfiguration wrapConfiguration(ILaunchConfiguration configuration) { ! return new TestUnitRunnerConfiguration(configuration) ; } --- 27,35 ---- } ! protected InterpreterRunnerConfiguration wrapConfigurationAndHandleLaunch(ILaunchConfiguration configuration, ILaunch launch) { ! ! TestUnitRunnerConfiguration testRunnerConfiguration = new TestUnitRunnerConfiguration(configuration) ; ! launch.setAttribute(TestunitPlugin.TESTUNIT_PORT_ATTR, Integer.toString(testRunnerConfiguration.getPort())) ; ! return testRunnerConfiguration ; } Index: TestUnitLaunchShortcut.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -C2 -d -r1.12 -r1.12.2.1 *** TestUnitLaunchShortcut.java 18 Sep 2005 15:18:02 -0000 1.12 --- TestUnitLaunchShortcut.java 4 Oct 2005 22:32:55 -0000 1.12.2.1 *************** *** 139,143 **** wc.setAttribute(RubyLaunchConfigurationAttribute.PROJECT_NAME, rubyFile.getProject().getName()); - int port = SocketUtil.findFreePort(); // FIXME Probably shouldn't write this out. It's now ignored at runtime wc.setAttribute(RubyLaunchConfigurationAttribute.FILE_NAME, TestUnitRunnerConfiguration.getTestRunnerPath()); --- 139,142 ---- *************** *** 147,152 **** wc.setAttribute(TestUnitLaunchConfigurationDelegate.TESTNAME_ATTR, testName); wc.setAttribute(TestUnitLaunchConfigurationDelegate.TESTTYPE_ATTR, ""); - // FIXME shouldn't this be determined at RUN time, not LAUNCH creation time? - wc.setAttribute(TestUnitLaunchConfigurationDelegate.PORT_ATTR, port); wc.setAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, "org.rubypeople.rdt.debug.ui.rubySourceLocator"); config = wc.doSave(); --- 146,149 ---- |
|
From: Markus B. <mba...@us...> - 2005-10-04 22:33:06
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18660/src/org/rubypeople/rdt/testunit Modified Files: Tag: SRB_0-6-1 TestunitPlugin.java Log Message: fixed problems with finding free ports. Now the procedure is equal for starting from shortcut and from the run configuration dialog. The port is added as attribute to the launch. 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.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** TestunitPlugin.java 12 Mar 2005 15:29:58 -0000 1.7 --- TestunitPlugin.java 4 Oct 2005 22:32:55 -0000 1.7.2.1 *************** *** 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); |
|
From: Markus B. <mba...@us...> - 2005-10-04 22:33:03
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18644/src/org/rubypeople/rdt/internal/launching Modified Files: Tag: SRB_0-6-1 RubyApplicationLaunchConfigurationDelegate.java Log Message: fixed problems with finding free ports. Now the procedure is equal for starting from shortcut and from the run configuration dialog. The port is added as attribute to the launch. Index: RubyApplicationLaunchConfigurationDelegate.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyApplicationLaunchConfigurationDelegate.java,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** RubyApplicationLaunchConfigurationDelegate.java 25 Sep 2005 16:49:46 -0000 1.11 --- RubyApplicationLaunchConfigurationDelegate.java 4 Oct 2005 22:32:51 -0000 1.11.2.1 *************** *** 26,36 **** if (mode.equals("debug")) { ! debuggerRunner.run( this.wrapConfiguration(configuration), launch); } else { ! interpreterRunner.run( this.wrapConfiguration(configuration), launch); } } ! protected InterpreterRunnerConfiguration wrapConfiguration(ILaunchConfiguration configuration) { return new InterpreterRunnerConfiguration(configuration) ; } --- 26,36 ---- if (mode.equals("debug")) { ! debuggerRunner.run( this.wrapConfigurationAndHandleLaunch(configuration, launch), launch); } else { ! interpreterRunner.run( this.wrapConfigurationAndHandleLaunch(configuration, launch), launch); } } ! protected InterpreterRunnerConfiguration wrapConfigurationAndHandleLaunch(ILaunchConfiguration configuration, ILaunch launch) { return new InterpreterRunnerConfiguration(configuration) ; } |
|
From: Markus B. <mba...@us...> - 2005-10-04 22:27:25
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17331/src/org/rubypeople/rdt/internal/launching Modified Files: Tag: SRB_0-6-1 InterpreterRunnerConfiguration.java Log Message: fixed error in test::unit launch from Run>Run..>TestUnit>New. working may be null but not File("") Index: InterpreterRunnerConfiguration.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunnerConfiguration.java,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -C2 -d -r1.13 -r1.13.2.1 *** InterpreterRunnerConfiguration.java 25 Sep 2005 17:57:01 -0000 1.13 --- InterpreterRunnerConfiguration.java 4 Oct 2005 22:27:17 -0000 1.13.2.1 *************** *** 70,74 **** RdtLaunchingPlugin.log(e); } ! return new File(file); } --- 70,76 ---- RdtLaunchingPlugin.log(e); } ! // it is valid not to specify a working directroy by returning null ! // whereas new File("") would specify an invalid directory ! return file == "" ? null : new File(file); } |
|
From: Markus B. <mba...@us...> - 2005-10-03 11:32:06
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7574 Modified Files: Changelog.txt Log Message: merged from SRB_0-6-1_2 Index: Changelog.txt =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt/Changelog.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Changelog.txt 18 Sep 2005 18:48:53 -0000 1.12 --- Changelog.txt 3 Oct 2005 11:31:38 -0000 1.13 *************** *** 1,3 **** ! Changes since Release of 0.5.0 * Code folding: * Ability to enable/disable --- 1,9 ---- ! Changes since 0.6.0: ! ! Changes merged from SRB 0.6.1: ! * SRB_0-6-1_1: Enable/Disable breakpoints, move breakpoints ! * SRB_0-6-1_1: Highlighting: added here docs, fixed ?#, fixed =begin =end with keywords not starting on first column ! ! Release 0.6.0: * Code folding: * Ability to enable/disable |
|
From: Markus B. <mba...@us...> - 2005-10-03 11:32:06
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7594/src/org/rubypeople/rdt/internal/ui/text Modified Files: TC_RubyPartitionScanner.java Log Message: merged from SRB_0-6-1_2 Index: TC_RubyPartitionScanner.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/TC_RubyPartitionScanner.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TC_RubyPartitionScanner.java 2 Mar 2005 00:55:05 -0000 1.2 --- TC_RubyPartitionScanner.java 3 Oct 2005 11:31:41 -0000 1.3 *************** *** 9,13 **** import org.eclipse.jface.text.Document; import org.eclipse.jface.text.IDocument; ! import org.eclipse.jface.text.rules.DefaultPartitioner; /** --- 9,13 ---- import org.eclipse.jface.text.Document; import org.eclipse.jface.text.IDocument; ! import org.eclipse.jface.text.rules.FastPartitioner; /** *************** *** 16,29 **** */ public class TC_RubyPartitionScanner extends TestCase { public void testPartitioningOfSingleLineComment() { String source = "# This is a comment\n"; - IDocument doc = new Document(source); ! DefaultPartitioner partitioner = new DefaultPartitioner(new RubyPartitionScanner(), RubyPartitionScanner.LEGAL_CONTENT_TYPES); ! partitioner.connect(doc); ! assertEquals(RubyPartitionScanner.SINGLE_LINE_COMMENT, partitioner.getContentType(3)); } } --- 16,105 ---- */ public class TC_RubyPartitionScanner extends TestCase { + + private String getContentType(String content, int offset) { + IDocument doc = new Document(content); + FastPartitioner partitioner = new FastPartitioner(new RubyPartitionScanner(), RubyPartitionScanner.LEGAL_CONTENT_TYPES); + partitioner.connect(doc); + return partitioner.getContentType(offset); + } + public void testPartitioningOfSingleLineComment() { String source = "# This is a comment\n"; ! assertEquals(RubyPartitionScanner.SINGLE_LINE_COMMENT, this.getContentType(source, 0)); ! assertEquals(RubyPartitionScanner.SINGLE_LINE_COMMENT, this.getContentType(source, 1)); ! assertEquals(RubyPartitionScanner.SINGLE_LINE_COMMENT, this.getContentType(source, 18)); ! } ! ! public void testRecognizeSpecialCase() { ! String source = "a,b=?#,'This is not a comment!'\n"; ! ! assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 5)); ! assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 6)); ! } ! ! public void testMultilineComment() { ! String source = "=begin\nComment\n=end"; ! assertEquals(RubyPartitionScanner.MULTI_LINE_COMMENT, this.getContentType(source, 0)); ! assertEquals(RubyPartitionScanner.MULTI_LINE_COMMENT, this.getContentType(source, 10)); ! } ! ! public void testMultilineCommentNotOnFirstColumn() { ! String source = " =begin\nComment\n=end"; ! ! assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 0)); ! assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 1)); ! assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 2)); ! assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 10)); ! } ! ! ! public void testHereDocOK() { ! String source = "puts <<TEST\nMyName\nTEST"; ! assertEquals(RubyPartitionScanner.STRING, this.getContentType(source, 5)); ! ! source = "puts <<-TEST\nMyName\nTEST\nputs 'ab'"; ! assertEquals(RubyPartitionScanner.STRING, this.getContentType(source, 5)); ! ! source = "puts <<\"TEST\"\nMyName\nTEST"; ! assertEquals(RubyPartitionScanner.STRING, this.getContentType(source, 5)); ! ! source = "puts <<'TEST'\nMyName\nTEST"; ! assertEquals(RubyPartitionScanner.STRING, this.getContentType(source, 5)); ! ! source = "puts <<-'ax%&'\nMyName\nax%&"; ! assertEquals(RubyPartitionScanner.STRING, this.getContentType(source, 5)); ! } + + public void testNoHereDoc() { + + // space after << + String source = "puts << 'abc'"; + + assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 5)); + // normaler String + assertEquals(RubyPartitionScanner.STRING, this.getContentType(source, 9)); + + // end not on first column + source = "puts <<HERE\n HERE" ; + assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 5)); + source = "puts <<-"; // whatever that means in ruby + assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 5)); + + // recognize keyword end although there is no matching HERE + // this assures that there are no tokens eaten + source = "puts <<HERE\nend\n" ; + assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 14)); + + source = "puts <<'abc'\ntest" ; + assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 6)); + + source = "puts <<'abc'\ntest\nabd" ; + assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 6)); + } + } |
|
From: Markus B. <mba...@us...> - 2005-10-03 11:32:06
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7559/src/org/rubypeople/rdt/internal/ui/text Modified Files: RubyPartitionScanner.java Added Files: HereDocPatternRule.java NumberSignDetector.java Log Message: merged from SRB_0-6-1_2 Index: RubyPartitionScanner.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyPartitionScanner.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RubyPartitionScanner.java 1 Apr 2005 02:11:42 -0000 1.8 --- RubyPartitionScanner.java 3 Oct 2005 11:31:34 -0000 1.9 *************** *** 11,14 **** --- 11,15 ---- import org.eclipse.jface.text.rules.SingleLineRule; import org.eclipse.jface.text.rules.Token; + import org.eclipse.jface.text.rules.WordPatternRule; public class RubyPartitionScanner extends RuleBasedPartitionScanner { *************** *** 20,23 **** --- 21,25 ---- public static final String REGULAR_EXPRESSION = "partition_scanner_ruby_regular_expression"; public static final String COMMAND = "partition_scanner_ruby_command"; + public static final String HERE_DOC = "partition_scanner_here_doc"; public static final String[] LEGAL_CONTENT_TYPES = {STRING, MULTI_LINE_COMMENT, SINGLE_LINE_COMMENT, REGULAR_EXPRESSION, COMMAND}; *************** *** 34,37 **** --- 36,40 ---- IToken regexp = new Token(REGULAR_EXPRESSION); IToken command = new Token(COMMAND); + IToken hereDoc = new Token(STRING) ; List rules = new ArrayList(); *************** *** 57,65 **** // Single line comments rules.add(new EndOfLineRule("#", singleLineComment)); // Multiline comments ! rules.add(new MultiLineRule("=begin", "=end", multiLineComment)); ! ! // TODO Handle Heredocs! IPredicateRule[] result = new IPredicateRule[rules.size()]; --- 60,72 ---- // Single line comments + // ?# evaluates to the asiic value of # + rules.add(new WordPatternRule(new NumberSignDetector(),"?", "#", Token.UNDEFINED)) ; rules.add(new EndOfLineRule("#", singleLineComment)); // Multiline comments ! MultiLineRule multiLineCommentRule = new MultiLineRule("=begin", "=end", multiLineComment) ; ! multiLineCommentRule.setColumnConstraint(0) ; ! rules.add(multiLineCommentRule); ! ! rules.add(new HereDocPatternRule(hereDoc)) ; IPredicateRule[] result = new IPredicateRule[rules.size()]; --- NEW FILE: HereDocPatternRule.java --- package org.rubypeople.rdt.internal.ui.text; import org.eclipse.jface.text.rules.ICharacterScanner; import org.eclipse.jface.text.rules.IToken; public class HereDocPatternRule extends org.eclipse.jface.text.rules.PatternRule { public HereDocPatternRule(IToken token) { // TODO: escape char OK? super("<<", "", token, (char)-1, false, false); } protected boolean endSequenceDetected(ICharacterScanner scanner) { char firstChar = (char) scanner.read() ; if (Character.isWhitespace(firstChar)) { return false ; } if (firstChar == '-') { firstChar = (char) scanner.read() ; } boolean isQuoted = false ; char quote = ' ' ; if (firstChar == '\'' || firstChar == '"') { isQuoted = true ; quote = firstChar ; firstChar = (char) scanner.read() ; } String keyword = "" ; char c = firstChar ; do { if ((byte) c == ICharacterScanner.EOF || Character.isWhitespace(c)) { break ; } keyword += c ; c = (char) scanner.read() ; } while ( true ) ; if (keyword.length() == 0) { return false ; } if (isQuoted && !(keyword.charAt(keyword.length() -1) == quote) ) { return false ; } if (isQuoted) { fEndSequence = keyword.substring(0, keyword.length() - 1).toCharArray() ; } else { fEndSequence = keyword.toCharArray() ; } boolean result = super.endSequenceDetected(scanner) ; if (!result) { return false ; } // the keyword must be at the beginning of the line return scanner.getColumn() == fEndSequence.length ; } } --- NEW FILE: NumberSignDetector.java --- package org.rubypeople.rdt.internal.ui.text; import org.eclipse.jface.text.rules.IWordDetector; public class NumberSignDetector implements IWordDetector { public NumberSignDetector() { super(); } public boolean isWordStart(char c) { return isWordPart(c) ; } public boolean isWordPart(char c) { return '#' == c; } } |
|
From: Markus B. <mba...@us...> - 2005-10-03 11:18:00
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5200 Modified Files: Tag: SRB_0-6-1 Changelog.txt Log Message: highlighting Index: Changelog.txt =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt/Changelog.txt,v retrieving revision 1.12.2.1 retrieving revision 1.12.2.2 diff -C2 -d -r1.12.2.1 -r1.12.2.2 *** Changelog.txt 3 Oct 2005 07:08:11 -0000 1.12.2.1 --- Changelog.txt 3 Oct 2005 11:17:52 -0000 1.12.2.2 *************** *** 1,4 **** --- 1,5 ---- Changes in SRB 0.6.1 * Enable/Disable breakpoints, move breakpoints + * Highlighting: added here docs, fixed ?#, fixed =begin =end with keywords not starting on first column Release of 0.6.0 |
|
From: Markus B. <mba...@us...> - 2005-10-03 11:16:07
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4877/src/org/rubypeople/rdt/internal/ui/text Modified Files: Tag: SRB_0-6-1 TC_RubyPartitionScanner.java Log Message: fixed wrongly detected comment (?#), fixed wrongly detected multiline comment (if not on first column <>0), added here doc recognition Index: TC_RubyPartitionScanner.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui.tests/src/org/rubypeople/rdt/internal/ui/text/TC_RubyPartitionScanner.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** TC_RubyPartitionScanner.java 2 Mar 2005 00:55:05 -0000 1.2 --- TC_RubyPartitionScanner.java 3 Oct 2005 11:15:59 -0000 1.2.2.1 *************** *** 9,13 **** import org.eclipse.jface.text.Document; import org.eclipse.jface.text.IDocument; ! import org.eclipse.jface.text.rules.DefaultPartitioner; /** --- 9,13 ---- import org.eclipse.jface.text.Document; import org.eclipse.jface.text.IDocument; ! import org.eclipse.jface.text.rules.FastPartitioner; /** *************** *** 16,29 **** */ public class TC_RubyPartitionScanner extends TestCase { public void testPartitioningOfSingleLineComment() { String source = "# This is a comment\n"; - IDocument doc = new Document(source); ! DefaultPartitioner partitioner = new DefaultPartitioner(new RubyPartitionScanner(), RubyPartitionScanner.LEGAL_CONTENT_TYPES); ! partitioner.connect(doc); ! assertEquals(RubyPartitionScanner.SINGLE_LINE_COMMENT, partitioner.getContentType(3)); } } --- 16,105 ---- */ public class TC_RubyPartitionScanner extends TestCase { + + private String getContentType(String content, int offset) { + IDocument doc = new Document(content); + FastPartitioner partitioner = new FastPartitioner(new RubyPartitionScanner(), RubyPartitionScanner.LEGAL_CONTENT_TYPES); + partitioner.connect(doc); + return partitioner.getContentType(offset); + } + public void testPartitioningOfSingleLineComment() { String source = "# This is a comment\n"; ! assertEquals(RubyPartitionScanner.SINGLE_LINE_COMMENT, this.getContentType(source, 0)); ! assertEquals(RubyPartitionScanner.SINGLE_LINE_COMMENT, this.getContentType(source, 1)); ! assertEquals(RubyPartitionScanner.SINGLE_LINE_COMMENT, this.getContentType(source, 18)); ! } ! ! public void testRecognizeSpecialCase() { ! String source = "a,b=?#,'This is not a comment!'\n"; ! ! assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 5)); ! assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 6)); ! } ! ! public void testMultilineComment() { ! String source = "=begin\nComment\n=end"; ! assertEquals(RubyPartitionScanner.MULTI_LINE_COMMENT, this.getContentType(source, 0)); ! assertEquals(RubyPartitionScanner.MULTI_LINE_COMMENT, this.getContentType(source, 10)); ! } ! ! public void testMultilineCommentNotOnFirstColumn() { ! String source = " =begin\nComment\n=end"; ! ! assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 0)); ! assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 1)); ! assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 2)); ! assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 10)); ! } ! ! ! public void testHereDocOK() { ! String source = "puts <<TEST\nMyName\nTEST"; ! assertEquals(RubyPartitionScanner.STRING, this.getContentType(source, 5)); ! ! source = "puts <<-TEST\nMyName\nTEST\nputs 'ab'"; ! assertEquals(RubyPartitionScanner.STRING, this.getContentType(source, 5)); ! ! source = "puts <<\"TEST\"\nMyName\nTEST"; ! assertEquals(RubyPartitionScanner.STRING, this.getContentType(source, 5)); ! ! source = "puts <<'TEST'\nMyName\nTEST"; ! assertEquals(RubyPartitionScanner.STRING, this.getContentType(source, 5)); ! ! source = "puts <<-'ax%&'\nMyName\nax%&"; ! assertEquals(RubyPartitionScanner.STRING, this.getContentType(source, 5)); ! } + + public void testNoHereDoc() { + + // space after << + String source = "puts << 'abc'"; + + assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 5)); + // normaler String + assertEquals(RubyPartitionScanner.STRING, this.getContentType(source, 9)); + + // end not on first column + source = "puts <<HERE\n HERE" ; + assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 5)); + source = "puts <<-"; // whatever that means in ruby + assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 5)); + + // recognize keyword end although there is no matching HERE + // this assures that there are no tokens eaten + source = "puts <<HERE\nend\n" ; + assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 14)); + + source = "puts <<'abc'\ntest" ; + assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 6)); + + source = "puts <<'abc'\ntest\nabd" ; + assertEquals(IDocument.DEFAULT_CONTENT_TYPE, this.getContentType(source, 6)); + } + } |
|
From: Markus B. <mba...@us...> - 2005-10-03 11:16:06
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4853/src/org/rubypeople/rdt/internal/ui/text Modified Files: Tag: SRB_0-6-1 RubyPartitionScanner.java Added Files: Tag: SRB_0-6-1 HereDocPatternRule.java NumberSignDetector.java Log Message: fixed wrongly detected comment (?#), fixed wrongly detected multiline comment (if not on first column <>0), added here doc recognition Index: RubyPartitionScanner.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyPartitionScanner.java,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** RubyPartitionScanner.java 1 Apr 2005 02:11:42 -0000 1.8 --- RubyPartitionScanner.java 3 Oct 2005 11:15:56 -0000 1.8.2.1 *************** *** 11,14 **** --- 11,15 ---- import org.eclipse.jface.text.rules.SingleLineRule; import org.eclipse.jface.text.rules.Token; + import org.eclipse.jface.text.rules.WordPatternRule; public class RubyPartitionScanner extends RuleBasedPartitionScanner { *************** *** 20,23 **** --- 21,25 ---- public static final String REGULAR_EXPRESSION = "partition_scanner_ruby_regular_expression"; public static final String COMMAND = "partition_scanner_ruby_command"; + public static final String HERE_DOC = "partition_scanner_here_doc"; public static final String[] LEGAL_CONTENT_TYPES = {STRING, MULTI_LINE_COMMENT, SINGLE_LINE_COMMENT, REGULAR_EXPRESSION, COMMAND}; *************** *** 34,37 **** --- 36,40 ---- IToken regexp = new Token(REGULAR_EXPRESSION); IToken command = new Token(COMMAND); + IToken hereDoc = new Token(STRING) ; List rules = new ArrayList(); *************** *** 57,65 **** // Single line comments rules.add(new EndOfLineRule("#", singleLineComment)); // Multiline comments ! rules.add(new MultiLineRule("=begin", "=end", multiLineComment)); ! ! // TODO Handle Heredocs! IPredicateRule[] result = new IPredicateRule[rules.size()]; --- 60,72 ---- // Single line comments + // ?# evaluates to the asiic value of # + rules.add(new WordPatternRule(new NumberSignDetector(),"?", "#", Token.UNDEFINED)) ; rules.add(new EndOfLineRule("#", singleLineComment)); // Multiline comments ! MultiLineRule multiLineCommentRule = new MultiLineRule("=begin", "=end", multiLineComment) ; ! multiLineCommentRule.setColumnConstraint(0) ; ! rules.add(multiLineCommentRule); ! ! rules.add(new HereDocPatternRule(hereDoc)) ; IPredicateRule[] result = new IPredicateRule[rules.size()]; --- NEW FILE: HereDocPatternRule.java --- package org.rubypeople.rdt.internal.ui.text; import org.eclipse.jface.text.rules.ICharacterScanner; import org.eclipse.jface.text.rules.IToken; public class HereDocPatternRule extends org.eclipse.jface.text.rules.PatternRule { public HereDocPatternRule(IToken token) { // TODO: escape char OK? super("<<", "", token, (char)-1, false, false); } protected boolean endSequenceDetected(ICharacterScanner scanner) { char firstChar = (char) scanner.read() ; if (Character.isWhitespace(firstChar)) { return false ; } if (firstChar == '-') { firstChar = (char) scanner.read() ; } boolean isQuoted = false ; char quote = ' ' ; if (firstChar == '\'' || firstChar == '"') { isQuoted = true ; quote = firstChar ; firstChar = (char) scanner.read() ; } String keyword = "" ; char c = firstChar ; do { if ((byte) c == ICharacterScanner.EOF || Character.isWhitespace(c)) { break ; } keyword += c ; c = (char) scanner.read() ; } while ( true ) ; if (keyword.length() == 0) { return false ; } if (isQuoted && !(keyword.charAt(keyword.length() -1) == quote) ) { return false ; } if (isQuoted) { fEndSequence = keyword.substring(0, keyword.length() - 1).toCharArray() ; } else { fEndSequence = keyword.toCharArray() ; } boolean result = super.endSequenceDetected(scanner) ; if (!result) { return false ; } // the keyword must be at the beginning of the line return scanner.getColumn() == fEndSequence.length ; } } --- NEW FILE: NumberSignDetector.java --- package org.rubypeople.rdt.internal.ui.text; import org.eclipse.jface.text.rules.IWordDetector; public class NumberSignDetector implements IWordDetector { public NumberSignDetector() { super(); } public boolean isWordStart(char c) { return isWordPart(c) ; } public boolean isWordPart(char c) { return '#' == c; } } |
|
From: Markus B. <mba...@us...> - 2005-10-03 07:16:36
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20910/src/org/rubypeople/rdt/internal/debug/core/model Modified Files: RubyDebugTarget.java Log Message: merged from SRB_0-6-1_1 Index: RubyDebugTarget.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyDebugTarget.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RubyDebugTarget.java 29 Aug 2005 16:05:48 -0000 1.9 --- RubyDebugTarget.java 3 Oct 2005 07:16:25 -0000 1.10 *************** *** 174,179 **** public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta arg1) { // is called e.g. after a line has been inserted before a breakpoint ! // but then the debugger is out of sync with the file anyway, so debugging ! // should be stopped here. } --- 174,184 ---- public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta arg1) { // is called e.g. after a line has been inserted before a breakpoint ! // or the enablement status has changed ! // in the first case it is essential that the debugger has reloaded the file ! // so that the breakpoint moving is in synch with the new file ! if (isTerminated) { ! return ; ! } ! this.getRubyDebuggerProxy().updateBreakpoint(breakpoint, arg1) ; } |
|
From: Markus B. <mba...@us...> - 2005-10-03 07:16:36
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20910/src/org/rubypeople/rdt/internal/debug/core Modified Files: RubyDebuggerProxy.java Log Message: merged from SRB_0-6-1_1 Index: RubyDebuggerProxy.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebuggerProxy.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** RubyDebuggerProxy.java 1 Oct 2005 23:11:09 -0000 1.16 --- RubyDebuggerProxy.java 3 Oct 2005 07:16:25 -0000 1.17 *************** *** 6,10 **** --- 6,13 ---- import java.io.PrintWriter; import java.net.Socket; + import org.eclipse.core.resources.IMarker; + import org.eclipse.core.resources.IMarkerDelta; + import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.model.IBreakpoint; *************** *** 138,142 **** IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(IRubyDebugTarget.MODEL_IDENTIFIER); for (int i = 0; i < breakpoints.length; i++) { ! printBreakpoint(breakpoints[i], "add"); } } --- 141,145 ---- IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(IRubyDebugTarget.MODEL_IDENTIFIER); for (int i = 0; i < breakpoints.length; i++) { ! this.addBreakpoint(breakpoints[i]) ; } } *************** *** 144,150 **** public void addBreakpoint(IBreakpoint breakpoint) { try { ! this.printBreakpoint(breakpoint, "add"); } catch (IOException e) { RdtDebugCorePlugin.log(e); } } --- 147,157 ---- public void addBreakpoint(IBreakpoint breakpoint) { try { ! if (breakpoint.isEnabled()) { ! this.printBreakpoint("add", breakpoint.getMarker().getResource().getName(), breakpoint.getMarker().getAttribute(IMarker.LINE_NUMBER, -1) ); ! } } catch (IOException e) { RdtDebugCorePlugin.log(e); + } catch (CoreException e) { + RdtDebugCorePlugin.log(e); } } *************** *** 152,156 **** public void removeBreakpoint(IBreakpoint breakpoint) { try { ! this.printBreakpoint(breakpoint, "remove"); } catch (IOException e) { RdtDebugCorePlugin.log(e); --- 159,163 ---- public void removeBreakpoint(IBreakpoint breakpoint) { try { ! this.printBreakpoint("remove", breakpoint.getMarker().getResource().getName(), breakpoint.getMarker().getAttribute(IMarker.LINE_NUMBER, -1) ); } catch (IOException e) { RdtDebugCorePlugin.log(e); *************** *** 158,170 **** } ! protected void printBreakpoint(IBreakpoint breakpoint, String mode) throws IOException { StringBuffer setBreakPointCommand = new StringBuffer(); setBreakPointCommand.append("b "); setBreakPointCommand.append(mode); setBreakPointCommand.append(" "); ! setBreakPointCommand.append(breakpoint.getMarker().getResource().getName()); setBreakPointCommand.append(":"); ! setBreakPointCommand.append(breakpoint.getMarker().getAttribute(IMarker.LINE_NUMBER, -1)); this.println(setBreakPointCommand.toString()); } --- 165,189 ---- } + + public void updateBreakpoint(IBreakpoint breakpoint, IMarkerDelta markerDelta) { + // line might have changed or enablement/disablement + try { + // remove is called even if it has not been added at program start + // (happens if enablement changed from disabled at program start to enabled) + this.printBreakpoint("remove", breakpoint.getMarker().getResource().getName(), markerDelta.getAttribute(IMarker.LINE_NUMBER, -1)); + this.addBreakpoint(breakpoint) ; + } catch (IOException e) { + RdtDebugCorePlugin.log(e); + } + } ! protected void printBreakpoint(String mode, String file, int line) throws IOException { StringBuffer setBreakPointCommand = new StringBuffer(); setBreakPointCommand.append("b "); setBreakPointCommand.append(mode); setBreakPointCommand.append(" "); ! setBreakPointCommand.append(file); setBreakPointCommand.append(":"); ! setBreakPointCommand.append(line); this.println(setBreakPointCommand.toString()); } |
|
From: Markus B. <mba...@us...> - 2005-10-03 07:08:22
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19099 Modified Files: Tag: SRB_0-6-1 Changelog.txt Log Message: update Index: Changelog.txt =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt/Changelog.txt,v retrieving revision 1.12 retrieving revision 1.12.2.1 diff -C2 -d -r1.12 -r1.12.2.1 *** Changelog.txt 18 Sep 2005 18:48:53 -0000 1.12 --- Changelog.txt 3 Oct 2005 07:08:11 -0000 1.12.2.1 *************** *** 1,3 **** ! Changes since Release of 0.5.0 * Code folding: * Ability to enable/disable --- 1,6 ---- ! Changes in SRB 0.6.1 ! * Enable/Disable breakpoints, move breakpoints ! ! Release of 0.6.0 * Code folding: * Ability to enable/disable |
|
From: Markus B. <mba...@us...> - 2005-10-03 06:45:06
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13778/src/org/rubypeople/rdt/internal/debug/core Modified Files: Tag: SRB_0-6-1 RubyDebuggerProxy.java Log Message: added update handler for breakpoints; handles enable/disable and line shifting after editing a file Index: RubyDebuggerProxy.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebuggerProxy.java,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -C2 -d -r1.15 -r1.15.2.1 *** RubyDebuggerProxy.java 18 Jan 2005 22:19:14 -0000 1.15 --- RubyDebuggerProxy.java 3 Oct 2005 06:44:57 -0000 1.15.2.1 *************** *** 6,10 **** --- 6,13 ---- import java.io.PrintWriter; import java.net.Socket; + import org.eclipse.core.resources.IMarker; + import org.eclipse.core.resources.IMarkerDelta; + import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.model.IBreakpoint; *************** *** 138,142 **** IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(IRubyDebugTarget.MODEL_IDENTIFIER); for (int i = 0; i < breakpoints.length; i++) { ! printBreakpoint(breakpoints[i], "add"); } } --- 141,145 ---- IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(IRubyDebugTarget.MODEL_IDENTIFIER); for (int i = 0; i < breakpoints.length; i++) { ! this.addBreakpoint(breakpoints[i]) ; } } *************** *** 144,150 **** public void addBreakpoint(IBreakpoint breakpoint) { try { ! this.printBreakpoint(breakpoint, "add"); } catch (IOException e) { RdtDebugCorePlugin.log(e); } } --- 147,157 ---- public void addBreakpoint(IBreakpoint breakpoint) { try { ! if (breakpoint.isEnabled()) { ! this.printBreakpoint("add", breakpoint.getMarker().getResource().getName(), breakpoint.getMarker().getAttribute(IMarker.LINE_NUMBER, -1) ); ! } } catch (IOException e) { RdtDebugCorePlugin.log(e); + } catch (CoreException e) { + RdtDebugCorePlugin.log(e); } } *************** *** 152,156 **** public void removeBreakpoint(IBreakpoint breakpoint) { try { ! this.printBreakpoint(breakpoint, "remove"); } catch (IOException e) { RdtDebugCorePlugin.log(e); --- 159,163 ---- public void removeBreakpoint(IBreakpoint breakpoint) { try { ! this.printBreakpoint("remove", breakpoint.getMarker().getResource().getName(), breakpoint.getMarker().getAttribute(IMarker.LINE_NUMBER, -1) ); } catch (IOException e) { RdtDebugCorePlugin.log(e); *************** *** 158,170 **** } ! protected void printBreakpoint(IBreakpoint breakpoint, String mode) throws IOException { StringBuffer setBreakPointCommand = new StringBuffer(); setBreakPointCommand.append("b "); setBreakPointCommand.append(mode); setBreakPointCommand.append(" "); ! setBreakPointCommand.append(breakpoint.getMarker().getResource().getName()); setBreakPointCommand.append(":"); ! setBreakPointCommand.append(breakpoint.getMarker().getAttribute(IMarker.LINE_NUMBER, -1)); this.println(setBreakPointCommand.toString()); } --- 165,189 ---- } + + public void updateBreakpoint(IBreakpoint breakpoint, IMarkerDelta markerDelta) { + // line might have changed or enablement/disablement + try { + // remove is called even if it has not been added at program start + // (happens if enablement changed from disabled at program start to enabled) + this.printBreakpoint("remove", breakpoint.getMarker().getResource().getName(), markerDelta.getAttribute(IMarker.LINE_NUMBER, -1)); + this.addBreakpoint(breakpoint) ; + } catch (IOException e) { + RdtDebugCorePlugin.log(e); + } + } ! protected void printBreakpoint(String mode, String file, int line) throws IOException { StringBuffer setBreakPointCommand = new StringBuffer(); setBreakPointCommand.append("b "); setBreakPointCommand.append(mode); setBreakPointCommand.append(" "); ! setBreakPointCommand.append(file); setBreakPointCommand.append(":"); ! setBreakPointCommand.append(line); this.println(setBreakPointCommand.toString()); } |
|
From: Markus B. <mba...@us...> - 2005-10-03 06:45:06
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13778/src/org/rubypeople/rdt/internal/debug/core/model Modified Files: Tag: SRB_0-6-1 RubyDebugTarget.java Log Message: added update handler for breakpoints; handles enable/disable and line shifting after editing a file Index: RubyDebugTarget.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/RubyDebugTarget.java,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** RubyDebugTarget.java 29 Aug 2005 16:05:48 -0000 1.9 --- RubyDebugTarget.java 3 Oct 2005 06:44:57 -0000 1.9.2.1 *************** *** 174,179 **** public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta arg1) { // is called e.g. after a line has been inserted before a breakpoint ! // but then the debugger is out of sync with the file anyway, so debugging ! // should be stopped here. } --- 174,184 ---- public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta arg1) { // is called e.g. after a line has been inserted before a breakpoint ! // or the enablement status has changed ! // in the first case it is essential that the debugger has reloaded the file ! // so that the breakpoint moving is in synch with the new file ! if (isTerminated) { ! return ; ! } ! this.getRubyDebuggerProxy().updateBreakpoint(breakpoint, arg1) ; } |