Class: TDriverErrorRecoverySettings

Inherits:
Object
  • Object
show all
Defined in:
lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb

Instance Method Summary collapse

Constructor Details

#initializeTDriverErrorRecoverySettings

Returns a new instance of TDriverErrorRecoverySettings.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb', line 25

def initialize

  @error_recovery_enabled=nil

  @ping_connection=nil

  @ping_interval=nil

  @reconnect_device=nil

  @reconnect_attempts=nil

  @monitored_suts=[]

  @ats4_error_recovery_enabled=false

  @wait_time_for_ats4_error_recovery=60

  read_settings
end

Instance Method Details

#get_ats4_error_recovery_enabledObject



74
75
76
# File 'lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb', line 74

def get_ats4_error_recovery_enabled
   $parameters[ :ats4_error_recovery_enabled ]
end

#get_error_recovery_enabledObject



80
81
82
# File 'lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb', line 80

def get_error_recovery_enabled
   $parameters[ :error_recovery_enabled ]
end

#get_monitored_sutObject



92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb', line 92

def get_monitored_sut
  str_parameter= $parameters[ :error_recovery_monitored_sut_ids ]

  if str_parameter.include?('|')
    @monitored_suts=str_parameter.split('|')
  elsif str_parameter.include?(',')
    @monitored_suts=str_parameter.split(',')
  else
    @monitored_suts=str_parameter
  end
  
  @monitored_suts
end

#get_ping_connectionObject



83
84
85
# File 'lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb', line 83

def get_ping_connection
   $parameters[ :ping_connection ]
end

#get_reconnect_attemptsObject



89
90
91
# File 'lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb', line 89

def get_reconnect_attempts
   $parameters[ :reconnect_attempts ]
end

#get_reconnect_deviceObject



86
87
88
# File 'lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb', line 86

def get_reconnect_device
   $parameters[ :reconnect_device ]
end

#get_wait_time_for_ats4_error_recoveryObject



77
78
79
# File 'lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb', line 77

def get_wait_time_for_ats4_error_recovery
   $parameters[ :wait_time_for_ats4_error_recovery ]
end

#read_settingsObject

Read error recovery settings

params

returns

raises



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/tdriver/report/error_recovery/tdriver_error_recovery_settings.rb', line 49

def read_settings()
  @error_recovery_enabled= $parameters[ :error_recovery_enabled ]
  raise MobyBase::BehaviourError.new("error recovery", "error recovery enabled parameter not defined in tdriver_parameters.xml") if @error_recovery_enabled == nil

  @ats4_error_recovery_enabled= $parameters[ :ats4_error_recovery_enabled ]
  raise MobyBase::BehaviourError.new("error recovery", "ats4 error recovery enabled parameter not defined in tdriver_parameters.xml") if @ats4_error_recovery_enabled == nil

  @wait_time_for_ats4_error_recovery= $parameters[ :wait_time_for_ats4_error_recovery ]
  raise MobyBase::BehaviourError.new("error recovery", "ats4 error recovery wait time parameter not defined in tdriver_parameters.xml") if @wait_time_for_ats4_error_recovery == nil

  @ping_connection= $parameters[ :ping_connection ]
  raise MobyBase::BehaviourError.new("error recovery", "ping connection parameter not defined in tdriver_parameters.xml") if @ping_connection == nil

  @reconnect_device= $parameters[ :reconnect_device ]
  raise MobyBase::BehaviourError.new("error recovery", "reconnect device patameter not defined in tdriver_parameters.xml") if @reconnect_device == nil

  @reconnect_attempts= $parameters[ :reconnect_attempts ]
  raise MobyBase::BehaviourError.new("error recovery", "reconnect attempts patameter not defined in tdriver_parameters.xml") if @reconnect_attempts == nil

  str_parameter= $parameters[ :error_recovery_monitored_sut_ids ]
  raise MobyBase::BehaviourError.new("error recovery", "error_recovery_monitored_sut_ids patameter not defined in tdriver_parameters.xml") if str_parameter == nil
  @monitored_suts=str_parameter.split('|')


end