Module: Roby::Distributed::Test::RemotePeerSupport

Defined in:
lib/roby/test/distributed.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#testcaseObject

Returns the value of attribute testcase.



63
64
65
# File 'lib/roby/test/distributed.rb', line 63

def testcase
  @testcase
end

Instance Method Details

#cleanupObject



85
86
87
88
# File 'lib/roby/test/distributed.rb', line 85

def cleanup
    Roby.control.quit
    Roby.control.join
end

#console_logger=(value) ⇒ Object



83
# File 'lib/roby/test/distributed.rb', line 83

def console_logger=(value); testcase.console_logger = value end

#disable_communicationObject



72
73
74
# File 'lib/roby/test/distributed.rb', line 72

def disable_communication
    local_peer.disable_rx
end

#enable_communicationObject



65
66
67
68
69
70
71
# File 'lib/roby/test/distributed.rb', line 65

def enable_communication
    Roby::Distributed.state.synchronize do
  local_peer.enable_rx
  # make sure we wake up the communication thread
  Roby::Distributed.state.finished_discovery.broadcast
    end
end

#flushObject



75
# File 'lib/roby/test/distributed.rb', line 75

def flush; local_peer.flush end

#local_peerObject



77
78
79
# File 'lib/roby/test/distributed.rb', line 77

def local_peer
    @local_peer ||= Distributed.peers.find { true }.last
end

#log_level=(value) ⇒ Object



84
# File 'lib/roby/test/distributed.rb', line 84

def log_level=(value); Roby.logger.level = value end

#process_eventsObject



76
# File 'lib/roby/test/distributed.rb', line 76

def process_events; Roby.control.process_events end

#reset_local_peerObject



80
# File 'lib/roby/test/distributed.rb', line 80

def reset_local_peer; @local_peer = nil end

#send_local_peer(*args) ⇒ Object



81
# File 'lib/roby/test/distributed.rb', line 81

def send_local_peer(*args); local_peer.send(*args) end

#wait_one_cycleObject



82
# File 'lib/roby/test/distributed.rb', line 82

def wait_one_cycle; Roby.control.wait_one_cycle end