simple-websocket-vcr 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -0
- data/CHANGES.md +16 -2
- data/README.md +0 -1
- data/lib/simple_websocket_vcr.rb +95 -76
- data/lib/simple_websocket_vcr/cassette.rb +115 -36
- data/lib/simple_websocket_vcr/configuration.rb +14 -11
- data/lib/simple_websocket_vcr/errors.rb +7 -9
- data/lib/simple_websocket_vcr/monkey_patch.rb +18 -0
- data/lib/simple_websocket_vcr/recordable_websocket_client.rb +97 -97
- data/lib/simple_websocket_vcr/version.rb +2 -4
- data/simple-websocket-vcr.gemspec +7 -6
- data/spec/fixtures/vcr_cassettes/EXPLICIT/some_explicitly_specified_json_cassette.json +30 -0
- data/spec/fixtures/vcr_cassettes/EXPLICIT/some_explicitly_specified_yaml_cassette.yml +44 -0
- data/spec/fixtures/vcr_cassettes/EXPLICIT/some_template.json +13 -0
- data/spec/fixtures/vcr_cassettes/EXPLICIT/some_template.yml +25 -0
- data/spec/fixtures/vcr_cassettes/VCR_for_WS/automatically_picked_cassette_name_is_ok,_when_describing_parent_and_example_child1.yml +2 -0
- data/spec/fixtures/vcr_cassettes/VCR_for_WS/automatically_picked_cassette_name_is_ok,_when_describing_parent_and_example_child2.yml +2 -0
- data/spec/fixtures/vcr_cassettes/VCR_for_WS/{automatically_picked_cassette_name_is_ok,_when_describing_parent_and_example_child1.json → automatically_picked_cassette_name_is_ok,_when_describing_parent_and_example_child2_for_json.json} +0 -0
- data/spec/fixtures/vcr_cassettes/VCR_for_WS/automatically_picked_cassette_name_is_ok,_when_using_context_foo_and_example_bar.yml +2 -0
- data/spec/fixtures/vcr_cassettes/VCR_for_WS/should_record_also_the_outgoing_communication.yml +11 -0
- data/spec/fixtures/vcr_cassettes/VCR_for_WS/{should_record_the_closing_event.json → should_record_the_closing_event(json).json} +1 -1
- data/spec/fixtures/vcr_cassettes/VCR_for_WS/should_record_the_closing_event(yaml).yml +6 -0
- data/spec/fixtures/vcr_cassettes/VCR_for_WS/should_record_the_very_first_message_caught_on_the_client_yielded_by_the_connect_method.yml +5 -0
- data/spec/vcr_spec.rb +160 -57
- metadata +62 -51
- data/spec/fixtures/vcr_cassettes/EXPLICIT/some_explicitly_specified_cassette.json +0 -30
- data/spec/fixtures/vcr_cassettes/VCR_for_WS/automatically_picked_cassette_name_is_ok,_when_describing_parent_and_example_child2.json +0 -3
- data/spec/fixtures/vcr_cassettes/VCR_for_WS/automatically_picked_cassette_name_is_ok,_when_using_context_foo_and_example_bar.json +0 -3
- data/spec/fixtures/vcr_cassettes/VCR_for_WS/should_record_also_the_outgoing_communication.json +0 -21
- data/spec/fixtures/vcr_cassettes/VCR_for_WS/should_record_the_very_first_message_caught_on_the_client_yielded_by_the_connect_method.json +0 -9
@@ -1,11 +1,9 @@
|
|
1
|
-
module
|
2
|
-
module
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
class NoMoreSessionsError < VCRError; end
|
9
|
-
end
|
1
|
+
module WebSocketVCR
|
2
|
+
module Errors
|
3
|
+
class VCRError < StandardError; end
|
4
|
+
class OperationMismatchError < VCRError; end
|
5
|
+
class DataMismatchError < VCRError; end
|
6
|
+
class NoCassetteError < VCRError; end
|
7
|
+
class NoMoreSessionsError < VCRError; end
|
10
8
|
end
|
11
9
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module WebSocket::Client::Simple
|
2
|
+
class << self
|
3
|
+
alias_method :real_connect, :connect
|
4
|
+
|
5
|
+
def connect(url, options = {})
|
6
|
+
if WebSocketVCR.configuration.hook_uris.any? { |u| url.include?(u) }
|
7
|
+
cassette = WebSocketVCR.cassette
|
8
|
+
live = cassette.recording?
|
9
|
+
real_client = real_connect(url, options) if live
|
10
|
+
fake_client = WebSocketVCR::RecordableWebsocketClient.new(cassette, live ? real_client : nil)
|
11
|
+
yield fake_client if block_given?
|
12
|
+
fake_client
|
13
|
+
else
|
14
|
+
real_connect(url, options)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -3,129 +3,129 @@ require 'websocket-client-simple'
|
|
3
3
|
require 'base64'
|
4
4
|
require 'simple_websocket_vcr/errors'
|
5
5
|
|
6
|
-
module
|
7
|
-
|
8
|
-
include Errors
|
6
|
+
module WebSocketVCR
|
7
|
+
include Errors
|
9
8
|
|
10
|
-
|
11
|
-
|
9
|
+
class RecordableWebsocketClient
|
10
|
+
include EventEmitter
|
12
11
|
|
13
|
-
|
14
|
-
|
12
|
+
attr_reader :live, :client
|
13
|
+
attr_accessor :session, :open, :thread
|
15
14
|
|
16
|
-
|
17
|
-
|
15
|
+
def initialize(cassette, real_client)
|
16
|
+
fail NoCassetteError 'specify the cassette' unless cassette
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
26
|
-
@recording = cassette.next_session
|
18
|
+
if cassette.recording?
|
19
|
+
@live = true
|
20
|
+
@client = real_client
|
21
|
+
else
|
22
|
+
@live = false
|
23
|
+
@open = true
|
27
24
|
end
|
25
|
+
@session = cassette.next_session
|
26
|
+
end
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
def send(data, opt = { type: :text })
|
29
|
+
_write(:send, data, opt)
|
30
|
+
end
|
32
31
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
def on(event, params = {}, &block)
|
33
|
+
super(event, params, &block) unless @live
|
34
|
+
_read(event, params, &block)
|
35
|
+
end
|
37
36
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
def emit(event, *data)
|
38
|
+
@session.store(operation: 'read', data: data) if @live
|
39
|
+
super(event, *data)
|
40
|
+
end
|
42
41
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
end
|
42
|
+
def open?
|
43
|
+
if @live
|
44
|
+
@client.open?
|
45
|
+
else
|
46
|
+
@open
|
49
47
|
end
|
48
|
+
end
|
50
49
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
end
|
50
|
+
def close
|
51
|
+
if @live
|
52
|
+
@session.store(operation: 'close')
|
53
|
+
@client.close
|
54
|
+
else
|
55
|
+
sleep 0.5 if @session.head.operation != 'close'
|
56
|
+
record = @session.next
|
57
|
+
_ensure_operation('close', record.operation)
|
58
|
+
Thread.kill @thread if @thread
|
59
|
+
@open = false
|
62
60
|
end
|
61
|
+
end
|
63
62
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
end
|
63
|
+
private
|
64
|
+
|
65
|
+
def _write(method, data, opt)
|
66
|
+
text_data = opt[:type] == :text ? data.dup : Base64.encode64(data.dup)
|
67
|
+
if @live
|
68
|
+
@client.__send__(method, data, opt)
|
69
|
+
@session.store(operation: 'write', data: text_data)
|
70
|
+
else
|
71
|
+
sleep 0.5 if @session.head.operation != 'write'
|
72
|
+
record = @session.next
|
73
|
+
_ensure_operation('write', record.operation)
|
74
|
+
_ensure_data(text_data, record.data)
|
77
75
|
end
|
76
|
+
end
|
78
77
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
end
|
87
|
-
else
|
88
|
-
wait_for_reads(event, params[:once])
|
78
|
+
def _read(event, params, &_block)
|
79
|
+
if @live
|
80
|
+
rec = @session
|
81
|
+
@client.on(event, params) do |msg|
|
82
|
+
data = msg.type == :text ? msg.data : Base64.decode64(msg.data)
|
83
|
+
rec.store(operation: 'read', type: msg.type, data: data)
|
84
|
+
yield(msg)
|
89
85
|
end
|
86
|
+
else
|
87
|
+
wait_for_reads(event, params[:once])
|
90
88
|
end
|
89
|
+
end
|
91
90
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
emit(event, data)
|
107
|
-
break if once
|
108
|
-
else
|
109
|
-
sleep 0.1 # TODO: config
|
91
|
+
def wait_for_reads(event, once = false)
|
92
|
+
@thread = Thread.new do
|
93
|
+
# if the next recorded operation is a 'read', take all the reads until next write
|
94
|
+
# and translate them to the events
|
95
|
+
while @open && !@session.empty?
|
96
|
+
begin
|
97
|
+
if @session.head.operation == 'read'
|
98
|
+
record = @session.next
|
99
|
+
data = record.data
|
100
|
+
data = Base64.decode64(msg) if record.type != 'text'
|
101
|
+
data = ::WebSocket::Frame::Data.new(data)
|
102
|
+
|
103
|
+
def data.data
|
104
|
+
self
|
110
105
|
end
|
106
|
+
|
107
|
+
emit(event, data)
|
108
|
+
break if once
|
109
|
+
else
|
110
|
+
sleep 0.1 # TODO: config
|
111
111
|
end
|
112
112
|
end
|
113
113
|
end
|
114
114
|
end
|
115
|
+
end
|
115
116
|
|
116
|
-
|
117
|
-
|
118
|
-
|
117
|
+
def _take_first_read
|
118
|
+
@session.delete_at(@session.index { |record| record.operation == 'read' } || @session.length)
|
119
|
+
end
|
119
120
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
121
|
+
def _ensure_operation(desired, actual)
|
122
|
+
string = "Expected to '#{desired}' but the next operation in recording was '#{actual}'"
|
123
|
+
fail string unless desired == actual
|
124
|
+
end
|
124
125
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
end
|
126
|
+
def _ensure_data(desired, actual)
|
127
|
+
string = "Expected data to be '#{desired}' but next data in recording was '#{actual}'"
|
128
|
+
fail string unless desired == actual
|
129
129
|
end
|
130
130
|
end
|
131
131
|
end
|
@@ -5,7 +5,7 @@ require 'simple_websocket_vcr/version'
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
7
|
gem.name = 'simple-websocket-vcr'
|
8
|
-
gem.version =
|
8
|
+
gem.version = WebSocketVCR::VERSION
|
9
9
|
gem.authors = ['Jirka Kremser']
|
10
10
|
gem.email = ['jkremser@redhat.com']
|
11
11
|
gem.description = 'Websocket VCR add-on'
|
@@ -19,12 +19,13 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
20
20
|
gem.require_paths = ['lib']
|
21
21
|
|
22
|
-
gem.
|
22
|
+
gem.add_runtime_dependency 'websocket-client-simple', '= 0.3.0'
|
23
|
+
|
24
|
+
gem.add_development_dependency 'coveralls', '~> 0.8'
|
23
25
|
gem.add_development_dependency 'rspec-rails', '~> 3.0'
|
24
26
|
gem.add_development_dependency 'rake', '~> 11'
|
25
|
-
gem.add_development_dependency 'vcr'
|
26
|
-
gem.add_development_dependency 'webmock', '~> 1.7'
|
27
27
|
gem.add_development_dependency 'rubocop', '= 0.34.2'
|
28
|
-
gem.add_development_dependency '
|
29
|
-
gem.add_development_dependency '
|
28
|
+
gem.add_development_dependency 'shoulda', '~> 3.5'
|
29
|
+
gem.add_development_dependency 'vcr', '~> 2.9'
|
30
|
+
gem.add_development_dependency 'webmock', '~> 1.7'
|
30
31
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
[
|
2
|
+
[
|
3
|
+
{
|
4
|
+
"operation": "read",
|
5
|
+
"type": "text",
|
6
|
+
"data": "WelcomeResponse={\"sessionId\":\"6lLLtFyPAUmpeh3JiSUW3b1D1YN6FTLGHc2Yt8dI\"}"
|
7
|
+
},
|
8
|
+
{
|
9
|
+
"operation": "write",
|
10
|
+
"data": "something_1"
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"operation": "read",
|
14
|
+
"type": "text",
|
15
|
+
"data": "GenericErrorResponse={\"errorMessage\":\"Failed to process message [?]\",\"stackTrace\":\"java.lang.IllegalArgumentException: Cannot deserialize: [something_1]\\n\\tat org.hawkular.cmdgw.api.ApiDeserializer.fromHawkularFormat(ApiDeserializer.java:68)\\n\\tat org.hawkular.cmdgw.api.ApiDeserializer.deserialize(ApiDeserializer.java:84)\\n\\tat org.hawkular.cmdgw.command.ws.server.AbstractGatewayWebSocket.onMessage(AbstractGatewayWebSocket.java:213)\\n\\tat sun.reflect.GeneratedMethodAccessor686.invoke(Unknown Source)\\n\\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\\n\\tat java.lang.reflect.Method.invoke(Method.java:497)\\n\\tat io.undertow.websockets.jsr.annotated.BoundMethod.invoke(BoundMethod.java:87)\\n\\tat io.undertow.websockets.jsr.annotated.AnnotatedEndpoint$2$1.run(AnnotatedEndpoint.java:150)\\n\\tat io.undertow.websockets.jsr.ServerWebSocketContainer.invokeEndpointMethod(ServerWebSocketContainer.java:553)\\n\\tat io.undertow.websockets.jsr.annotated.AnnotatedEndpoint$2.onMessage(AnnotatedEndpoint.java:145)\\n\\tat io.undertow.websockets.jsr.FrameHandler$7.run(FrameHandler.java:283)\\n\\tat io.undertow.websockets.jsr.ServerWebSocketContainer.invokeEndpointMethod(ServerWebSocketContainer.java:553)\\n\\tat io.undertow.websockets.jsr.ServerWebSocketContainer$5.run(ServerWebSocketContainer.java:538)\\n\\tat io.undertow.websockets.jsr.OrderedExecutor$ExecutorTask.run(OrderedExecutor.java:67)\\n\\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\\n\\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\\n\\tat java.lang.Thread.run(Thread.java:745)\\n\"}"
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"operation": "write",
|
19
|
+
"data": "something_2"
|
20
|
+
},
|
21
|
+
{
|
22
|
+
"operation": "read",
|
23
|
+
"type": "text",
|
24
|
+
"data": "GenericErrorResponse={\"errorMessage\":\"Failed to process message [?]\",\"stackTrace\":\"java.lang.IllegalArgumentException: Cannot deserialize: [something_2]\\n\\tat org.hawkular.cmdgw.api.ApiDeserializer.fromHawkularFormat(ApiDeserializer.java:68)\\n\\tat org.hawkular.cmdgw.api.ApiDeserializer.deserialize(ApiDeserializer.java:84)\\n\\tat org.hawkular.cmdgw.command.ws.server.AbstractGatewayWebSocket.onMessage(AbstractGatewayWebSocket.java:213)\\n\\tat sun.reflect.GeneratedMethodAccessor686.invoke(Unknown Source)\\n\\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\\n\\tat java.lang.reflect.Method.invoke(Method.java:497)\\n\\tat io.undertow.websockets.jsr.annotated.BoundMethod.invoke(BoundMethod.java:87)\\n\\tat io.undertow.websockets.jsr.annotated.AnnotatedEndpoint$2$1.run(AnnotatedEndpoint.java:150)\\n\\tat io.undertow.websockets.jsr.ServerWebSocketContainer.invokeEndpointMethod(ServerWebSocketContainer.java:553)\\n\\tat io.undertow.websockets.jsr.annotated.AnnotatedEndpoint$2.onMessage(AnnotatedEndpoint.java:145)\\n\\tat io.undertow.websockets.jsr.FrameHandler$7.run(FrameHandler.java:283)\\n\\tat io.undertow.websockets.jsr.ServerWebSocketContainer.invokeEndpointMethod(ServerWebSocketContainer.java:553)\\n\\tat io.undertow.websockets.jsr.ServerWebSocketContainer$5.run(ServerWebSocketContainer.java:538)\\n\\tat io.undertow.websockets.jsr.OrderedExecutor$ExecutorTask.run(OrderedExecutor.java:67)\\n\\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\\n\\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\\n\\tat java.lang.Thread.run(Thread.java:745)\\n\"}"
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"operation": "close"
|
28
|
+
}
|
29
|
+
]
|
30
|
+
]
|
@@ -0,0 +1,44 @@
|
|
1
|
+
---
|
2
|
+
websocket_interactions:
|
3
|
+
- - operation: read
|
4
|
+
type: text
|
5
|
+
data: WelcomeResponse={"sessionId":"<%= foobar %>"}
|
6
|
+
- operation: write
|
7
|
+
data: something_1
|
8
|
+
- operation: read
|
9
|
+
type: text
|
10
|
+
data: 'GenericErrorResponse={"errorMessage":"Failed to process message [?]","stackTrace":"java.lang.IllegalArgumentException:
|
11
|
+
Cannot deserialize: [something_1]\n\tat org.hawkular.cmdgw.api.ApiDeserializer.fromHawkularFormat(ApiDeserializer.java:68)\n\tat
|
12
|
+
org.hawkular.cmdgw.api.ApiDeserializer.deserialize(ApiDeserializer.java:84)\n\tat
|
13
|
+
org.hawkular.cmdgw.command.ws.server.AbstractGatewayWebSocket.onMessage(AbstractGatewayWebSocket.java:213)\n\tat
|
14
|
+
sun.reflect.GeneratedMethodAccessor686.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat
|
15
|
+
java.lang.reflect.Method.invoke(Method.java:497)\n\tat io.undertow.websockets.jsr.annotated.BoundMethod.invoke(BoundMethod.java:87)\n\tat
|
16
|
+
io.undertow.websockets.jsr.annotated.AnnotatedEndpoint$2$1.run(AnnotatedEndpoint.java:150)\n\tat
|
17
|
+
io.undertow.websockets.jsr.ServerWebSocketContainer.invokeEndpointMethod(ServerWebSocketContainer.java:553)\n\tat
|
18
|
+
io.undertow.websockets.jsr.annotated.AnnotatedEndpoint$2.onMessage(AnnotatedEndpoint.java:145)\n\tat
|
19
|
+
io.undertow.websockets.jsr.FrameHandler$7.run(FrameHandler.java:283)\n\tat io.undertow.websockets.jsr.ServerWebSocketContainer.invokeEndpointMethod(ServerWebSocketContainer.java:553)\n\tat
|
20
|
+
io.undertow.websockets.jsr.ServerWebSocketContainer$5.run(ServerWebSocketContainer.java:538)\n\tat
|
21
|
+
io.undertow.websockets.jsr.OrderedExecutor$ExecutorTask.run(OrderedExecutor.java:67)\n\tat
|
22
|
+
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat
|
23
|
+
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat
|
24
|
+
java.lang.Thread.run(Thread.java:745)\n"}'
|
25
|
+
- operation: write
|
26
|
+
data: something_2
|
27
|
+
- operation: read
|
28
|
+
type: text
|
29
|
+
data: 'GenericErrorResponse={"errorMessage":"Failed to process message [?]","stackTrace":"java.lang.IllegalArgumentException:
|
30
|
+
Cannot deserialize: [something_2]\n\tat org.hawkular.cmdgw.api.ApiDeserializer.fromHawkularFormat(ApiDeserializer.java:68)\n\tat
|
31
|
+
org.hawkular.cmdgw.api.ApiDeserializer.deserialize(ApiDeserializer.java:84)\n\tat
|
32
|
+
org.hawkular.cmdgw.command.ws.server.AbstractGatewayWebSocket.onMessage(AbstractGatewayWebSocket.java:213)\n\tat
|
33
|
+
sun.reflect.GeneratedMethodAccessor686.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat
|
34
|
+
java.lang.reflect.Method.invoke(Method.java:497)\n\tat io.undertow.websockets.jsr.annotated.BoundMethod.invoke(BoundMethod.java:87)\n\tat
|
35
|
+
io.undertow.websockets.jsr.annotated.AnnotatedEndpoint$2$1.run(AnnotatedEndpoint.java:150)\n\tat
|
36
|
+
io.undertow.websockets.jsr.ServerWebSocketContainer.invokeEndpointMethod(ServerWebSocketContainer.java:553)\n\tat
|
37
|
+
io.undertow.websockets.jsr.annotated.AnnotatedEndpoint$2.onMessage(AnnotatedEndpoint.java:145)\n\tat
|
38
|
+
io.undertow.websockets.jsr.FrameHandler$7.run(FrameHandler.java:283)\n\tat io.undertow.websockets.jsr.ServerWebSocketContainer.invokeEndpointMethod(ServerWebSocketContainer.java:553)\n\tat
|
39
|
+
io.undertow.websockets.jsr.ServerWebSocketContainer$5.run(ServerWebSocketContainer.java:538)\n\tat
|
40
|
+
io.undertow.websockets.jsr.OrderedExecutor$ExecutorTask.run(OrderedExecutor.java:67)\n\tat
|
41
|
+
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat
|
42
|
+
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat
|
43
|
+
java.lang.Thread.run(Thread.java:745)\n"}'
|
44
|
+
- operation: close
|
@@ -0,0 +1,25 @@
|
|
1
|
+
---
|
2
|
+
websocket_interactions:
|
3
|
+
- - operation: read
|
4
|
+
type: text
|
5
|
+
data: WelcomeResponse={"<%= something %>":"KOrViCF_93axNx-WyGlhT6yktwqbJIl97mrxQXC5"}
|
6
|
+
- operation: write
|
7
|
+
data: something_1
|
8
|
+
- operation: read
|
9
|
+
type: text
|
10
|
+
data: 'GenericErrorResponse={"errorMessage":"Failed to process message [?]","stackTrace":"java.lang.IllegalArgumentException:
|
11
|
+
Cannot deserialize: [something_1]\n\tat org.hawkular.cmdgw.api.ApiDeserializer.fromHawkularFormat(ApiDeserializer.java:68)\n\tat
|
12
|
+
org.hawkular.cmdgw.api.ApiDeserializer.deserialize(ApiDeserializer.java:84)\n\tat
|
13
|
+
org.hawkular.cmdgw.command.ws.server.AbstractGatewayWebSocket.onMessage(AbstractGatewayWebSocket.java:213)\n\tat
|
14
|
+
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat
|
15
|
+
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat
|
16
|
+
java.lang.reflect.Method.invoke(Method.java:497)\n\tat io.undertow.websockets.jsr.annotated.BoundMethod.invoke(BoundMethod.java:87)\n\tat
|
17
|
+
io.undertow.websockets.jsr.annotated.AnnotatedEndpoint$2$1.run(AnnotatedEndpoint.java:150)\n\tat
|
18
|
+
io.undertow.websockets.jsr.ServerWebSocketContainer.invokeEndpointMethod(ServerWebSocketContainer.java:553)\n\tat
|
19
|
+
io.undertow.websockets.jsr.annotated.AnnotatedEndpoint$2.onMessage(AnnotatedEndpoint.java:145)\n\tat
|
20
|
+
io.undertow.websockets.jsr.FrameHandler$7.run(FrameHandler.java:283)\n\tat io.undertow.websockets.jsr.ServerWebSocketContainer.invokeEndpointMethod(ServerWebSocketContainer.java:553)\n\tat
|
21
|
+
io.undertow.websockets.jsr.ServerWebSocketContainer$5.run(ServerWebSocketContainer.java:538)\n\tat
|
22
|
+
io.undertow.websockets.jsr.OrderedExecutor$ExecutorTask.run(OrderedExecutor.java:67)\n\tat
|
23
|
+
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat
|
24
|
+
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat
|
25
|
+
java.lang.Thread.run(Thread.java:745)\n"}'
|
File without changes
|
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
websocket_interactions:
|
3
|
+
- - operation: read
|
4
|
+
type: text
|
5
|
+
data: WelcomeResponse={"sessionId":"XQVVtE53wxz1lmMsqz2TbmR68ilFzDxLOOpkKGpd"}
|
6
|
+
- operation: write
|
7
|
+
data: something 1
|
8
|
+
- operation: write
|
9
|
+
data: something 2
|
10
|
+
- operation: write
|
11
|
+
data: something 3
|