schemata-dea 0.0.1.beta14 → 0.0.1.beta15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data/lib/schemata/common/componentbase.rb +42 -0
  2. data/lib/schemata/common/msgbase.rb +13 -11
  3. data/lib/schemata/common/msgtypebase.rb +20 -0
  4. data/lib/schemata/common/parsed_msg.rb +1 -1
  5. data/lib/schemata/dea/advertise_message/advertise_message_v1.rb +1 -1
  6. data/lib/schemata/dea/advertise_message.rb +1 -5
  7. data/lib/schemata/dea/dea_status_response/dea_status_response_v1.rb +1 -1
  8. data/lib/schemata/dea/dea_status_response.rb +1 -5
  9. data/lib/schemata/dea/discover_request/discover_request_v1.rb +1 -1
  10. data/lib/schemata/dea/discover_request.rb +1 -5
  11. data/lib/schemata/dea/droplet_status_response/droplet_status_response_v1.rb +1 -1
  12. data/lib/schemata/dea/droplet_status_response.rb +1 -5
  13. data/lib/schemata/dea/exit_message/exit_message_v1.rb +1 -1
  14. data/lib/schemata/dea/exit_message.rb +1 -5
  15. data/lib/schemata/dea/find_droplet_request/find_droplet_request_v1.rb +1 -1
  16. data/lib/schemata/dea/find_droplet_request.rb +1 -5
  17. data/lib/schemata/dea/find_droplet_response/find_droplet_response_v1.rb +1 -1
  18. data/lib/schemata/dea/find_droplet_response.rb +1 -5
  19. data/lib/schemata/dea/heartbeat_response/heartbeat_response_v1.rb +1 -1
  20. data/lib/schemata/dea/heartbeat_response.rb +1 -5
  21. data/lib/schemata/dea/hello_message/hello_message_v1.rb +1 -1
  22. data/lib/schemata/dea/hello_message.rb +1 -5
  23. data/lib/schemata/dea/start_request/start_request_v1.rb +5 -3
  24. data/lib/schemata/dea/start_request.rb +1 -5
  25. data/lib/schemata/dea/stop_request/stop_request_v1.rb +1 -1
  26. data/lib/schemata/dea/stop_request.rb +1 -5
  27. data/lib/schemata/dea/update_request/update_request_v1.rb +1 -1
  28. data/lib/schemata/dea/update_request.rb +1 -5
  29. data/lib/schemata/dea/version.rb +2 -2
  30. data/lib/schemata/dea.rb +3 -60
  31. data/lib/schemata/helpers/decamelize.rb +23 -0
  32. data/lib/schemata/helpers/hash_copy.rb +1 -1
  33. data/lib/schemata/helpers/stringify.rb +1 -1
  34. data/spec/{cloud_controller/cloud_controller_spec.rb → cloud_controller_spec.rb} +0 -0
  35. data/spec/common/helpers_spec.rb +16 -16
  36. data/spec/{dea/dea_spec.rb → dea_spec.rb} +1 -1
  37. data/spec/{health_manager/health_manager_spec.rb → health_manager_spec.rb} +0 -0
  38. data/spec/{router/router_spec.rb → router_spec.rb} +0 -0
  39. data/spec/{staging/staging_spec.rb → staging_spec.rb} +0 -0
  40. data/spec/support/component_helpers.rb +16 -2
  41. data/spec/support/helpers.rb +0 -20
  42. data/spec/support/message_helpers.rb +23 -19
  43. data/spec/support/message_type_helpers.rb +59 -55
  44. metadata +36 -80
  45. data/spec/cloud_controller/droplet_updated_message_spec.rb +0 -10
  46. data/spec/cloud_controller/hm_start_request_spec.rb +0 -11
  47. data/spec/cloud_controller/hm_stop_request_spec.rb +0 -12
  48. data/spec/dea/advertise_message_spec.rb +0 -10
  49. data/spec/dea/dea_status_response_spec.rb +0 -10
  50. data/spec/dea/discover_request_spec.rb +0 -10
  51. data/spec/dea/droplet_status_response_spec.rb +0 -10
  52. data/spec/dea/exit_message_spec.rb +0 -10
  53. data/spec/dea/find_droplet_request_spec.rb +0 -27
  54. data/spec/dea/find_droplet_response_spec.rb +0 -10
  55. data/spec/dea/heartbeat_response_spec.rb +0 -10
  56. data/spec/dea/hello_message_spec.rb +0 -10
  57. data/spec/dea/start_request_spec.rb +0 -10
  58. data/spec/dea/stop_request_spec.rb +0 -10
  59. data/spec/dea/update_request_spec.rb +0 -0
  60. data/spec/health_manager/health_request_spec.rb +0 -12
  61. data/spec/health_manager/health_response_spec.rb +0 -12
  62. data/spec/health_manager/status_crashed_response_spec.rb +0 -12
  63. data/spec/health_manager/status_flapping_response_spec.rb +0 -12
  64. data/spec/health_manager/status_request_spec.rb +0 -12
  65. data/spec/router/register_request_spec.rb +0 -10
  66. data/spec/router/start_message_spec.rb +0 -10
  67. data/spec/staging/staging_message_spec.rb +0 -14
@@ -1,49 +1,49 @@
1
1
  require 'schemata/helpers/hash_copy'
2
2
  require 'schemata/helpers/stringify'
3
3
 
4
- describe Schemata::HashCopyHelpers do
4
+ describe Schemata::Helpers do
5
5
  describe "#deep_copy" do
6
6
  it "should deep copy nil" do
7
- copy = Schemata::HashCopyHelpers.deep_copy(nil)
7
+ copy = Schemata::Helpers.deep_copy(nil)
8
8
  copy.should == nil
9
9
  end
10
10
 
11
11
  it "should deep copy a given string" do
12
12
  original = "foo"
13
- copy = Schemata::HashCopyHelpers.deep_copy(original)
13
+ copy = Schemata::Helpers.deep_copy(original)
14
14
  copy.should be_instance_of String
15
15
  copy.should == original
16
16
  copy.object_id.should_not == original.object_id
17
17
  end
18
18
 
19
19
  it "should deep copy a given boolean" do
20
- Schemata::HashCopyHelpers.deep_copy(true).
20
+ Schemata::Helpers.deep_copy(true).
21
21
  should be_an_instance_of TrueClass
22
- Schemata::HashCopyHelpers.deep_copy(false).
22
+ Schemata::Helpers.deep_copy(false).
23
23
  should be_an_instance_of FalseClass
24
24
  end
25
25
 
26
26
  it "should deep copy a given numeric type" do
27
27
  original = 0
28
- copy = Schemata::HashCopyHelpers.deep_copy(original)
28
+ copy = Schemata::Helpers.deep_copy(original)
29
29
  copy.should == original
30
30
  copy.should be_an_instance_of Fixnum
31
31
 
32
32
  # set original to be max fixnum + 1
33
33
  original = 2**(0.size * 8 - 2)
34
- copy = Schemata::HashCopyHelpers.deep_copy(original)
34
+ copy = Schemata::Helpers.deep_copy(original)
35
35
  copy.should == original
36
36
  copy.should be_an_instance_of Bignum
37
37
 
38
38
  original = 0.0
39
- copy = Schemata::HashCopyHelpers.deep_copy(original)
39
+ copy = Schemata::Helpers.deep_copy(original)
40
40
  copy.should == original
41
41
  copy.should be_an_instance_of Float
42
42
  end
43
43
 
44
44
  it "should deep copy a given hash" do
45
45
  original = {"foo" => "bar"}
46
- copy = Schemata::HashCopyHelpers.deep_copy(original)
46
+ copy = Schemata::Helpers.deep_copy(original)
47
47
  copy.should be_instance_of Hash
48
48
  copy.should == original
49
49
 
@@ -53,7 +53,7 @@ describe Schemata::HashCopyHelpers do
53
53
 
54
54
  it "should deep copy a given array" do
55
55
  original = [1, 2, "hello"]
56
- copy = Schemata::HashCopyHelpers.deep_copy(original)
56
+ copy = Schemata::Helpers.deep_copy(original)
57
57
  copy.should be_instance_of Array
58
58
  copy.should == original
59
59
 
@@ -69,7 +69,7 @@ describe Schemata::HashCopyHelpers do
69
69
  "hello" => "goodbye",
70
70
  },
71
71
  }
72
- copy = Schemata::HashCopyHelpers.deep_copy(original)
72
+ copy = Schemata::Helpers.deep_copy(original)
73
73
  copy.should be_instance_of Hash
74
74
  copy.should == original
75
75
 
@@ -83,32 +83,32 @@ describe Schemata::HashCopyHelpers do
83
83
  it "should raise error for unknown type" do
84
84
  klass = Class.new
85
85
  expect do
86
- Schemata::HashCopyHelpers.deep_copy(klass.new)
86
+ Schemata::Helpers.deep_copy(klass.new)
87
87
  end.to raise_error(described_class::CopyError, /Unexpected class: /)
88
88
  end
89
89
  end
90
90
 
91
91
  describe "#stringify" do
92
92
  it "should stringify nil" do
93
- str = Schemata::HashCopyHelpers.stringify(nil)
93
+ str = Schemata::Helpers.stringify(nil)
94
94
  str.should == nil
95
95
  end
96
96
 
97
97
  it "should stringify a string" do
98
98
  original = "foo"
99
- str = Schemata::HashCopyHelpers.stringify(original)
99
+ str = Schemata::Helpers.stringify(original)
100
100
  str.should == "foo"
101
101
  end
102
102
 
103
103
  it "should stringify a symbol" do
104
104
  original = :foo
105
- str = Schemata::HashCopyHelpers.stringify(original)
105
+ str = Schemata::Helpers.stringify(original)
106
106
  str.should == "foo"
107
107
  end
108
108
 
109
109
  it "should stringify a hash" do
110
110
  original = { "foo" => :foo }
111
- str = Schemata::HashCopyHelpers.stringify(original)
111
+ str = Schemata::Helpers.stringify(original)
112
112
  str.should == { "foo" => "foo" }
113
113
  end
114
114
  end
@@ -1,6 +1,6 @@
1
1
  require 'schemata/dea'
2
2
  require 'spec_helper'
3
3
 
4
- describe Schemata::DEA do
4
+ describe Schemata::Dea do
5
5
  it_behaves_like "a schemata component"
6
6
  end
File without changes
File without changes
@@ -1,9 +1,10 @@
1
1
  require 'support/helpers'
2
+ require 'schemata/helpers/decamelize'
2
3
 
3
4
  shared_examples "a schemata component" do
4
5
 
5
6
  described_class.constants.select { |x| x != :VERSION }.each do |msg_type|
6
- describe ".mock_#{decamelize(msg_type.to_s)}" do
7
+ describe ".mock_#{Schemata::Helpers.decamelize(msg_type.to_s)}" do
7
8
  versions = described_class::const_get(msg_type).constants.select { |x| x =~ /V[0-9]+/ }
8
9
  versions.map { |x| x = x.to_s[1..-1].to_i }.each do |version|
9
10
  it_behaves_like "a mocking method", version do
@@ -12,11 +13,24 @@ shared_examples "a schemata component" do
12
13
  let(:component) { described_class }
13
14
  let(:component_name) { component.name.split("::")[1] }
14
15
 
15
- let(:mock_method) { "mock_#{decamelize(msg_type)}"}
16
+ let(:mock_method) { "mock_#{Schemata::Helpers.decamelize(msg_type)}"}
16
17
  end
17
18
  end
18
19
  end
20
+
21
+ describe msg_type do
22
+ message_type = described_class::const_get(msg_type)
23
+ it_behaves_like "a message type", message_type do
24
+ let (:message_type) { described_class::const_get(msg_type) }
25
+ let (:message_type_name) { msg_type.to_s }
26
+ let (:component) { described_class }
27
+ let (:component_name) { component.name.split("::")[1] }
28
+
29
+ let (:mock_method) { "mock_#{Schemata::Helpers.decamelize(msg_type)}" }
30
+ end
31
+ end
19
32
  end
33
+
20
34
  end
21
35
 
22
36
  shared_examples "a mocking method" do |version|
@@ -26,26 +26,6 @@ def greater_version?(version, benchmark)
26
26
  version > benchmark
27
27
  end
28
28
 
29
- def decamelize(str)
30
- words = []
31
- curr_word = ""
32
- 0.upto(str.length - 1) do |i|
33
- ch = str[i]
34
- if ch =~ /[A-Z]/
35
- words.push(curr_word)
36
- curr_word = ""
37
- end
38
- curr_word += ch
39
- end
40
- words.push(curr_word)
41
- words.map! { |x| x.downcase }
42
-
43
- # If the first letter is capitalized, then the first word here is empty
44
- words.shift if words[0] == ""
45
-
46
- words.join('_')
47
- end
48
-
49
29
  def num_mandatory_fields(msg_obj)
50
30
  optional = msg_obj.class.schema.optional_keys
51
31
  mandatory = Set.new(msg_obj.class.schema.schemas.keys)
@@ -1,16 +1,5 @@
1
- shared_examples "a message" do
2
-
3
- version = described_class.version
4
-
5
- let(:component_name) { described_class.name.split("::")[1] }
6
- let(:message_type_name) { described_class.name.split("::")[2] }
7
- let(:message_name) { described_class.name.split("::")[3] }
8
-
9
- let(:component) { Schemata::const_get(component_name) }
10
- let(:message_type) { component::const_get(message_type_name) }
11
- let(:message) { described_class }
12
-
13
- let(:mock_method) { "mock_#{decamelize(message_type_name)}" }
1
+ shared_examples "a message" do |msg|
2
+ version = msg.version
14
3
 
15
4
  before :each do
16
5
  set_current_version(message_type, version)
@@ -21,7 +10,7 @@ shared_examples "a message" do
21
10
  end
22
11
 
23
12
  describe "#new" do
24
- it "should create a #{described_class} object with an incomplete hash" do
13
+ it "should create a #{msg} object with an incomplete hash" do
25
14
  mock_hash = component.send(mock_method, 1).contents
26
15
  first_key = mock_hash.keys[0]
27
16
  first_value = mock_hash[first_key]
@@ -68,7 +57,7 @@ shared_examples "a message" do
68
57
  json_hash.should have_key "V1"
69
58
  json_hash.should have_key "min_version"
70
59
 
71
- data = Schemata::HashCopyHelpers.deep_copy(json_hash["V1"])
60
+ data = Schemata::Helpers.deep_copy(json_hash["V1"])
72
61
 
73
62
  json_hash.delete("V1")
74
63
  json_hash.delete("min_version")
@@ -86,7 +75,7 @@ shared_examples "a message" do
86
75
  end
87
76
  json_hash.should have_key "min_version"
88
77
 
89
- data = Schemata::HashCopyHelpers.deep_copy(json_hash["V#{version}"])
78
+ data = Schemata::Helpers.deep_copy(json_hash["V#{version}"])
90
79
  1.upto(version) do |i|
91
80
  json_hash.delete("V#{i}")
92
81
  end
@@ -97,9 +86,9 @@ shared_examples "a message" do
97
86
  end
98
87
  end
99
88
 
100
- described_class.schema.schemas.keys.each do |attr|
89
+ msg.schema.schemas.keys.each do |attr|
101
90
  describe "##{attr}" do
102
- it "should the attribute if it was specified at instantiation" do
91
+ it "should return the attribute if it was specified at instantiation" do
103
92
  mock_value = component.send(mock_method, version).contents[attr]
104
93
  msg_obj = message.new({ attr => mock_value })
105
94
  msg_obj.send(attr).should == mock_value
@@ -116,6 +105,21 @@ shared_examples "a message" do
116
105
  msg_obj = message.new
117
106
  msg_obj.send(attr).should be_nil
118
107
  end
108
+
109
+ if msg.schema.optional_keys.include? attr
110
+ context "the attribute is optional" do
111
+ it "should allow nil values during instantiation" do
112
+ mock_value = component.send(mock_method, version).contents[attr]
113
+ hash = { attr => mock_value }
114
+ msg_obj = message.new(hash)
115
+ end
116
+
117
+ it "should be able to set the attribute to nil" do
118
+ msg_obj = message.new
119
+ msg_obj.send("#{attr}=", nil)
120
+ end
121
+ end
122
+ end
119
123
  end
120
124
 
121
125
  describe "##{attr}=" do
@@ -127,7 +131,7 @@ shared_examples "a message" do
127
131
  ret.should == mock_value
128
132
  end
129
133
 
130
- unless described_class.schema.schemas[attr].kind_of? Membrane::Schema::Any
134
+ unless msg.schema.schemas[attr].kind_of? Membrane::Schema::Any
131
135
  it "should raise an error if the wrong type is written" do
132
136
  mock_value = component.send(mock_method, version).contents[attr]
133
137
 
@@ -1,15 +1,8 @@
1
- shared_examples "a message type" do
1
+ shared_examples "a message type" do |msg_type|
2
2
 
3
- versions = described_class.constants.select {|x| x =~ /V[0-9]+/ }
3
+ versions = msg_type.constants.select {|x| x =~ /V[0-9]+/ }
4
4
  .map {|x| x.to_s[1..-1].to_i}
5
5
 
6
- let(:message_type_name) { described_class.name.split("::")[2] }
7
- let(:message_type) { described_class }
8
- let(:component_name) { described_class.name.split("::")[1] }
9
- let(:component) { Schemata::const_get(component_name) }
10
-
11
- let(:mock_method) { "mock_#{decamelize(message_type_name)}" }
12
-
13
6
  describe ".decode" do
14
7
  context "when the current version is 1" do
15
8
  before :each do
@@ -50,7 +43,7 @@ shared_examples "a message type" do
50
43
  msg_hash = {
51
44
  "V1" => data,
52
45
  "min_version" => 1
53
- }.merge(Schemata::HashCopyHelpers.deep_copy(data))
46
+ }.merge(Schemata::Helpers.deep_copy(data))
54
47
  json = Yajl::Encoder.encode(msg_hash)
55
48
 
56
49
  msg_obj = message_type.decode(json)
@@ -96,68 +89,68 @@ structure or a complete flash hash" do
96
89
  }.to raise_error(Schemata::DecodeError)
97
90
  end
98
91
  end
99
- end
100
92
 
101
- if versions.include?(2)
102
- context "when current version is 2" do
103
- before :each do
104
- set_current_version(message_type, 2)
105
- end
93
+ if versions.include?(2)
94
+ context "when the current version is 2" do
95
+ before :each do
96
+ set_current_version(message_type, 2)
97
+ end
106
98
 
107
- after :each do
108
- reset_version(message_type)
109
- end
99
+ after :each do
100
+ reset_version(message_type)
101
+ end
110
102
 
111
- it "should raise an error given a flat hash" do
112
- data = component.send(mock_method, 2).contents
113
- json = Yajl::Encoder.encode(data)
114
- expect {
115
- msg_obj = message_type.decode(json)
116
- }.to raise_error(Schemata::DecodeError)
117
- end
103
+ it "should raise an error given a flat hash" do
104
+ data = component.send(mock_method, 2).contents
105
+ json = Yajl::Encoder.encode(data)
106
+ expect {
107
+ msg_obj = message_type.decode(json)
108
+ }.to raise_error(Schemata::DecodeError)
109
+ end
118
110
 
119
- it "should return a V2 object a given a mixed (flat hash + V1-encoded) json" do
120
- msg_hash = component.send(mock_method, 2).contents
121
- v1_hash = Schemata::HashCopyHelpers.deep_copy(msg_hash)
122
- msg_hash["V1"] = v1_hash
123
- msg_hash["min_version"] = 1
111
+ it "should return a V2 object a given a mixed (flat hash + V1-encoded) json" do
112
+ msg_hash = component.send(mock_method, 2).contents
113
+ v1_hash = Schemata::Helpers.deep_copy(msg_hash)
114
+ msg_hash["V1"] = v1_hash
115
+ msg_hash["min_version"] = 1
124
116
 
125
- json = Yajl::Encoder.encode(msg_hash)
117
+ json = Yajl::Encoder.encode(msg_hash)
126
118
 
127
- msg_obj = message_type.decode(json)
128
- msg_obj.class.should == message_type::V2
119
+ msg_obj = message_type.decode(json)
120
+ msg_obj.class.should == message_type::V2
129
121
 
130
- message_type::V2.schema.schemas.keys.each do |key|
131
- msg_obj.send(key).should == v1_hash[key]
122
+ message_type::V2.schema.schemas.keys.each do |key|
123
+ msg_obj.send(key).should == v1_hash[key]
124
+ end
132
125
  end
133
- end
134
126
 
135
- it "should return a V2 object given a V1-encoded json" do
136
- v1_hash = component.send(mock_method, 1).contents
137
- msg_hash = {"V1" => v1_hash, 'min_version' => 1}
127
+ it "should return a V2 object given a V1-encoded json" do
128
+ v1_hash = component.send(mock_method, 1).contents
129
+ msg_hash = {"V1" => v1_hash, 'min_version' => 1}
138
130
 
139
- json = Yajl::Encoder.encode(msg_hash)
131
+ json = Yajl::Encoder.encode(msg_hash)
140
132
 
141
- msg_obj = message_type.decode(json)
142
- msg_obj.class.should == message_type::V2
133
+ msg_obj = message_type.decode(json)
134
+ msg_obj.class.should == message_type::V2
143
135
 
144
- message_type::V2.schema.schemas.keys.each do |key|
145
- msg_obj.send(key).should == v1_hash[key]
136
+ message_type::V2.schema.schemas.keys.each do |key|
137
+ msg_obj.send(key).should == v1_hash[key]
138
+ end
146
139
  end
147
- end
148
140
 
149
- it "should return a V2 object given a V2-encoded object" do
150
- data = component.send(mock_method, 2).contents
151
- v2_hash = Schemata::HashCopyHelpers.deep_copy(data)
152
- msg_hash = {"V2" => v2_hash, "V1" => {}, "min_version" => 1}
141
+ it "should return a V2 object given a V2-encoded object" do
142
+ data = component.send(mock_method, 2).contents
143
+ v2_hash = Schemata::Helpers.deep_copy(data)
144
+ msg_hash = {"V2" => v2_hash, "V1" => {}, "min_version" => 1}
153
145
 
154
- json = Yajl::Encoder.encode(msg_hash)
146
+ json = Yajl::Encoder.encode(msg_hash)
155
147
 
156
- msg_obj = message_type.decode(json)
157
- msg_obj.class.should == message_type::V2
148
+ msg_obj = message_type.decode(json)
149
+ msg_obj.class.should == message_type::V2
158
150
 
159
- message_type::V2.schema.schemas.keys.each do |key|
160
- msg_obj.send(key).should == data[key]
151
+ message_type::V2.schema.schemas.keys.each do |key|
152
+ msg_obj.send(key).should == data[key]
153
+ end
161
154
  end
162
155
  end
163
156
  end
@@ -168,4 +161,15 @@ structure or a complete flash hash" do
168
161
  versions.select { |x| x > 2 }.each do |version|
169
162
 
170
163
  end
164
+
165
+ # Test message version types
166
+ versions.each do |version|
167
+ msg = msg_type::const_get("V#{version}")
168
+ describe "V#{version}" do
169
+ it_behaves_like "a message", msg do
170
+ let (:message) { message_type::const_get("V#{version}") }
171
+ let (:message_name) { message.to_s }
172
+ end
173
+ end
174
+ end
171
175
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schemata-dea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.beta14
4
+ version: 0.0.1.beta15
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -115,42 +115,41 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
- - lib/schemata/dea/find_droplet_response.rb
119
- - lib/schemata/dea/exit_message/exit_message_v1.rb
118
+ - lib/schemata/common/componentbase.rb
119
+ - lib/schemata/common/error.rb
120
+ - lib/schemata/common/msgbase.rb
121
+ - lib/schemata/common/msgtypebase.rb
122
+ - lib/schemata/common/parsed_msg.rb
123
+ - lib/schemata/dea/advertise_message/advertise_message_v1.rb
124
+ - lib/schemata/dea/advertise_message.rb
125
+ - lib/schemata/dea/dea_status_response/dea_status_response_v1.rb
126
+ - lib/schemata/dea/dea_status_response.rb
127
+ - lib/schemata/dea/discover_request/discover_request_v1.rb
128
+ - lib/schemata/dea/discover_request.rb
129
+ - lib/schemata/dea/droplet_status_response/droplet_status_response_v1.rb
120
130
  - lib/schemata/dea/droplet_status_response.rb
131
+ - lib/schemata/dea/exit_message/exit_message_v1.rb
132
+ - lib/schemata/dea/exit_message.rb
121
133
  - lib/schemata/dea/find_droplet_request/find_droplet_request_v1.rb
122
- - lib/schemata/dea/heartbeat_response.rb
123
134
  - lib/schemata/dea/find_droplet_request.rb
124
- - lib/schemata/dea/start_request/start_request_v1.rb
135
+ - lib/schemata/dea/find_droplet_response/find_droplet_response_v1.rb
136
+ - lib/schemata/dea/find_droplet_response.rb
137
+ - lib/schemata/dea/heartbeat_response/heartbeat_response_v1.rb
138
+ - lib/schemata/dea/heartbeat_response.rb
139
+ - lib/schemata/dea/hello_message/hello_message_v1.rb
125
140
  - lib/schemata/dea/hello_message.rb
126
- - lib/schemata/dea/update_request/update_request_v1.rb
127
- - lib/schemata/dea/dea_status_response.rb
128
- - lib/schemata/dea/droplet_status_response/droplet_status_response_v1.rb
129
- - lib/schemata/dea/discover_request/discover_request_v1.rb
141
+ - lib/schemata/dea/start_request/start_request_v1.rb
142
+ - lib/schemata/dea/start_request.rb
130
143
  - lib/schemata/dea/stop_request/stop_request_v1.rb
131
- - lib/schemata/dea/advertise_message/advertise_message_v1.rb
132
- - lib/schemata/dea/dea_status_response/dea_status_response_v1.rb
133
- - lib/schemata/dea/hello_message/hello_message_v1.rb
134
- - lib/schemata/dea/version.rb
135
- - lib/schemata/dea/heartbeat_response/heartbeat_response_v1.rb
136
144
  - lib/schemata/dea/stop_request.rb
137
- - lib/schemata/dea/start_request.rb
145
+ - lib/schemata/dea/update_request/update_request_v1.rb
138
146
  - lib/schemata/dea/update_request.rb
139
- - lib/schemata/dea/advertise_message.rb
140
- - lib/schemata/dea/find_droplet_response/find_droplet_response_v1.rb
141
- - lib/schemata/dea/discover_request.rb
142
- - lib/schemata/dea/exit_message.rb
147
+ - lib/schemata/dea/version.rb
143
148
  - lib/schemata/dea.rb
144
- - lib/schemata/common/msgtypebase.rb
145
- - lib/schemata/common/parsed_msg.rb
146
- - lib/schemata/common/msgbase.rb
147
- - lib/schemata/common/error.rb
148
- - lib/schemata/helpers/stringify.rb
149
+ - lib/schemata/helpers/decamelize.rb
149
150
  - lib/schemata/helpers/hash_copy.rb
150
- - spec/cloud_controller/cloud_controller_spec.rb
151
- - spec/cloud_controller/droplet_updated_message_spec.rb
152
- - spec/cloud_controller/hm_start_request_spec.rb
153
- - spec/cloud_controller/hm_stop_request_spec.rb
151
+ - lib/schemata/helpers/stringify.rb
152
+ - spec/cloud_controller_spec.rb
154
153
  - spec/common/helpers_spec.rb
155
154
  - spec/common/parsed_msg_spec.rb
156
155
  - spec/component/aux_data_spec.rb
@@ -158,31 +157,11 @@ files:
158
157
  - spec/component/component_foo_spec.rb
159
158
  - spec/component/foo_spec.rb
160
159
  - spec/component2/component2_bar_spec.rb
161
- - spec/dea/advertise_message_spec.rb
162
- - spec/dea/dea_spec.rb
163
- - spec/dea/dea_status_response_spec.rb
164
- - spec/dea/discover_request_spec.rb
165
- - spec/dea/droplet_status_response_spec.rb
166
- - spec/dea/exit_message_spec.rb
167
- - spec/dea/find_droplet_request_spec.rb
168
- - spec/dea/find_droplet_response_spec.rb
169
- - spec/dea/heartbeat_response_spec.rb
170
- - spec/dea/hello_message_spec.rb
171
- - spec/dea/start_request_spec.rb
172
- - spec/dea/stop_request_spec.rb
173
- - spec/dea/update_request_spec.rb
174
- - spec/health_manager/health_manager_spec.rb
175
- - spec/health_manager/health_request_spec.rb
176
- - spec/health_manager/health_response_spec.rb
177
- - spec/health_manager/status_crashed_response_spec.rb
178
- - spec/health_manager/status_flapping_response_spec.rb
179
- - spec/health_manager/status_request_spec.rb
180
- - spec/router/register_request_spec.rb
181
- - spec/router/router_spec.rb
182
- - spec/router/start_message_spec.rb
160
+ - spec/dea_spec.rb
161
+ - spec/health_manager_spec.rb
162
+ - spec/router_spec.rb
183
163
  - spec/spec_helper.rb
184
- - spec/staging/staging_message_spec.rb
185
- - spec/staging/staging_spec.rb
164
+ - spec/staging_spec.rb
186
165
  - spec/support/component_helpers.rb
187
166
  - spec/support/helpers.rb
188
167
  - spec/support/message_helpers.rb
@@ -212,10 +191,7 @@ signing_key:
212
191
  specification_version: 3
213
192
  summary: validation for cloundfoundry DEA messages
214
193
  test_files:
215
- - spec/cloud_controller/cloud_controller_spec.rb
216
- - spec/cloud_controller/droplet_updated_message_spec.rb
217
- - spec/cloud_controller/hm_start_request_spec.rb
218
- - spec/cloud_controller/hm_stop_request_spec.rb
194
+ - spec/cloud_controller_spec.rb
219
195
  - spec/common/helpers_spec.rb
220
196
  - spec/common/parsed_msg_spec.rb
221
197
  - spec/component/aux_data_spec.rb
@@ -223,31 +199,11 @@ test_files:
223
199
  - spec/component/component_foo_spec.rb
224
200
  - spec/component/foo_spec.rb
225
201
  - spec/component2/component2_bar_spec.rb
226
- - spec/dea/advertise_message_spec.rb
227
- - spec/dea/dea_spec.rb
228
- - spec/dea/dea_status_response_spec.rb
229
- - spec/dea/discover_request_spec.rb
230
- - spec/dea/droplet_status_response_spec.rb
231
- - spec/dea/exit_message_spec.rb
232
- - spec/dea/find_droplet_request_spec.rb
233
- - spec/dea/find_droplet_response_spec.rb
234
- - spec/dea/heartbeat_response_spec.rb
235
- - spec/dea/hello_message_spec.rb
236
- - spec/dea/start_request_spec.rb
237
- - spec/dea/stop_request_spec.rb
238
- - spec/dea/update_request_spec.rb
239
- - spec/health_manager/health_manager_spec.rb
240
- - spec/health_manager/health_request_spec.rb
241
- - spec/health_manager/health_response_spec.rb
242
- - spec/health_manager/status_crashed_response_spec.rb
243
- - spec/health_manager/status_flapping_response_spec.rb
244
- - spec/health_manager/status_request_spec.rb
245
- - spec/router/register_request_spec.rb
246
- - spec/router/router_spec.rb
247
- - spec/router/start_message_spec.rb
202
+ - spec/dea_spec.rb
203
+ - spec/health_manager_spec.rb
204
+ - spec/router_spec.rb
248
205
  - spec/spec_helper.rb
249
- - spec/staging/staging_message_spec.rb
250
- - spec/staging/staging_spec.rb
206
+ - spec/staging_spec.rb
251
207
  - spec/support/component_helpers.rb
252
208
  - spec/support/helpers.rb
253
209
  - spec/support/message_helpers.rb
@@ -1,10 +0,0 @@
1
- require 'schemata/cloud_controller'
2
- require 'spec_helper'
3
-
4
- describe Schemata::CloudController::DropletUpdatedMessage do
5
- it_behaves_like "a message type"
6
- end
7
-
8
- describe Schemata::CloudController::DropletUpdatedMessage::V1 do
9
- it_behaves_like "a message"
10
- end
@@ -1,11 +0,0 @@
1
- require "schemata/cloud_controller"
2
-
3
- describe Schemata::CloudController::HmStartRequest do
4
- it_behaves_like "a message type"
5
- end
6
-
7
- Schemata::CloudController::HmStartRequest.versions.each do |v|
8
- describe Schemata::CloudController::HmStartRequest::const_get("V#{v}") do
9
- it_behaves_like "a message"
10
- end
11
- end
@@ -1,12 +0,0 @@
1
- require 'schemata/cloud_controller'
2
- require 'spec_helper'
3
-
4
- describe Schemata::CloudController::HmStopRequest do
5
- it_behaves_like "a message type"
6
- end
7
-
8
- Schemata::CloudController::HmStopRequest.versions.each do |v|
9
- describe Schemata::CloudController::HmStopRequest::const_get("V#{v}") do
10
- it_behaves_like "a message"
11
- end
12
- end
@@ -1,10 +0,0 @@
1
- require 'schemata/dea'
2
- require 'spec_helper'
3
-
4
- describe Schemata::DEA::AdvertiseMessage do
5
- it_behaves_like "a message type"
6
- end
7
-
8
- describe Schemata::DEA::AdvertiseMessage::V1 do
9
- it_behaves_like "a message"
10
- end
@@ -1,10 +0,0 @@
1
- require 'schemata/dea'
2
- require 'spec_helper'
3
-
4
- describe Schemata::DEA::DropletStatusResponse do
5
- it_behaves_like "a message type"
6
- end
7
-
8
- describe Schemata::DEA::DropletStatusResponse::V1 do
9
- it_behaves_like "a message"
10
- end