Class: RSpec::OpenHAB::Karaf

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/openhab/karaf.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = nil) ⇒ Karaf

Returns a new instance of Karaf.



29
30
31
32
33
34
35
# File 'lib/rspec/openhab/karaf.rb', line 29

def initialize(path = nil)
  @path = path
  @include_bindings = true
  @include_jsondb = true
  @private_confdir = false
  @use_root_instance = false
end

Instance Attribute Details

#include_bindingsObject

Returns the value of attribute include_bindings.



27
28
29
# File 'lib/rspec/openhab/karaf.rb', line 27

def include_bindings
  @include_bindings
end

#include_jsondbObject

Returns the value of attribute include_jsondb.



27
28
29
# File 'lib/rspec/openhab/karaf.rb', line 27

def include_jsondb
  @include_jsondb
end

#pathObject (readonly)

Returns the value of attribute path.



26
27
28
# File 'lib/rspec/openhab/karaf.rb', line 26

def path
  @path
end

#private_confdirObject

Returns the value of attribute private_confdir.



27
28
29
# File 'lib/rspec/openhab/karaf.rb', line 27

def private_confdir
  @private_confdir
end

#use_root_instanceObject

Returns the value of attribute use_root_instance.



27
28
29
# File 'lib/rspec/openhab/karaf.rb', line 27

def use_root_instance
  @use_root_instance
end

Instance Method Details

#launchObject

Raises:

  • (ArgumentError)


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/rspec/openhab/karaf.rb', line 37

def launch
  raise ArgumentError, "Path must be supplied if use_root_instance is false" unless path || use_root_instance

  @path = oh_home if use_root_instance

  load_boot_jars
  set_env
  set_java_properties
  set_java_properties_from_env
  unless use_root_instance
    redirect_instances
    create_instance
  end
  start_instance
end