Class: Cucumber::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber/repository.rb

Overview

In memory repository i.e. a thread based link to cucumber-query

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRepository

TODO: Missing structs (3)

final Map<Object, Lineage> lineageById = new HashMap<>();
final Map<String, List<Suggestion>> suggestionsByPickleStepId = new LinkedHashMap<>();
final List<UndefinedParameterType> undefinedParameterTypes = new ArrayList<>();


20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/cucumber/repository.rb', line 20

def initialize
  @attachments_by_test_case_started_id = Hash.new { |hash, key| hash[key] = [] }
  @attachments_by_test_run_hook_started_id = Hash.new { |hash, key| hash[key] = [] }
  @hook_by_id = {}
  @pickle_by_id = {}
  @pickle_step_by_id = {}
  @step_by_id = {}
  @step_definition_by_id = {}
  @test_case_by_id = {}
  @test_case_started_by_id = {}
  @test_case_finished_by_test_case_started_id = {}
  @test_run_hook_started_by_id = {}
  @test_run_hook_finished_by_test_run_hook_started_id = {}
  @test_step_by_id = {}
  @test_steps_started_by_test_case_started_id = Hash.new { |hash, key| hash[key] = [] }
  @test_steps_finished_by_test_case_started_id = Hash.new { |hash, key| hash[key] = [] }
end

Instance Attribute Details

#attachments_by_test_case_started_idObject (readonly)

Returns the value of attribute attachments_by_test_case_started_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def attachments_by_test_case_started_id
  @attachments_by_test_case_started_id
end

#attachments_by_test_run_hook_started_idObject (readonly)

Returns the value of attribute attachments_by_test_run_hook_started_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def attachments_by_test_run_hook_started_id
  @attachments_by_test_run_hook_started_id
end

#hook_by_idObject (readonly)

Returns the value of attribute hook_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def hook_by_id
  @hook_by_id
end

#metaObject

Returns the value of attribute meta.



6
7
8
# File 'lib/cucumber/repository.rb', line 6

def meta
  @meta
end

#pickle_by_idObject (readonly)

Returns the value of attribute pickle_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def pickle_by_id
  @pickle_by_id
end

#pickle_step_by_idObject (readonly)

Returns the value of attribute pickle_step_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def pickle_step_by_id
  @pickle_step_by_id
end

#step_by_idObject (readonly)

Returns the value of attribute step_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def step_by_id
  @step_by_id
end

#step_definition_by_idObject (readonly)

Returns the value of attribute step_definition_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def step_definition_by_id
  @step_definition_by_id
end

#test_case_by_idObject (readonly)

Returns the value of attribute test_case_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def test_case_by_id
  @test_case_by_id
end

#test_case_finished_by_test_case_started_idObject (readonly)

Returns the value of attribute test_case_finished_by_test_case_started_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def test_case_finished_by_test_case_started_id
  @test_case_finished_by_test_case_started_id
end

#test_case_started_by_idObject (readonly)

Returns the value of attribute test_case_started_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def test_case_started_by_id
  @test_case_started_by_id
end

#test_run_finishedObject

Returns the value of attribute test_run_finished.



6
7
8
# File 'lib/cucumber/repository.rb', line 6

def test_run_finished
  @test_run_finished
end

#test_run_hook_finished_by_test_run_hook_started_idObject (readonly)

Returns the value of attribute test_run_hook_finished_by_test_run_hook_started_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def test_run_hook_finished_by_test_run_hook_started_id
  @test_run_hook_finished_by_test_run_hook_started_id
end

#test_run_hook_started_by_idObject (readonly)

Returns the value of attribute test_run_hook_started_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def test_run_hook_started_by_id
  @test_run_hook_started_by_id
end

#test_run_startedObject

Returns the value of attribute test_run_started.



6
7
8
# File 'lib/cucumber/repository.rb', line 6

def test_run_started
  @test_run_started
end

#test_step_by_idObject (readonly)

Returns the value of attribute test_step_by_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def test_step_by_id
  @test_step_by_id
end

#test_steps_finished_by_test_case_started_idObject (readonly)

Returns the value of attribute test_steps_finished_by_test_case_started_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def test_steps_finished_by_test_case_started_id
  @test_steps_finished_by_test_case_started_id
end

#test_steps_started_by_test_case_started_idObject (readonly)

Returns the value of attribute test_steps_started_by_test_case_started_id.



7
8
9
# File 'lib/cucumber/repository.rb', line 7

def test_steps_started_by_test_case_started_id
  @test_steps_started_by_test_case_started_id
end

Instance Method Details

#update(envelope) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/cucumber/repository.rb', line 38

def update(envelope)
  return self.meta = envelope.meta if envelope.meta
  return self.test_run_started = envelope.test_run_started if envelope.test_run_started
  return self.test_run_finished = envelope.test_run_finished if envelope.test_run_finished
  return update_attachment(envelope.attachment) if envelope.attachment
  return update_gherkin_document(envelope.gherkin_document) if envelope.gherkin_document
  return update_hook(envelope.hook) if envelope.hook
  return update_pickle(envelope.pickle) if envelope.pickle
  return update_step_definition(envelope.step_definition) if envelope.step_definition
  return update_test_run_hook_started(envelope.test_run_hook_started) if envelope.test_run_hook_started
  return update_test_run_hook_finished(envelope.test_run_hook_finished) if envelope.test_run_hook_finished
  return update_test_case_started(envelope.test_case_started) if envelope.test_case_started
  return update_test_case_finished(envelope.test_case_finished) if envelope.test_case_finished
  return update_test_step_started(envelope.test_step_started) if envelope.test_step_started
  return update_test_step_finished(envelope.test_step_finished) if envelope.test_step_finished
  return update_test_case(envelope.test_case) if envelope.test_case

  nil
end