runivedo 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Test Perspective.xml +152 -0
- data/lib/runivedo/{session.rb → connection.rb} +4 -18
- data/lib/runivedo/remote_object.rb +6 -6
- data/lib/runivedo/version.rb +1 -1
- data/lib/runivedo.rb +1 -1
- data/test/remote_object_test.rb +17 -17
- data/test/session_test.rb +8 -7
- data/test/sql_test.rb +4 -2
- data/test/test_helper.rb +3 -2
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 337b18c990b0bd5e190370b93d146d430038e7a6
|
|
4
|
+
data.tar.gz: f3dfb2bfe9e898df3a66aa06a777348cb2f82843
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 64f70ae9bb3137faf86e7fce761f8e2be2e1d5ec8803803cba8a2b2d9f5ee8c3550b6cd2552e45c182b71ce88e5120b0f350919507888c55a77549406bcfe0d2
|
|
7
|
+
data.tar.gz: 6129ac6e393135adbe4d385ca0e6c81772f4503730b82708410de6e793b8a2e66716d78b20356a0c7affef1ba353ee5faacda9b496596cd70222327fc9362827
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<uts date="2014-10-02 20:50:44 +0000" generator="uspec" version="1.0">
|
|
3
|
+
<specification>
|
|
4
|
+
<tables>
|
|
5
|
+
<table name="Tables" description="Atomic table objects in the Univedo data model." uuid="af4ffbee-0bfa-4211-9e6b-726b921df081">
|
|
6
|
+
<fields>
|
|
7
|
+
<field name="name" description="" type="char" length="50" uuid="607b39d7-b959-4ccf-8a65-94f6c5e1d9e5"/>
|
|
8
|
+
<field name="uuid" description="" type="uuid" uuid="1c3fdf6a-c86a-4bc7-86d3-0bcb177b4e86"/>
|
|
9
|
+
<field name="selective" description="" type="bool" uuid="01ab22c1-e78e-4323-b635-5f9748597c1f"/>
|
|
10
|
+
<field name="description" description="" type="text" uuid="ebc42780-12bd-4844-a712-f5feda39ac38"/>
|
|
11
|
+
</fields>
|
|
12
|
+
</table>
|
|
13
|
+
<table name="Fields" description="Columns in utoms or tables in the Univedo data model." uuid="76231b4f-0c1a-453f-9cf4-f299bd043436">
|
|
14
|
+
<fields>
|
|
15
|
+
<field name="name" description="" type="char" length="50" uuid="00397067-f1b1-44b7-8637-769e0f86e6fd"/>
|
|
16
|
+
<field name="uuid" description="" type="uuid" uuid="d23f4669-2ab7-42ac-98e2-467ef332b47d"/>
|
|
17
|
+
<field name="type" description="" type="char" length="20" uuid="7dbe9ebb-5178-4aa5-91bb-096fb1ffb894"/>
|
|
18
|
+
<field name="foreign_key" description="" type="id" uuid="cd380935-5915-4b65-ade0-a5fa1144ee2e"/>
|
|
19
|
+
<field name="foreign_table" description="" type="id" uuid="ec74db31-3bc6-409c-ae2e-9a6b8d1f2a6c"/>
|
|
20
|
+
<field name="foreign_inverse" description="" type="bool" uuid="90634fbe-9818-490d-951b-1b81ffe9cf8e"/>
|
|
21
|
+
<field name="description" description="" type="text" uuid="9b1014e1-ec8e-4231-8746-36b0e8c2379f"/>
|
|
22
|
+
</fields>
|
|
23
|
+
</table>
|
|
24
|
+
<table name="Dummy" description="Dummy utom for test purposes. Apps can use this utom for testing but should not make any assumptions on data." uuid="195f5ecf-7da9-46c7-af09-3e6c0aaaf782">
|
|
25
|
+
<fields>
|
|
26
|
+
<field name="dummy_int8" description="" type="integer" length="1" uuid="43afa38a-28c0-46fc-bd0e-4e302e8583ae"/>
|
|
27
|
+
<field name="dummy_bool" description="" type="bool" uuid="6666c7a8-ae19-470a-88c3-5410f0ef6cbd"/>
|
|
28
|
+
<field name="dummy_blob" description="" type="blob" uuid="9ddabd19-4af4-499a-b579-32e4aa369df5"/>
|
|
29
|
+
<field name="dummy_char" description="" type="char" length="10" uuid="cadd88cc-0d52-46c5-9daf-975085a50b8e"/>
|
|
30
|
+
<field name="dummy_int16" description="" type="integer" length="2" uuid="ca7f8ef6-abbb-49da-9165-e97b6d1062cc"/>
|
|
31
|
+
<field name="dummy_int32" description="" type="integer" length="4" uuid="c9f62a3d-84af-4552-848f-7fc35124021a"/>
|
|
32
|
+
<field name="dummy_int64" description="" type="integer" length="8" uuid="cc69b4db-017e-4a57-837a-9e916ab40728"/>
|
|
33
|
+
<field name="dummy_float" description="" type="float" length="4" uuid="29d3812a-82c2-4022-9e88-4b1edd980432"/>
|
|
34
|
+
<field name="dummy_double" description="" type="float" length="8" uuid="23319e53-4f4e-48ad-b6df-93d4d432ed33"/>
|
|
35
|
+
<field name="dummy_text" description="" type="text" uuid="76df4e6a-785e-4615-b112-19b764e61c05"/>
|
|
36
|
+
<field name="dummy_datetime" description="" type="datetime" uuid="74860bb5-21eb-4eaf-b213-904587839d37"/>
|
|
37
|
+
<field name="dummy_uuid" description="" type="uuid" uuid="8d506bbb-9e41-4f51-a522-3646977d0bb5"/>
|
|
38
|
+
<field name="dummy_id" description="" type="id" uuid="9e593d3f-15fe-42ba-b9f2-6248dc6d16df"/>
|
|
39
|
+
</fields>
|
|
40
|
+
</table>
|
|
41
|
+
</tables>
|
|
42
|
+
<keys>
|
|
43
|
+
<key name="Owner" description="" uuid="f39d26c0-1e62-4133-b08f-10bb3855c223"/>
|
|
44
|
+
</keys>
|
|
45
|
+
<events>
|
|
46
|
+
<event name="inserted" description="" uuid="12b3e063-7aa8-44e7-bc8c-4a1b1a238454"/>
|
|
47
|
+
<event name="deleted" description="" uuid="9507ee43-ea4b-4ba7-88b2-9391ca59dc8a"/>
|
|
48
|
+
</events>
|
|
49
|
+
</specification>
|
|
50
|
+
<apps>
|
|
51
|
+
<app uuid="cefb4ed2-4ce3-4825-8550-b68a3c142f0a" name="Test Perspective" description="Sample perspective used for testing.">
|
|
52
|
+
<tables>
|
|
53
|
+
<table name="dummy" description="" specification="195f5ecf-7da9-46c7-af09-3e6c0aaaf782" selective="true">
|
|
54
|
+
<fields>
|
|
55
|
+
<field name="dummy_int8" description="" specification="43afa38a-28c0-46fc-bd0e-4e302e8583ae"/>
|
|
56
|
+
<field name="dummy_bool" description="" specification="6666c7a8-ae19-470a-88c3-5410f0ef6cbd"/>
|
|
57
|
+
<field name="dummy_blob" description="" specification="9ddabd19-4af4-499a-b579-32e4aa369df5"/>
|
|
58
|
+
<field name="dummy_char" description="" specification="cadd88cc-0d52-46c5-9daf-975085a50b8e"/>
|
|
59
|
+
<field name="dummy_int16" description="" specification="ca7f8ef6-abbb-49da-9165-e97b6d1062cc"/>
|
|
60
|
+
<field name="dummy_int32" description="" specification="c9f62a3d-84af-4552-848f-7fc35124021a"/>
|
|
61
|
+
<field name="dummy_int64" description="" specification="cc69b4db-017e-4a57-837a-9e916ab40728"/>
|
|
62
|
+
<field name="dummy_float" description="" specification="29d3812a-82c2-4022-9e88-4b1edd980432"/>
|
|
63
|
+
<field name="dummy_double" description="" specification="23319e53-4f4e-48ad-b6df-93d4d432ed33"/>
|
|
64
|
+
<field name="dummy_text" description="" specification="76df4e6a-785e-4615-b112-19b764e61c05"/>
|
|
65
|
+
<field name="dummy_datetime" description="" specification="74860bb5-21eb-4eaf-b213-904587839d37"/>
|
|
66
|
+
<field name="dummy_uuid" description="" specification="8d506bbb-9e41-4f51-a522-3646977d0bb5"/>
|
|
67
|
+
<field name="dummy_id" description="" specification="9e593d3f-15fe-42ba-b9f2-6248dc6d16df"/>
|
|
68
|
+
<field name="foreign_key_id" description="" type="foreign_key" foreign_table="dummy" foreign_key="key" foreign_inverse="false"/>
|
|
69
|
+
<field name="id" description="" specification="c36ce2f6-c4f9-4133-841d-3da4f45f62ca"/>
|
|
70
|
+
<field name="created_at" description="" specification="b749da4b-3c27-4e11-8be2-6cc5c9cdc7c7"/>
|
|
71
|
+
<field name="updated_at" description="" specification="b34d7140-9005-4362-aa5d-1e091f5772df"/>
|
|
72
|
+
<field name="human_readable" description="" specification="4cf63bae-c2a9-4958-8809-087d67ff782a"/>
|
|
73
|
+
<field name="card" description="" specification="2a8ea640-4311-498f-9190-db0442f785c3"/>
|
|
74
|
+
<field name="foreign_key1_id" description="" type="foreign_key" foreign_table="dummy" foreign_key="key1" foreign_inverse="false"/>
|
|
75
|
+
</fields>
|
|
76
|
+
</table>
|
|
77
|
+
<table name="virt" description="">
|
|
78
|
+
<fields>
|
|
79
|
+
<field name="dummy_id" description="" type="foreign_key" foreign_table="dummy" foreign_key="key" foreign_inverse="false"/>
|
|
80
|
+
<field name="self" description="" type="foreign_key" foreign_table="virt" foreign_key="key" foreign_inverse="false"/>
|
|
81
|
+
<field name="inverse" description="" type="foreign_key" foreign_table="dummy" foreign_key="key" foreign_inverse="true"/>
|
|
82
|
+
<field name="dummy_id1" description="" type="foreign_key" foreign_table="dummy" foreign_key="key" foreign_inverse="false"/>
|
|
83
|
+
<field name="dummy_id2" description="" type="foreign_key" foreign_table="dummy" foreign_key="key1" foreign_inverse="false"/>
|
|
84
|
+
<field name="dummy2_id" description="" type="foreign_key" foreign_table="dummy_2" foreign_key="key1" foreign_inverse="false"/>
|
|
85
|
+
<field name="id" specification="c36ce2f6-c4f9-4133-841d-3da4f45f62ca"/>
|
|
86
|
+
</fields>
|
|
87
|
+
</table>
|
|
88
|
+
<table name="fields_selective" description="" specification="76231b4f-0c1a-453f-9cf4-f299bd043436" selective="true">
|
|
89
|
+
<fields>
|
|
90
|
+
<field name="id" specification="c36ce2f6-c4f9-4133-841d-3da4f45f62ca"/>
|
|
91
|
+
</fields>
|
|
92
|
+
</table>
|
|
93
|
+
<table name="fields_inclusive" description="" specification="76231b4f-0c1a-453f-9cf4-f299bd043436" selective="false">
|
|
94
|
+
<fields>
|
|
95
|
+
<field name="id" description="" specification="c36ce2f6-c4f9-4133-841d-3da4f45f62ca"/>
|
|
96
|
+
<field name="table_id" description="" type="foreign_key" foreign_table="tables_inclusive" foreign_key="owner" foreign_inverse="false"/>
|
|
97
|
+
</fields>
|
|
98
|
+
</table>
|
|
99
|
+
<table name="dummy_child" description="" parent="dummy" selective="false">
|
|
100
|
+
<fields>
|
|
101
|
+
</fields>
|
|
102
|
+
</table>
|
|
103
|
+
<table name="dummy_2" description="" specification="195f5ecf-7da9-46c7-af09-3e6c0aaaf782" selective="false">
|
|
104
|
+
<fields>
|
|
105
|
+
<field name="id" description="" specification="c36ce2f6-c4f9-4133-841d-3da4f45f62ca"/>
|
|
106
|
+
<field name="dummy_char" specification="cadd88cc-0d52-46c5-9daf-975085a50b8e"/>
|
|
107
|
+
</fields>
|
|
108
|
+
</table>
|
|
109
|
+
<table name="dummy_renamed" description="Dummy with renamed fields." specification="195f5ecf-7da9-46c7-af09-3e6c0aaaf782" selective="false">
|
|
110
|
+
<fields>
|
|
111
|
+
<field name="bool_dummy" specification="6666c7a8-ae19-470a-88c3-5410f0ef6cbd"/>
|
|
112
|
+
</fields>
|
|
113
|
+
</table>
|
|
114
|
+
<table name="tables_inclusive" description="" specification="af4ffbee-0bfa-4211-9e6b-726b921df081" selective="false">
|
|
115
|
+
<fields>
|
|
116
|
+
<field name="id" specification="c36ce2f6-c4f9-4133-841d-3da4f45f62ca"/>
|
|
117
|
+
</fields>
|
|
118
|
+
</table>
|
|
119
|
+
</tables>
|
|
120
|
+
<join_tables>
|
|
121
|
+
<join_table name="test_join" description="" key="key" table_left="dummy" table_right="dummy_2" column_name_left="dummy_id" column_name_right="dummy2_id"/>
|
|
122
|
+
<join_table name="test_join2" description="" key="key1" table_left="dummy" table_right="dummy_2" column_name_left="dummy_id" column_name_right="dummy2_id"/>
|
|
123
|
+
<join_table name="test_virt_join" description="" key="key" table_left="dummy" table_right="virt" column_name_left="dummy_id" column_name_right="virt_id"/>
|
|
124
|
+
<join_table name="test_virt_join2" description="" key="key1" table_left="dummy" table_right="virt" column_name_left="dummy_id" column_name_right="virt_id"/>
|
|
125
|
+
</join_tables>
|
|
126
|
+
<keys>
|
|
127
|
+
<key name="key" description=""/>
|
|
128
|
+
<key name="key1" description=""/>
|
|
129
|
+
<key name="owner" description="" specification="f39d26c0-1e62-4133-b08f-10bb3855c223"/>
|
|
130
|
+
</keys>
|
|
131
|
+
<events>
|
|
132
|
+
<event name="inserted" description="" specification="12b3e063-7aa8-44e7-bc8c-4a1b1a238454"/>
|
|
133
|
+
<event name="deleted" description="" specification="9507ee43-ea4b-4ba7-88b2-9391ca59dc8a"/>
|
|
134
|
+
</events>
|
|
135
|
+
<states>
|
|
136
|
+
<state name="dummy" description="">
|
|
137
|
+
<instance name="dummy" table="dummy">
|
|
138
|
+
</instance>
|
|
139
|
+
</state>
|
|
140
|
+
<state name="test_state_1" description="">
|
|
141
|
+
<instance name="dummy" table="dummy">
|
|
142
|
+
<instance name="dummy_2" table="dummy_2" key="key" join_invert="false" optional="false">
|
|
143
|
+
</instance>
|
|
144
|
+
</instance>
|
|
145
|
+
</state>
|
|
146
|
+
</states>
|
|
147
|
+
<listeners>
|
|
148
|
+
<listener name="test_listener_1_inserted" description="" persistent="true" state="test_state_1" event="inserted"/>
|
|
149
|
+
</listeners>
|
|
150
|
+
</app>
|
|
151
|
+
</apps>
|
|
152
|
+
</uts>
|
|
@@ -17,10 +17,10 @@ module Runivedo
|
|
|
17
17
|
@@ro_classes
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
class
|
|
20
|
+
class Connection
|
|
21
21
|
attr_reader :error
|
|
22
22
|
|
|
23
|
-
def initialize(url
|
|
23
|
+
def initialize(url)
|
|
24
24
|
@remote_objects = {}
|
|
25
25
|
@ws = RfcWebSocket::WebSocket.new(url)
|
|
26
26
|
# Use TCP_NODELAY, since usually SQL queries are pretty small packets.
|
|
@@ -29,23 +29,10 @@ module Runivedo
|
|
|
29
29
|
Thread.new { handle_ws }
|
|
30
30
|
@urologin = RemoteObject.new(self, 0)
|
|
31
31
|
@remote_objects[0] = @urologin
|
|
32
|
-
@session_remote = @urologin.call_rom('getSession', args)
|
|
33
32
|
end
|
|
34
33
|
|
|
35
|
-
def
|
|
36
|
-
@
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def get_perspective(name, &block)
|
|
40
|
-
@session_remote.get_perspective name, &block
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def apply_uts(uts)
|
|
44
|
-
@session_remote.apply_uts uts
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def get_server_version
|
|
48
|
-
@session_remote.get_server_version
|
|
34
|
+
def get_session(bucket, auth)
|
|
35
|
+
@urologin.call_rom('getSession', bucket, auth)
|
|
49
36
|
end
|
|
50
37
|
|
|
51
38
|
def close
|
|
@@ -68,7 +55,6 @@ module Runivedo
|
|
|
68
55
|
# Read message to an array
|
|
69
56
|
io = StringIO.new(msg)
|
|
70
57
|
data = []
|
|
71
|
-
session = self
|
|
72
58
|
data << CBOR.load(io, 27 => method(:receive_ro)) while !io.eof?
|
|
73
59
|
|
|
74
60
|
# Find remote object
|
|
@@ -16,8 +16,8 @@ module Runivedo
|
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
def initialize(
|
|
20
|
-
@
|
|
19
|
+
def initialize(connection, id)
|
|
20
|
+
@connection = connection
|
|
21
21
|
@open = true
|
|
22
22
|
@id = id
|
|
23
23
|
@call_id = 0
|
|
@@ -29,7 +29,7 @@ module Runivedo
|
|
|
29
29
|
def send_notification(name, *args)
|
|
30
30
|
@mutex.synchronize do
|
|
31
31
|
check_open
|
|
32
|
-
@
|
|
32
|
+
@connection.send :send_message, [@id, OPERATION_NOTIFY, name.to_s, args]
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
@@ -39,7 +39,7 @@ module Runivedo
|
|
|
39
39
|
check_open
|
|
40
40
|
call_result = Future.new
|
|
41
41
|
@calls[@call_id] = call_result
|
|
42
|
-
@
|
|
42
|
+
@connection.send :send_message, [@id, OPERATION_CALL_ROM, @call_id, name, args]
|
|
43
43
|
@call_id += 1
|
|
44
44
|
end
|
|
45
45
|
result = call_result.get
|
|
@@ -63,9 +63,9 @@ module Runivedo
|
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
def close
|
|
66
|
-
@
|
|
66
|
+
@connection.send :delete_ro, @id
|
|
67
67
|
onclose(Runivedo::ConnectionError.new("remote object closed"))
|
|
68
|
-
@
|
|
68
|
+
@connection.send :send_message, [@id, OPERATION_DELETE]
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
private
|
data/lib/runivedo/version.rb
CHANGED
data/lib/runivedo.rb
CHANGED
data/test/remote_object_test.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require "test_helper"
|
|
2
2
|
|
|
3
|
-
class
|
|
3
|
+
class MockConnection
|
|
4
4
|
attr_accessor :msg, :onmsg
|
|
5
5
|
|
|
6
6
|
def send_message(msg)
|
|
@@ -13,43 +13,43 @@ end
|
|
|
13
13
|
|
|
14
14
|
class RemoteObjectTest < MiniTest::Test
|
|
15
15
|
def test_sending_notifications
|
|
16
|
-
|
|
17
|
-
ro = Runivedo::RemoteObject.new(
|
|
16
|
+
connection = MockConnection.new
|
|
17
|
+
ro = Runivedo::RemoteObject.new(connection, 23)
|
|
18
18
|
ro.send_notification "foo", 1, "2", 3
|
|
19
|
-
assert_equal [23, 3, "foo", [1, "2", 3]],
|
|
19
|
+
assert_equal [23, 3, "foo", [1, "2", 3]], connection.msg
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def test_receiving_notifications
|
|
23
23
|
res = nil
|
|
24
|
-
|
|
25
|
-
ro = Runivedo::RemoteObject.new(
|
|
24
|
+
connection = MockConnection.new
|
|
25
|
+
ro = Runivedo::RemoteObject.new(connection, 23)
|
|
26
26
|
ro.on("foo") {|a, b, c| res = [a, b, c]}
|
|
27
27
|
ro.send :receive, [3, "foo", [1, "2", 3]]
|
|
28
28
|
assert_equal [1, "2", 3], res
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
def test_rom_calls
|
|
32
|
-
|
|
33
|
-
ro = Runivedo::RemoteObject.new(
|
|
34
|
-
|
|
32
|
+
connection = MockConnection.new
|
|
33
|
+
ro = Runivedo::RemoteObject.new(connection, 23)
|
|
34
|
+
connection.onmsg = -> {ro.send :receive, [2, 0, 0, 42]}
|
|
35
35
|
assert_equal 42, ro.call_rom("foo", 1, "2", 3)
|
|
36
|
-
assert_equal [23, 1, 0, "foo", [1, "2", 3]],
|
|
36
|
+
assert_equal [23, 1, 0, "foo", [1, "2", 3]], connection.msg
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
def test_rom_errors
|
|
40
40
|
assert_raises Runivedo::SqlError do
|
|
41
|
-
|
|
42
|
-
ro = Runivedo::RemoteObject.new(
|
|
43
|
-
|
|
41
|
+
connection = MockConnection.new
|
|
42
|
+
ro = Runivedo::RemoteObject.new(connection, 23)
|
|
43
|
+
connection.onmsg = -> {ro.send :receive, [2, 0, 1, "boom"]}
|
|
44
44
|
assert_equal 42, ro.call_rom("foo", 1, "2", 3)
|
|
45
|
-
assert_equal [23, 1, 0, "foo", [1, "2", 3]],
|
|
45
|
+
assert_equal [23, 1, 0, "foo", [1, "2", 3]], connection.msg
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
def test_closes
|
|
50
|
-
|
|
51
|
-
ro = Runivedo::RemoteObject.new(
|
|
50
|
+
connection = MockConnection.new
|
|
51
|
+
ro = Runivedo::RemoteObject.new(connection, 23)
|
|
52
52
|
ro.close
|
|
53
|
-
assert_equal [23, 4],
|
|
53
|
+
assert_equal [23, 4], connection.msg
|
|
54
54
|
end
|
|
55
55
|
end
|
data/test/session_test.rb
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
require "test_helper"
|
|
2
2
|
|
|
3
|
-
class
|
|
3
|
+
class ConnectionTest < MiniTest::Test
|
|
4
4
|
def setup
|
|
5
|
-
@
|
|
5
|
+
@connection = Runivedo::Connection.new TEST_URL
|
|
6
|
+
@session = @connection.get_session TEST_BUCKET, TEST_AUTH
|
|
6
7
|
end
|
|
7
8
|
|
|
8
9
|
def teardown
|
|
9
|
-
@
|
|
10
|
+
@connection.close unless @connection.closed?
|
|
10
11
|
end
|
|
11
12
|
|
|
12
13
|
def ping(v)
|
|
@@ -14,7 +15,7 @@ class SessionTest < MiniTest::Test
|
|
|
14
15
|
end
|
|
15
16
|
|
|
16
17
|
def test_connect
|
|
17
|
-
assert !@
|
|
18
|
+
assert !@connection.closed?
|
|
18
19
|
end
|
|
19
20
|
|
|
20
21
|
def test_pings_null
|
|
@@ -30,12 +31,12 @@ class SessionTest < MiniTest::Test
|
|
|
30
31
|
end
|
|
31
32
|
|
|
32
33
|
def test_close
|
|
33
|
-
@
|
|
34
|
-
assert @
|
|
34
|
+
@connection.close
|
|
35
|
+
assert @connection.closed?
|
|
35
36
|
end
|
|
36
37
|
|
|
37
38
|
def test_error_closed
|
|
38
|
-
@
|
|
39
|
+
@connection.close
|
|
39
40
|
assert_raises Runivedo::ConnectionError do
|
|
40
41
|
@session.ping("foo")
|
|
41
42
|
end
|
data/test/sql_test.rb
CHANGED
|
@@ -2,12 +2,14 @@ require "test_helper"
|
|
|
2
2
|
|
|
3
3
|
class SqlTest < MiniTest::Test
|
|
4
4
|
def setup
|
|
5
|
-
@
|
|
5
|
+
@connection = Runivedo::Connection.new TEST_URL
|
|
6
|
+
@session = @connection.get_session TEST_BUCKET, TEST_AUTH
|
|
7
|
+
@session.apply_uts IO.read("Test Perspective.xml")
|
|
6
8
|
@perspective = @session.get_perspective "cefb4ed2-4ce3-4825-8550-b68a3c142f0a"
|
|
7
9
|
end
|
|
8
10
|
|
|
9
11
|
def teardown
|
|
10
|
-
@
|
|
12
|
+
@connection.close
|
|
11
13
|
end
|
|
12
14
|
|
|
13
15
|
def test_connection
|
data/test/test_helper.rb
CHANGED
|
@@ -4,5 +4,6 @@ require "minitest/autorun"
|
|
|
4
4
|
require "minitest/emoji"
|
|
5
5
|
require "runivedo"
|
|
6
6
|
|
|
7
|
-
TEST_URL = "ws://
|
|
8
|
-
|
|
7
|
+
TEST_URL = "ws://localhost:9011/"
|
|
8
|
+
TEST_BUCKET = "cbd79ca3-1dd4-4ddf-a964-618b593d5fdb"
|
|
9
|
+
TEST_AUTH = {}
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: runivedo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lucas Clemente
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-10-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rfc-ws-client
|
|
@@ -120,11 +120,12 @@ files:
|
|
|
120
120
|
- LICENSE.txt
|
|
121
121
|
- README.md
|
|
122
122
|
- Rakefile
|
|
123
|
+
- Test Perspective.xml
|
|
123
124
|
- lib/runivedo.rb
|
|
125
|
+
- lib/runivedo/connection.rb
|
|
124
126
|
- lib/runivedo/error.rb
|
|
125
127
|
- lib/runivedo/future.rb
|
|
126
128
|
- lib/runivedo/remote_object.rb
|
|
127
|
-
- lib/runivedo/session.rb
|
|
128
129
|
- lib/runivedo/sql.rb
|
|
129
130
|
- lib/runivedo/version.rb
|
|
130
131
|
- runivedo.gemspec
|
|
@@ -152,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
152
153
|
version: '0'
|
|
153
154
|
requirements: []
|
|
154
155
|
rubyforge_project:
|
|
155
|
-
rubygems_version: 2.
|
|
156
|
+
rubygems_version: 2.4.1
|
|
156
157
|
signing_key:
|
|
157
158
|
specification_version: 4
|
|
158
159
|
summary: Ruby binding for Univedo
|