|
From: <mba...@us...> - 2007-02-25 15:45:20
|
Revision: 2028
http://svn.sourceforge.net/rubyeclipse/?rev=2028&view=rev
Author: mbarchfe
Date: 2007-02-25 07:45:19 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
new tst case: inspect timeout
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_AbstractDebuggerCommunicationTest.java
trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java
Modified: trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_AbstractDebuggerCommunicationTest.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_AbstractDebuggerCommunicationTest.java 2007-02-25 15:44:15 UTC (rev 2027)
+++ trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_AbstractDebuggerCommunicationTest.java 2007-02-25 15:45:19 UTC (rev 2028)
@@ -292,8 +292,7 @@
}
private void runTo(String filename, int lineNumber) throws Exception {
- String command = "b " + filename + ":" + lineNumber;
- new BreakpointCommand(command).executeWithResult(debuggerConnection);
+ setBreakpoint(filename, lineNumber) ;
SuspensionReader reader;
if (!debuggerConnection.isCommandPortConnected()) {
reader = debuggerConnection.start();
@@ -308,6 +307,15 @@
assertEquals(lineNumber, hit.getLine());
}
+ private void setBreakpoint(String filename, int line) throws Exception{
+ String command = "b " + filename + ":" + line;
+ new BreakpointCommand(command).executeWithResult(debuggerConnection);
+ }
+
+ private void setBreakpoint(int line) throws Exception {
+ setBreakpoint("test.rb", line) ;
+ }
+
public void testBreakpointOnFirstLine() throws Exception {
createSocket(new String[] { "puts 'a'" });
runTo("test.rb", 1);
@@ -408,7 +416,7 @@
public void testExceptionHierarchy() throws Exception {
createSocket(new String[] { "class MyError < StandardError", "end", "begin", "raise StandardError.new", "rescue", "end", "raise MyError.new" });
- GenericCommand catchCommand = new GenericCommand("catch StandardError", true /* iscontrol */);
+ GenericCommand catchCommand = new GenericCommand("catch MyError", true /* iscontrol */);
catchCommand.execute(debuggerConnection);
SuspensionPoint hit = startDebugger().readSuspension();
assertNotNull(hit);
@@ -886,14 +894,27 @@
sendRuby("v inspect a*2");
try {
getVariableReader().readVariables(createStackFrame());
+ fail("RubyProcessingException not thrown.");
} catch (RubyProcessingException e) {
assertNotNull(e.getMessage());
+ assertFalse(e.getMessage().indexOf("Timeout") > -1) ;
sendRuby("cont");
- return;
}
- fail("RubyProcessingException not thrown.");
}
-
+ public void testInspectTimeout() throws Exception {
+ createSocket(new String[] { "puts 'test'", "puts 'test'" });
+ runToLine(2);
+ sendRuby("v inspect sleep(100)");
+ try {
+ getVariableReader().readVariables(createStackFrame());
+ fail("Timeout did not occur.");
+ } catch (RubyProcessingException e) {
+ assertTrue(e.getMessage().indexOf("Timeout") > -1) ;
+ sendRuby("cont");
+ }
+ }
+
+
public void testEvalError() throws Exception {
createSocket(new String[] { "puts 'test'", "puts 'test'" });
runToLine(2);
@@ -988,16 +1009,17 @@
public void testThreadFramesAndVariables() throws Exception {
createSocket(new String[] { "Thread.new {", "a=5", "x=6", "puts 'x'", "}", "b=10", "b=11" });
- sendRuby("b test.rb:3");
- getBreakpointAddedReader().readBreakpointNo();
- sendRuby("b test.rb:7");
- getBreakpointAddedReader().readBreakpointNo();
+ setBreakpoint(7) ;
+ runToLine(3);
+ sendRuby("th l");
+ ThreadInfo[] threads = getThreadInfoReader().readThreads();
+
sendRuby("th resume 1");
getSuspensionReader().readSuspension();
getSuspensionReader().readSuspension();
// the main thread and the "puts 'a'" - thread are active
sendRuby("th l");
- ThreadInfo[] threads = getThreadInfoReader().readThreads();
+ threads = getThreadInfoReader().readThreads();
assertEquals(2, threads.length);
sendRuby("th " + threads[0].getId() + " ; w ");
Modified: trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java 2007-02-25 15:44:15 UTC (rev 2027)
+++ trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java 2007-02-25 15:45:19 UTC (rev 2028)
@@ -34,6 +34,7 @@
suite.addTest(new FTC_RubyDebugCommunicationTest("testInspectTemporaryArray"));
suite.addTest(new FTC_RubyDebugCommunicationTest("testInspectNil"));
suite.addTest(new FTC_RubyDebugCommunicationTest("testInspectError"));
+ suite.addTest(new FTC_RubyDebugCommunicationTest("testInspectTimeout"));
suite.addTest(new FTC_RubyDebugCommunicationTest("testEvalError"));
suite.addTest(new FTC_RubyDebugCommunicationTest("testFrames"));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|