epp-client 0.0.3 → 1.0.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 +7 -0
- data/.gitignore +24 -0
- data/.simplecov +16 -0
- data/.travis.yml +11 -0
- data/.yardopts +4 -0
- data/Gemfile +20 -0
- data/Gemfile.lock +51 -0
- data/LICENSE +1 -1
- data/README.md +75 -0
- data/Rakefile +2 -37
- data/epp-client.gemspec +15 -58
- data/gemfiles/Gemfile.ruby18 +13 -0
- data/lib/epp-client.rb +94 -7
- data/lib/epp-client/client.rb +117 -20
- data/lib/epp-client/commands/check.rb +11 -0
- data/lib/epp-client/commands/command.rb +24 -0
- data/lib/epp-client/commands/create.rb +11 -0
- data/lib/epp-client/commands/delete.rb +11 -0
- data/lib/epp-client/commands/info.rb +11 -0
- data/lib/epp-client/commands/login.rb +40 -0
- data/lib/epp-client/commands/logout.rb +11 -0
- data/lib/epp-client/commands/poll.rb +28 -0
- data/lib/epp-client/commands/read_write_command.rb +18 -0
- data/lib/epp-client/commands/renew.rb +11 -0
- data/lib/epp-client/commands/transfer.rb +25 -0
- data/lib/epp-client/commands/update.rb +11 -0
- data/lib/epp-client/contact/check.rb +23 -0
- data/lib/epp-client/contact/check_response.rb +22 -0
- data/lib/epp-client/contact/command.rb +87 -0
- data/lib/epp-client/contact/create.rb +34 -0
- data/lib/epp-client/contact/create_response.rb +14 -0
- data/lib/epp-client/contact/delete.rb +21 -0
- data/lib/epp-client/contact/delete_response.rb +9 -0
- data/lib/epp-client/contact/info.rb +21 -0
- data/lib/epp-client/contact/info_response.rb +74 -0
- data/lib/epp-client/contact/response.rb +34 -0
- data/lib/epp-client/contact/transfer.rb +21 -0
- data/lib/epp-client/contact/transfer_response.rb +26 -0
- data/lib/epp-client/contact/update.rb +80 -0
- data/lib/epp-client/contact/update_response.rb +9 -0
- data/lib/epp-client/domain/check.rb +23 -0
- data/lib/epp-client/domain/check_response.rb +22 -0
- data/lib/epp-client/domain/command.rb +92 -0
- data/lib/epp-client/domain/create.rb +49 -0
- data/lib/epp-client/domain/create_response.rb +17 -0
- data/lib/epp-client/domain/delete.rb +21 -0
- data/lib/epp-client/domain/delete_response.rb +9 -0
- data/lib/epp-client/domain/info.rb +21 -0
- data/lib/epp-client/domain/info_response.rb +66 -0
- data/lib/epp-client/domain/renew.rb +34 -0
- data/lib/epp-client/domain/renew_response.rb +14 -0
- data/lib/epp-client/domain/response.rb +34 -0
- data/lib/epp-client/domain/transfer.rb +27 -0
- data/lib/epp-client/domain/transfer_response.rb +29 -0
- data/lib/epp-client/domain/update.rb +81 -0
- data/lib/epp-client/domain/update_response.rb +9 -0
- data/lib/epp-client/host/check.rb +23 -0
- data/lib/epp-client/host/check_response.rb +22 -0
- data/lib/epp-client/host/command.rb +47 -0
- data/lib/epp-client/host/create.rb +24 -0
- data/lib/epp-client/host/create_response.rb +14 -0
- data/lib/epp-client/host/delete.rb +21 -0
- data/lib/epp-client/host/delete_response.rb +9 -0
- data/lib/epp-client/host/info.rb +21 -0
- data/lib/epp-client/host/info_response.rb +42 -0
- data/lib/epp-client/host/response.rb +34 -0
- data/lib/epp-client/host/update.rb +76 -0
- data/lib/epp-client/host/update_response.rb +9 -0
- data/lib/epp-client/request.rb +29 -74
- data/lib/epp-client/requests/abstract.rb +30 -0
- data/lib/epp-client/requests/command.rb +28 -0
- data/lib/epp-client/requests/extension.rb +28 -0
- data/lib/epp-client/requests/hello.rb +12 -0
- data/lib/epp-client/response.rb +45 -8
- data/lib/epp-client/response_helper.rb +25 -0
- data/lib/epp-client/server.rb +167 -63
- data/lib/epp-client/testing.rb +59 -0
- data/lib/epp-client/version.rb +3 -0
- data/lib/epp-client/xml_helper.rb +71 -0
- data/test/commands/test_check_command.rb +33 -0
- data/test/commands/test_create_command.rb +53 -0
- data/test/commands/test_delete_command.rb +28 -0
- data/test/commands/test_info_command.rb +28 -0
- data/test/commands/test_login_command.rb +56 -0
- data/test/commands/test_logout_command.rb +22 -0
- data/test/commands/test_poll_command.rb +54 -0
- data/test/commands/test_renew_command.rb +39 -0
- data/test/commands/test_transfer_command.rb +37 -0
- data/test/commands/test_update_command.rb +60 -0
- data/test/contact/test_contact_check.rb +33 -0
- data/test/contact/test_contact_check_response.rb +38 -0
- data/test/contact/test_contact_create.rb +70 -0
- data/test/contact/test_contact_create_response.rb +33 -0
- data/test/contact/test_contact_delete.rb +28 -0
- data/test/contact/test_contact_delete_response.rb +23 -0
- data/test/contact/test_contact_info.rb +28 -0
- data/test/contact/test_contact_info_response.rb +100 -0
- data/test/contact/test_contact_transfer.rb +28 -0
- data/test/contact/test_contact_transfer_response.rb +100 -0
- data/test/contact/test_contact_update.rb +83 -0
- data/test/contact/test_contact_update_response.rb +23 -0
- data/test/domain/test_domain_check.rb +33 -0
- data/test/domain/test_domain_check_response.rb +38 -0
- data/test/domain/test_domain_create.rb +53 -0
- data/test/domain/test_domain_create_response.rb +39 -0
- data/test/domain/test_domain_delete.rb +28 -0
- data/test/domain/test_domain_delete_response.rb +23 -0
- data/test/domain/test_domain_info.rb +28 -0
- data/test/domain/test_domain_info_response.rb +107 -0
- data/test/domain/test_domain_renew.rb +39 -0
- data/test/domain/test_domain_renew_response.rb +32 -0
- data/test/domain/test_domain_transfer.rb +37 -0
- data/test/domain/test_domain_transfer_response.rb +112 -0
- data/test/domain/test_domain_update.rb +73 -0
- data/test/domain/test_domain_update_response.rb +23 -0
- data/test/fixtures/responses/contact/check.xml +27 -0
- data/test/fixtures/responses/contact/create.xml +19 -0
- data/test/fixtures/responses/contact/delete.xml +12 -0
- data/test/fixtures/responses/contact/info.xml +49 -0
- data/test/fixtures/responses/contact/transfer-query.xml +23 -0
- data/test/fixtures/responses/contact/transfer-request.xml +23 -0
- data/test/fixtures/responses/contact/update.xml +12 -0
- data/test/fixtures/responses/domain/check.xml +27 -0
- data/test/fixtures/responses/domain/create.xml +20 -0
- data/test/fixtures/responses/domain/delete.xml +12 -0
- data/test/fixtures/responses/domain/info-no-exDate.xml +38 -0
- data/test/fixtures/responses/domain/info.xml +39 -0
- data/test/fixtures/responses/domain/renew.xml +19 -0
- data/test/fixtures/responses/domain/transfer-query.xml +24 -0
- data/test/fixtures/responses/domain/transfer-request.xml +24 -0
- data/test/fixtures/responses/domain/update.xml +12 -0
- data/test/fixtures/responses/greeting.xml +25 -0
- data/test/fixtures/responses/host/check.xml +27 -0
- data/test/fixtures/responses/host/create.xml +19 -0
- data/test/fixtures/responses/host/delete.xml +12 -0
- data/test/fixtures/responses/host/info.xml +30 -0
- data/test/fixtures/responses/host/update.xml +12 -0
- data/test/helper.rb +89 -0
- data/test/host/test_host_check.rb +33 -0
- data/test/host/test_host_check_response.rb +38 -0
- data/test/host/test_host_create.rb +37 -0
- data/test/host/test_host_create_response.rb +33 -0
- data/test/host/test_host_delete.rb +28 -0
- data/test/host/test_host_delete_response.rb +23 -0
- data/test/host/test_host_info.rb +28 -0
- data/test/host/test_host_info_response.rb +72 -0
- data/test/host/test_host_update.rb +68 -0
- data/test/host/test_host_update_response.rb +23 -0
- data/test/requests/test_command_request.rb +16 -0
- data/test/requests/test_extension_request.rb +55 -0
- data/test/requests/test_hello_request.rb +15 -0
- data/test/support/schemas/all.xsd +21 -0
- data/test/support/schemas/contact-1.0.xsd +387 -0
- data/test/support/schemas/domain-1.0.xsd +432 -0
- data/test/support/schemas/epp-1.0.xsd +403 -0
- data/test/support/schemas/eppcom-1.0.xsd +93 -0
- data/test/support/schemas/host-1.0.xsd +240 -0
- data/test/test_client.rb +54 -0
- data/test/test_request.rb +15 -0
- data/test/test_server.rb +57 -0
- metadata +270 -91
- data/.document +0 -5
- data/README.rdoc +0 -17
- data/VERSION +0 -1
- data/lib/epp-client/hello_request.rb +0 -9
- data/test/test_epp-client.rb +0 -7
@@ -0,0 +1,93 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<schema targetNamespace="urn:ietf:params:xml:ns:eppcom-1.0"
|
3
|
+
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
4
|
+
xmlns="http://www.w3.org/2001/XMLSchema"
|
5
|
+
elementFormDefault="qualified">
|
6
|
+
<annotation>
|
7
|
+
<documentation>
|
8
|
+
Extensible Provisioning Protocol v1.0
|
9
|
+
shared structures schema.
|
10
|
+
</documentation>
|
11
|
+
</annotation>
|
12
|
+
<!--
|
13
|
+
Object authorization information types.
|
14
|
+
-->
|
15
|
+
<complexType name="pwAuthInfoType">
|
16
|
+
<simpleContent>
|
17
|
+
<extension base="normalizedString">
|
18
|
+
<attribute name="roid" type="eppcom:roidType"/>
|
19
|
+
</extension>
|
20
|
+
</simpleContent>
|
21
|
+
</complexType>
|
22
|
+
<complexType name="extAuthInfoType">
|
23
|
+
<sequence>
|
24
|
+
<any namespace="##other"/>
|
25
|
+
</sequence>
|
26
|
+
</complexType>
|
27
|
+
<!--
|
28
|
+
<check> response types.
|
29
|
+
-->
|
30
|
+
<complexType name="reasonType">
|
31
|
+
<simpleContent>
|
32
|
+
<extension base="eppcom:reasonBaseType">
|
33
|
+
<attribute name="lang" type="language"/>
|
34
|
+
</extension>
|
35
|
+
</simpleContent>
|
36
|
+
</complexType>
|
37
|
+
<simpleType name="reasonBaseType">
|
38
|
+
<restriction base="token">
|
39
|
+
<minLength value="1"/>
|
40
|
+
<maxLength value="32"/>
|
41
|
+
</restriction>
|
42
|
+
</simpleType>
|
43
|
+
<!--
|
44
|
+
Abstract client and object identifier type.
|
45
|
+
-->
|
46
|
+
<simpleType name="clIDType">
|
47
|
+
<restriction base="token">
|
48
|
+
<minLength value="3"/>
|
49
|
+
<maxLength value="16"/>
|
50
|
+
</restriction>
|
51
|
+
</simpleType>
|
52
|
+
<!--
|
53
|
+
DNS label type.
|
54
|
+
-->
|
55
|
+
<simpleType name="labelType">
|
56
|
+
<restriction base="token">
|
57
|
+
<minLength value="1"/>
|
58
|
+
<maxLength value="255"/>
|
59
|
+
</restriction>
|
60
|
+
</simpleType>
|
61
|
+
<!--
|
62
|
+
Non-empty token type.
|
63
|
+
-->
|
64
|
+
<simpleType name="minTokenType">
|
65
|
+
<restriction base="token">
|
66
|
+
<minLength value="1"/>
|
67
|
+
</restriction>
|
68
|
+
</simpleType>
|
69
|
+
<!--
|
70
|
+
Repository Object IDentifier type.
|
71
|
+
-->
|
72
|
+
<simpleType name="roidType">
|
73
|
+
<restriction base="token">
|
74
|
+
<pattern value="(\w|_){1,80}-\w{1,8}"/>
|
75
|
+
</restriction>
|
76
|
+
</simpleType>
|
77
|
+
<!--
|
78
|
+
Transfer status identifiers.
|
79
|
+
-->
|
80
|
+
<simpleType name="trStatusType">
|
81
|
+
<restriction base="token">
|
82
|
+
<enumeration value="clientApproved"/>
|
83
|
+
<enumeration value="clientCancelled"/>
|
84
|
+
<enumeration value="clientRejected"/>
|
85
|
+
<enumeration value="pending"/>
|
86
|
+
<enumeration value="serverApproved"/>
|
87
|
+
<enumeration value="serverCancelled"/>
|
88
|
+
</restriction>
|
89
|
+
</simpleType>
|
90
|
+
<!--
|
91
|
+
End of schema.
|
92
|
+
-->
|
93
|
+
</schema>
|
@@ -0,0 +1,240 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
|
3
|
+
<schema targetNamespace="urn:ietf:params:xml:ns:host-1.0"
|
4
|
+
xmlns:host="urn:ietf:params:xml:ns:host-1.0"
|
5
|
+
xmlns:epp="urn:ietf:params:xml:ns:epp-1.0"
|
6
|
+
xmlns:eppcom="urn:ietf:params:xml:ns:eppcom-1.0"
|
7
|
+
xmlns="http://www.w3.org/2001/XMLSchema"
|
8
|
+
elementFormDefault="qualified">
|
9
|
+
|
10
|
+
<!--
|
11
|
+
Import common element types.
|
12
|
+
-->
|
13
|
+
<import namespace="urn:ietf:params:xml:ns:eppcom-1.0" schemaLocation="eppcom-1.0.xsd"/>
|
14
|
+
<import namespace="urn:ietf:params:xml:ns:epp-1.0" schemaLocation="epp-1.0.xsd"/>
|
15
|
+
|
16
|
+
<annotation>
|
17
|
+
<documentation>
|
18
|
+
Extensible Provisioning Protocol v1.0
|
19
|
+
host provisioning schema.
|
20
|
+
</documentation>
|
21
|
+
</annotation>
|
22
|
+
|
23
|
+
<!--
|
24
|
+
Child elements found in EPP commands.
|
25
|
+
-->
|
26
|
+
<element name="check" type="host:mNameType"/>
|
27
|
+
<element name="create" type="host:createType"/>
|
28
|
+
<element name="delete" type="host:sNameType"/>
|
29
|
+
<element name="info" type="host:sNameType"/>
|
30
|
+
<element name="update" type="host:updateType"/>
|
31
|
+
|
32
|
+
<!--
|
33
|
+
Child elements of the <create> command.
|
34
|
+
-->
|
35
|
+
<complexType name="createType">
|
36
|
+
<sequence>
|
37
|
+
<element name="name" type="eppcom:labelType"/>
|
38
|
+
<element name="addr" type="host:addrType"
|
39
|
+
minOccurs="0" maxOccurs="unbounded"/>
|
40
|
+
</sequence>
|
41
|
+
</complexType>
|
42
|
+
|
43
|
+
<complexType name="addrType">
|
44
|
+
<simpleContent>
|
45
|
+
<extension base="host:addrStringType">
|
46
|
+
<attribute name="ip" type="host:ipType"
|
47
|
+
default="v4"/>
|
48
|
+
</extension>
|
49
|
+
</simpleContent>
|
50
|
+
</complexType>
|
51
|
+
|
52
|
+
<simpleType name="addrStringType">
|
53
|
+
<restriction base="token">
|
54
|
+
<minLength value="3"/>
|
55
|
+
<maxLength value="45"/>
|
56
|
+
</restriction>
|
57
|
+
</simpleType>
|
58
|
+
|
59
|
+
<simpleType name="ipType">
|
60
|
+
<restriction base="token">
|
61
|
+
<enumeration value="v4"/>
|
62
|
+
<enumeration value="v6"/>
|
63
|
+
</restriction>
|
64
|
+
</simpleType>
|
65
|
+
|
66
|
+
<!--
|
67
|
+
Child elements of the <delete> and <info> commands.
|
68
|
+
-->
|
69
|
+
<complexType name="sNameType">
|
70
|
+
<sequence>
|
71
|
+
<element name="name" type="eppcom:labelType"/>
|
72
|
+
</sequence>
|
73
|
+
</complexType>
|
74
|
+
|
75
|
+
<!--
|
76
|
+
Child element of commands that accept multiple names.
|
77
|
+
-->
|
78
|
+
<complexType name="mNameType">
|
79
|
+
<sequence>
|
80
|
+
<element name="name" type="eppcom:labelType"
|
81
|
+
maxOccurs="unbounded"/>
|
82
|
+
</sequence>
|
83
|
+
</complexType>
|
84
|
+
<!--
|
85
|
+
Child elements of the <update> command.
|
86
|
+
-->
|
87
|
+
<complexType name="updateType">
|
88
|
+
<sequence>
|
89
|
+
<element name="name" type="eppcom:labelType"/>
|
90
|
+
<element name="add" type="host:addRemType"
|
91
|
+
minOccurs="0"/>
|
92
|
+
<element name="rem" type="host:addRemType"
|
93
|
+
minOccurs="0"/>
|
94
|
+
<element name="chg" type="host:chgType"
|
95
|
+
minOccurs="0"/>
|
96
|
+
</sequence>
|
97
|
+
</complexType>
|
98
|
+
|
99
|
+
<!--
|
100
|
+
Data elements that can be added or removed.
|
101
|
+
-->
|
102
|
+
<complexType name="addRemType">
|
103
|
+
<sequence>
|
104
|
+
<element name="addr" type="host:addrType"
|
105
|
+
minOccurs="0" maxOccurs="unbounded"/>
|
106
|
+
<element name="status" type="host:statusType"
|
107
|
+
minOccurs="0" maxOccurs="7"/>
|
108
|
+
</sequence>
|
109
|
+
</complexType>
|
110
|
+
|
111
|
+
<!--
|
112
|
+
Data elements that can be changed.
|
113
|
+
-->
|
114
|
+
<complexType name="chgType">
|
115
|
+
<sequence>
|
116
|
+
<element name="name" type="eppcom:labelType"/>
|
117
|
+
</sequence>
|
118
|
+
</complexType>
|
119
|
+
|
120
|
+
<!--
|
121
|
+
Child response elements.
|
122
|
+
-->
|
123
|
+
<element name="chkData" type="host:chkDataType"/>
|
124
|
+
<element name="creData" type="host:creDataType"/>
|
125
|
+
<element name="infData" type="host:infDataType"/>
|
126
|
+
<element name="panData" type="host:panDataType"/>
|
127
|
+
|
128
|
+
<!--
|
129
|
+
<check> response elements.
|
130
|
+
-->
|
131
|
+
<complexType name="chkDataType">
|
132
|
+
<sequence>
|
133
|
+
<element name="cd" type="host:checkType"
|
134
|
+
maxOccurs="unbounded"/>
|
135
|
+
</sequence>
|
136
|
+
</complexType>
|
137
|
+
|
138
|
+
<complexType name="checkType">
|
139
|
+
<sequence>
|
140
|
+
<element name="name" type="host:checkNameType"/>
|
141
|
+
<element name="reason" type="eppcom:reasonType"
|
142
|
+
minOccurs="0"/>
|
143
|
+
</sequence>
|
144
|
+
</complexType>
|
145
|
+
|
146
|
+
<complexType name="checkNameType">
|
147
|
+
<simpleContent>
|
148
|
+
<extension base="eppcom:labelType">
|
149
|
+
<attribute name="avail" type="boolean"
|
150
|
+
use="required"/>
|
151
|
+
</extension>
|
152
|
+
</simpleContent>
|
153
|
+
</complexType>
|
154
|
+
|
155
|
+
<!--
|
156
|
+
<create> response elements.
|
157
|
+
-->
|
158
|
+
<complexType name="creDataType">
|
159
|
+
<sequence>
|
160
|
+
<element name="name" type="eppcom:labelType"/>
|
161
|
+
<element name="crDate" type="dateTime"/>
|
162
|
+
</sequence>
|
163
|
+
</complexType>
|
164
|
+
|
165
|
+
<!--
|
166
|
+
<info> response elements.
|
167
|
+
-->
|
168
|
+
<complexType name="infDataType">
|
169
|
+
<sequence>
|
170
|
+
<element name="name" type="eppcom:labelType"/>
|
171
|
+
<element name="roid" type="eppcom:roidType"/>
|
172
|
+
<element name="status" type="host:statusType"
|
173
|
+
maxOccurs="7"/>
|
174
|
+
<element name="addr" type="host:addrType"
|
175
|
+
minOccurs="0" maxOccurs="unbounded"/>
|
176
|
+
<element name="clID" type="eppcom:clIDType"/>
|
177
|
+
<element name="crID" type="eppcom:clIDType"/>
|
178
|
+
<element name="crDate" type="dateTime"/>
|
179
|
+
<element name="upID" type="eppcom:clIDType"
|
180
|
+
minOccurs="0"/>
|
181
|
+
<element name="upDate" type="dateTime"
|
182
|
+
minOccurs="0"/>
|
183
|
+
<element name="trDate" type="dateTime"
|
184
|
+
minOccurs="0"/>
|
185
|
+
</sequence>
|
186
|
+
</complexType>
|
187
|
+
|
188
|
+
<!--
|
189
|
+
Status is a combination of attributes and an optional human-readable
|
190
|
+
message that may be expressed in languages other than English.
|
191
|
+
-->
|
192
|
+
<complexType name="statusType">
|
193
|
+
<simpleContent>
|
194
|
+
<extension base="normalizedString">
|
195
|
+
<attribute name="s" type="host:statusValueType"
|
196
|
+
use="required"/>
|
197
|
+
<attribute name="lang" type="language"
|
198
|
+
default="en"/>
|
199
|
+
</extension>
|
200
|
+
</simpleContent>
|
201
|
+
</complexType>
|
202
|
+
|
203
|
+
<simpleType name="statusValueType">
|
204
|
+
<restriction base="token">
|
205
|
+
<enumeration value="clientDeleteProhibited"/>
|
206
|
+
<enumeration value="clientUpdateProhibited"/>
|
207
|
+
<enumeration value="linked"/>
|
208
|
+
<enumeration value="ok"/>
|
209
|
+
<enumeration value="pendingCreate"/>
|
210
|
+
<enumeration value="pendingDelete"/>
|
211
|
+
<enumeration value="pendingTransfer"/>
|
212
|
+
<enumeration value="pendingUpdate"/>
|
213
|
+
<enumeration value="serverDeleteProhibited"/>
|
214
|
+
<enumeration value="serverUpdateProhibited"/>
|
215
|
+
</restriction>
|
216
|
+
</simpleType>
|
217
|
+
|
218
|
+
<!--
|
219
|
+
Pending action notification response elements.
|
220
|
+
-->
|
221
|
+
<complexType name="panDataType">
|
222
|
+
<sequence>
|
223
|
+
<element name="name" type="host:paNameType"/>
|
224
|
+
<element name="paTRID" type="epp:trIDType"/>
|
225
|
+
<element name="paDate" type="dateTime"/>
|
226
|
+
</sequence>
|
227
|
+
</complexType>
|
228
|
+
<complexType name="paNameType">
|
229
|
+
<simpleContent>
|
230
|
+
<extension base="eppcom:labelType">
|
231
|
+
<attribute name="paResult" type="boolean"
|
232
|
+
use="required"/>
|
233
|
+
</extension>
|
234
|
+
</simpleContent>
|
235
|
+
</complexType>
|
236
|
+
|
237
|
+
<!--
|
238
|
+
End of schema.
|
239
|
+
-->
|
240
|
+
</schema>
|
data/test/test_client.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestEppClient < Test::Unit::TestCase
|
4
|
+
context 'EPP::Client' do
|
5
|
+
setup do
|
6
|
+
@client = EPP::Client.new('TEST', 'test', 'epp.test.host')
|
7
|
+
end
|
8
|
+
|
9
|
+
should 'be instance of EPP::Client' do
|
10
|
+
assert @client.kind_of?(EPP::Client)
|
11
|
+
end
|
12
|
+
|
13
|
+
should 'allow configuration of port' do
|
14
|
+
client = nil
|
15
|
+
assert_nothing_raised do
|
16
|
+
client = EPP::Client.new('TEST', 'test', 'epp.test.host', :port => 7001)
|
17
|
+
end
|
18
|
+
|
19
|
+
assert_equal 7001, client.options[:port]
|
20
|
+
end
|
21
|
+
|
22
|
+
should 'allow configuration of language' do
|
23
|
+
client = EPP::Client.new('TEST', 'test', 'epp.test.host', :lang => 'no')
|
24
|
+
|
25
|
+
assert_equal 'no', client.options[:lang]
|
26
|
+
end
|
27
|
+
|
28
|
+
should 'allow configuration of version' do
|
29
|
+
client = EPP::Client.new('TEST', 'test', 'epp.test.host', :version => '2.0')
|
30
|
+
|
31
|
+
assert_equal '2.0', client.options[:version]
|
32
|
+
end
|
33
|
+
|
34
|
+
should 'allow configuration of extensions' do
|
35
|
+
extensions = %w(urn:ietf:params:xml:ns:secDNS-1.1)
|
36
|
+
client = EPP::Client.new('TEST', 'test', 'epp.test.host', :extensions => extensions)
|
37
|
+
|
38
|
+
assert_equal extensions, client.options[:extensions]
|
39
|
+
end
|
40
|
+
|
41
|
+
should 'allow configuration of services' do
|
42
|
+
services = %w(http://www.nominet.org.uk/epp/xml/nom-domain-2.0)
|
43
|
+
client = EPP::Client.new('TEST', 'test', 'epp.test.host', :services => services)
|
44
|
+
|
45
|
+
assert_equal services, client.options[:services]
|
46
|
+
end
|
47
|
+
|
48
|
+
should 'allow compatibility mode' do
|
49
|
+
client = EPP::Client.new('TEST', 'test', 'epp.test.host', :compatibility => true)
|
50
|
+
|
51
|
+
assert client.compatibility?
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestEppRequest < Test::Unit::TestCase
|
4
|
+
context 'EPP::Request' do
|
5
|
+
setup do
|
6
|
+
hello = EPP::Requests::Hello.new
|
7
|
+
@request = EPP::Request.new(hello)
|
8
|
+
end
|
9
|
+
|
10
|
+
should 'validate against schema' do
|
11
|
+
xml = @request.to_xml
|
12
|
+
assert xml.validate_schema(schema)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/test/test_server.rb
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class TestEppServer < Test::Unit::TestCase
|
4
|
+
context 'EPP::Server' do
|
5
|
+
context 'DEFAULT_SERVICES' do
|
6
|
+
should 'return EPP::Client::DEFAULT_SERVICES' do
|
7
|
+
assert_output '', /EPP::Server::DEFAULT_SERVICES has been deprecated/ do
|
8
|
+
assert_equal EPP::Client::DEFAULT_SERVICES, EPP::Server::DEFAULT_SERVICES
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
context '.new' do
|
13
|
+
setup do
|
14
|
+
@server = EPP::Server.new('TEST', 'test', 'epp.test.host')
|
15
|
+
end
|
16
|
+
|
17
|
+
should 'be instance of EPP::Server' do
|
18
|
+
assert @server.kind_of?(EPP::Server)
|
19
|
+
end
|
20
|
+
|
21
|
+
should 'allow configuration of port' do
|
22
|
+
server = nil
|
23
|
+
assert_nothing_raised do
|
24
|
+
server = EPP::Server.new('TEST', 'test', 'epp.test.host', :port => 7001)
|
25
|
+
end
|
26
|
+
|
27
|
+
assert_equal 7001, server.options[:port]
|
28
|
+
end
|
29
|
+
|
30
|
+
should 'allow configuration of language' do
|
31
|
+
server = EPP::Server.new('TEST', 'test', 'epp.test.host', :lang => 'no')
|
32
|
+
|
33
|
+
assert_equal 'no', server.options[:lang]
|
34
|
+
end
|
35
|
+
|
36
|
+
should 'allow configuration of version' do
|
37
|
+
server = EPP::Server.new('TEST', 'test', 'epp.test.host', :version => '2.0')
|
38
|
+
|
39
|
+
assert_equal '2.0', server.options[:version]
|
40
|
+
end
|
41
|
+
|
42
|
+
should 'allow configuration of extensions' do
|
43
|
+
extensions = %w(urn:ietf:params:xml:ns:secDNS-1.1)
|
44
|
+
server = EPP::Server.new('TEST', 'test', 'epp.test.host', :extensions => extensions)
|
45
|
+
|
46
|
+
assert_equal extensions, server.options[:extensions]
|
47
|
+
end
|
48
|
+
|
49
|
+
should 'allow configuration of services' do
|
50
|
+
services = %w(http://www.nominet.org.uk/epp/xml/nom-domain-2.0)
|
51
|
+
server = EPP::Server.new('TEST', 'test', 'epp.test.host', :services => services)
|
52
|
+
|
53
|
+
assert_equal services, server.options[:services]
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|