Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraleherbau2011-05-05 08:10:33 +0000
committeraleherbau2011-05-05 08:10:33 +0000
commit3fe0ead0b4ba9bbe58a1d16305e46e808eab5d46 (patch)
tree41f17e4684938d2aa259223fe97c3ff9cf53d7b6 /python/src/tcf/tests/BasicTests.py
parent837458856781c52e4b635897c787180c15b58ce6 (diff)
downloadorg.eclipse.tcf-3fe0ead0b4ba9bbe58a1d16305e46e808eab5d46.tar.gz
org.eclipse.tcf-3fe0ead0b4ba9bbe58a1d16305e46e808eab5d46.tar.xz
org.eclipse.tcf-3fe0ead0b4ba9bbe58a1d16305e46e808eab5d46.zip
TCF Python: Allow callables (functions) as service callbacks
Diffstat (limited to 'python/src/tcf/tests/BasicTests.py')
-rw-r--r--python/src/tcf/tests/BasicTests.py56
1 files changed, 26 insertions, 30 deletions
diff --git a/python/src/tcf/tests/BasicTests.py b/python/src/tcf/tests/BasicTests.py
index 3a15ee98f..917ddcc07 100644
--- a/python/src/tcf/tests/BasicTests.py
+++ b/python/src/tcf/tests/BasicTests.py
@@ -144,32 +144,29 @@ def testRunControl(c):
def testBreakpoints(c):
from tcf.services import breakpoints
- def r3():
+ def testBPQuery():
bps = c.getRemoteService(breakpoints.NAME)
- class DoneGetIDs(breakpoints.DoneGetIDs):
- def doneGetIDs(self, token, error, ids):
+ def doneGetIDs(token, error, ids):
+ if error:
+ protocol.log("Error from Breakpoints.getIDs", error)
+ return
+ print "Breakpoints :", ids
+ def doneGetProperties(token, error, props):
if error:
- protocol.log("Error from Breakpoints.getIDs", error)
+ protocol.log("Error from Breakpoints.getProperties", error)
return
- print "Breakpoints :", ids
- class DoneGetProperties(breakpoints.DoneGetProperties):
- def doneGetProperties(self, token, error, props):
- if error:
- protocol.log("Error from Breakpoints.getProperties", error)
- return
- print "Breakpoint Properties: ", props
- class DoneGetStatus(breakpoints.DoneGetStatus):
- def doneGetProperties(self, token, error, props):
- if error:
- protocol.log("Error from Breakpoints.getStatus", error)
- return
- print "Breakpoint Status: ", props
- for id in ids:
- bps.getProperties(id, DoneGetProperties())
- bps.getStatus(id, DoneGetStatus())
- bps.getIDs(DoneGetIDs())
- protocol.invokeLater(r3)
- def r4():
+ print "Breakpoint Properties: ", props
+ def doneGetStatus(token, error, props):
+ if error:
+ protocol.log("Error from Breakpoints.getStatus", error)
+ return
+ print "Breakpoint Status: ", props
+ for id in ids:
+ bps.getProperties(id, doneGetProperties)
+ bps.getStatus(id, doneGetStatus)
+ bps.getIDs(doneGetIDs)
+ protocol.invokeLater(testBPQuery)
+ def testBPSet():
bpsvc = c.getRemoteService(breakpoints.NAME)
class BPListener(breakpoints.BreakpointsListener):
def breakpointStatusChanged(self, id, status):
@@ -182,18 +179,17 @@ def testBreakpoints(c):
def contextRemoved(self, ids):
print "breakpointRemoved", ids
bpsvc.addListener(BPListener())
- class DoneSet(breakpoints.DoneCommand):
- def doneCommand(self, token, error):
- if error:
- protocol.log("Error from Breakpoints.set", error)
- return
+ def doneSet(token, error):
+ if error:
+ protocol.log("Error from Breakpoints.set", error)
+ return
bp = {
breakpoints.PROP_ID : "python:1",
breakpoints.PROP_ENABLED : True,
breakpoints.PROP_LOCATION : "sysClkRateGet"
}
- bpsvc.set([bp], DoneSet())
- protocol.invokeLater(r4)
+ bpsvc.set([bp], doneSet)
+ protocol.invokeLater(testBPSet)
def testStackTrace(c):
from tcf.services import stacktrace

Back to the top