Class: SeleniumGrid::Hub

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/selenium-grid/hub.rb

Constant Summary collapse

HUB_PORT =
4444

Instance Method Summary collapse

Instance Method Details

#start(overrides = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/selenium-grid/hub.rb', line 9

def start(overrides = {})
  classpath = Java::Classpath.new(File.join(File.dirname(__FILE__), %w(.. ..)))
  classpath = classpath << "." << "lib/openqa/selenium-grid-hub-standalone-*.jar"

  requirements = {
    :classpath => classpath.definition,
    :log => File.join(File.dirname(__FILE__), "..", "..", "log", "hub.log")
  }
  options = {
    :background => ENV['BACKGROUND'] || false,
  }.merge(overrides).merge(requirements)

  Java::VM.new.run "com.thoughtworks.selenium.grid.hub.HubServer", options
end

#stopObject



24
25
26
# File 'lib/selenium-grid/hub.rb', line 24

def stop
  Lsof.kill(HUB_PORT)
end