rtiss_soap4r 1.6.1 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (432) hide show
  1. checksums.yaml +7 -0
  2. data/bin/wsdl2ruby.rb +2 -1
  3. data/bin/xsd2ruby.rb +2 -1
  4. data/lib/soap/attachment.rb +1 -1
  5. data/lib/soap/attrproxy.rb +1 -1
  6. data/lib/soap/baseData.rb +1 -1
  7. data/lib/soap/element.rb +2 -2
  8. data/lib/soap/encodingstyle/aspDotNetHandler.rb +1 -1
  9. data/lib/soap/encodingstyle/handler.rb +1 -1
  10. data/lib/soap/encodingstyle/literalHandler.rb +1 -1
  11. data/lib/soap/encodingstyle/soapHandler.rb +1 -1
  12. data/lib/soap/filter.rb +1 -1
  13. data/lib/soap/filter/filterchain.rb +1 -1
  14. data/lib/soap/filter/handler.rb +1 -1
  15. data/lib/soap/filter/streamhandler.rb +1 -1
  16. data/lib/soap/generator.rb +2 -2
  17. data/lib/soap/header/handler.rb +1 -1
  18. data/lib/soap/header/handlerset.rb +1 -1
  19. data/lib/soap/header/mappinghandler.rb +1 -1
  20. data/lib/soap/header/simplehandler.rb +1 -1
  21. data/lib/soap/http_logger.rb +20 -0
  22. data/lib/soap/httpconfigloader.rb +1 -1
  23. data/lib/soap/mapping.rb +1 -1
  24. data/lib/soap/mapping/encodedregistry.rb +16 -14
  25. data/lib/soap/mapping/factory.rb +2 -2
  26. data/lib/soap/mapping/literalregistry.rb +1 -1
  27. data/lib/soap/mapping/mapping.rb +7 -7
  28. data/lib/soap/mapping/registry.rb +1 -1
  29. data/lib/soap/mapping/rubytypeFactory.rb +1 -1
  30. data/lib/soap/mapping/schemadefinition.rb +1 -1
  31. data/lib/soap/mapping/typeMap.rb +1 -1
  32. data/lib/soap/mapping/wsdlencodedregistry.rb +1 -1
  33. data/lib/soap/mapping/wsdlliteralregistry.rb +1 -1
  34. data/lib/soap/marshal.rb +1 -1
  35. data/lib/soap/mimemessage.rb +1 -1
  36. data/lib/soap/nestedexception.rb +1 -1
  37. data/lib/soap/netHttpClient.rb +1 -1
  38. data/lib/soap/ns.rb +1 -1
  39. data/lib/soap/parser.rb +1 -1
  40. data/lib/soap/processor.rb +1 -1
  41. data/lib/soap/property.rb +7 -17
  42. data/lib/soap/proxy.rb +1 -1
  43. data/lib/soap/rpc/cgistub.rb +2 -1
  44. data/lib/soap/rpc/driver.rb +16 -1
  45. data/lib/soap/rpc/element.rb +1 -1
  46. data/lib/soap/rpc/httpserver.rb +2 -1
  47. data/lib/soap/rpc/methodDef.rb +1 -1
  48. data/lib/soap/rpc/proxy.rb +16 -4
  49. data/lib/soap/rpc/router.rb +1 -1
  50. data/lib/soap/rpc/rpc.rb +1 -1
  51. data/lib/soap/rpc/soaplet.rb +1 -1
  52. data/lib/soap/rpc/standaloneServer.rb +1 -1
  53. data/lib/soap/soap.rb +24 -4
  54. data/lib/soap/streamHandler.rb +3 -3
  55. data/lib/soap/version.rb +7 -4
  56. data/lib/soap/wsdlDriver.rb +1 -1
  57. data/lib/wsdl/binding.rb +1 -1
  58. data/lib/wsdl/data.rb +1 -1
  59. data/lib/wsdl/definitions.rb +1 -1
  60. data/lib/wsdl/documentation.rb +1 -1
  61. data/lib/wsdl/import.rb +1 -1
  62. data/lib/wsdl/importer.rb +1 -1
  63. data/lib/wsdl/info.rb +1 -1
  64. data/lib/wsdl/message.rb +1 -1
  65. data/lib/wsdl/operation.rb +1 -1
  66. data/lib/wsdl/operationBinding.rb +1 -1
  67. data/lib/wsdl/param.rb +1 -1
  68. data/lib/wsdl/parser.rb +17 -2
  69. data/lib/wsdl/part.rb +1 -1
  70. data/lib/wsdl/port.rb +1 -1
  71. data/lib/wsdl/portType.rb +1 -1
  72. data/lib/wsdl/service.rb +1 -1
  73. data/lib/wsdl/soap/address.rb +1 -1
  74. data/lib/wsdl/soap/binding.rb +1 -1
  75. data/lib/wsdl/soap/body.rb +1 -1
  76. data/lib/wsdl/soap/cgiStubCreator.rb +1 -1
  77. data/lib/wsdl/soap/classDefCreator.rb +1 -1
  78. data/lib/wsdl/soap/classDefCreatorSupport.rb +1 -1
  79. data/lib/wsdl/soap/classNameCreator.rb +1 -1
  80. data/lib/wsdl/soap/clientSkeltonCreator.rb +1 -1
  81. data/lib/wsdl/soap/complexType.rb +1 -1
  82. data/lib/wsdl/soap/data.rb +1 -1
  83. data/lib/wsdl/soap/definitions.rb +1 -1
  84. data/lib/wsdl/soap/driverCreator.rb +3 -4
  85. data/lib/wsdl/soap/element.rb +1 -1
  86. data/lib/wsdl/soap/encodedMappingRegistryCreator.rb +1 -1
  87. data/lib/wsdl/soap/fault.rb +1 -1
  88. data/lib/wsdl/soap/header.rb +1 -1
  89. data/lib/wsdl/soap/headerfault.rb +1 -1
  90. data/lib/wsdl/soap/literalMappingRegistryCreator.rb +1 -1
  91. data/lib/wsdl/soap/mappingRegistryCreator.rb +1 -1
  92. data/lib/wsdl/soap/mappingRegistryCreatorSupport.rb +1 -1
  93. data/lib/wsdl/soap/methodDefCreator.rb +1 -1
  94. data/lib/wsdl/soap/operation.rb +1 -1
  95. data/lib/wsdl/soap/servantSkeltonCreator.rb +1 -1
  96. data/lib/wsdl/soap/servletStubCreator.rb +1 -1
  97. data/lib/wsdl/soap/standaloneServerStubCreator.rb +1 -1
  98. data/lib/wsdl/soap/wsdl2ruby.rb +29 -20
  99. data/lib/wsdl/types.rb +1 -1
  100. data/lib/wsdl/wsdl.rb +1 -1
  101. data/lib/wsdl/xmlSchema/all.rb +1 -1
  102. data/lib/wsdl/xmlSchema/annotation.rb +1 -1
  103. data/lib/wsdl/xmlSchema/any.rb +1 -1
  104. data/lib/wsdl/xmlSchema/anyAttribute.rb +1 -1
  105. data/lib/wsdl/xmlSchema/attribute.rb +1 -1
  106. data/lib/wsdl/xmlSchema/attributeGroup.rb +1 -1
  107. data/lib/wsdl/xmlSchema/choice.rb +1 -1
  108. data/lib/wsdl/xmlSchema/complexContent.rb +1 -1
  109. data/lib/wsdl/xmlSchema/complexExtension.rb +1 -1
  110. data/lib/wsdl/xmlSchema/complexRestriction.rb +1 -1
  111. data/lib/wsdl/xmlSchema/complexType.rb +1 -1
  112. data/lib/wsdl/xmlSchema/content.rb +1 -1
  113. data/lib/wsdl/xmlSchema/data.rb +1 -1
  114. data/lib/wsdl/xmlSchema/element.rb +1 -1
  115. data/lib/wsdl/xmlSchema/enumeration.rb +1 -1
  116. data/lib/wsdl/xmlSchema/fractiondigits.rb +1 -1
  117. data/lib/wsdl/xmlSchema/group.rb +1 -1
  118. data/lib/wsdl/xmlSchema/import.rb +1 -2
  119. data/lib/wsdl/xmlSchema/importHandler.rb +1 -2
  120. data/lib/wsdl/xmlSchema/importer.rb +1 -1
  121. data/lib/wsdl/xmlSchema/include.rb +1 -2
  122. data/lib/wsdl/xmlSchema/length.rb +1 -1
  123. data/lib/wsdl/xmlSchema/list.rb +1 -1
  124. data/lib/wsdl/xmlSchema/maxexclusive.rb +1 -1
  125. data/lib/wsdl/xmlSchema/maxinclusive.rb +1 -1
  126. data/lib/wsdl/xmlSchema/maxlength.rb +1 -1
  127. data/lib/wsdl/xmlSchema/minexclusive.rb +1 -1
  128. data/lib/wsdl/xmlSchema/mininclusive.rb +1 -1
  129. data/lib/wsdl/xmlSchema/minlength.rb +1 -1
  130. data/lib/wsdl/xmlSchema/parser.rb +1 -1
  131. data/lib/wsdl/xmlSchema/pattern.rb +1 -1
  132. data/lib/wsdl/xmlSchema/ref.rb +1 -1
  133. data/lib/wsdl/xmlSchema/schema.rb +1 -1
  134. data/lib/wsdl/xmlSchema/sequence.rb +1 -1
  135. data/lib/wsdl/xmlSchema/simpleContent.rb +1 -1
  136. data/lib/wsdl/xmlSchema/simpleExtension.rb +1 -1
  137. data/lib/wsdl/xmlSchema/simpleRestriction.rb +1 -1
  138. data/lib/wsdl/xmlSchema/simpleType.rb +1 -1
  139. data/lib/wsdl/xmlSchema/totaldigits.rb +1 -1
  140. data/lib/wsdl/xmlSchema/union.rb +1 -1
  141. data/lib/wsdl/xmlSchema/unique.rb +1 -1
  142. data/lib/wsdl/xmlSchema/whitespace.rb +1 -1
  143. data/lib/wsdl/xmlSchema/xsd2ruby.rb +3 -2
  144. data/lib/xsd/charset.rb +2 -2
  145. data/lib/xsd/codegen.rb +1 -1
  146. data/lib/xsd/codegen/classdef.rb +1 -1
  147. data/lib/xsd/codegen/commentdef.rb +1 -1
  148. data/lib/xsd/codegen/gensupport.rb +1 -1
  149. data/lib/xsd/codegen/methoddef.rb +1 -1
  150. data/lib/xsd/codegen/moduledef.rb +1 -1
  151. data/lib/xsd/datatypes.rb +2 -3
  152. data/lib/xsd/datatypes1999.rb +1 -1
  153. data/lib/xsd/iconvcharset.rb +3 -4
  154. data/lib/xsd/mapping.rb +1 -1
  155. data/lib/xsd/namedelements.rb +1 -1
  156. data/lib/xsd/ns.rb +2 -2
  157. data/lib/xsd/qname.rb +1 -1
  158. data/lib/xsd/xmlparser.rb +43 -39
  159. data/lib/xsd/xmlparser/libxmlparser.rb +38 -18
  160. data/lib/xsd/xmlparser/nokogiriparser.rb +63 -0
  161. data/lib/xsd/xmlparser/ogaparser.rb +53 -0
  162. data/lib/xsd/xmlparser/oxparser.rb +97 -0
  163. data/lib/xsd/xmlparser/parser.rb +2 -2
  164. data/lib/xsd/xmlparser/rexmlparser.rb +4 -9
  165. metadata +175 -424
  166. data/lib/xsd/xmlparser/xmlparser.rb +0 -51
  167. data/lib/xsd/xmlparser/xmlscanner.rb +0 -150
  168. data/test/16runner.rb +0 -69
  169. data/test/helper.rb +0 -7
  170. data/test/interopR2/README.txt +0 -2
  171. data/test/interopR2/SOAPBuildersInterop_R2.wsdl +0 -461
  172. data/test/interopR2/SOAPBuildersInterop_R2GrB.wsdl +0 -19
  173. data/test/interopR2/base.rb +0 -289
  174. data/test/interopR2/client.NetRemoting.rb +0 -18
  175. data/test/interopR2/client.rb +0 -1235
  176. data/test/interopR2/client4S4C.rb +0 -16
  177. data/test/interopR2/client4S4C2.rb +0 -15
  178. data/test/interopR2/clientASP.NET.rb +0 -18
  179. data/test/interopR2/clientApacheAxis.rb +0 -17
  180. data/test/interopR2/clientApacheSOAP.rb +0 -18
  181. data/test/interopR2/clientBEAWebLogic.rb +0 -18
  182. data/test/interopR2/clientBase.rb +0 -1968
  183. data/test/interopR2/clientCapeConnect.rb +0 -19
  184. data/test/interopR2/clientDelphi.rb +0 -20
  185. data/test/interopR2/clientEasySoap.rb +0 -15
  186. data/test/interopR2/clientFrontier.rb +0 -26
  187. data/test/interopR2/clientGLUE.rb +0 -33
  188. data/test/interopR2/clientHP.rb +0 -14
  189. data/test/interopR2/clientJAX-RPC.rb +0 -20
  190. data/test/interopR2/clientJSOAP.rb +0 -15
  191. data/test/interopR2/clientKafkaXSLT.rb +0 -16
  192. data/test/interopR2/clientMSSOAPToolkit2.0.rb +0 -18
  193. data/test/interopR2/clientMSSOAPToolkit3.0.rb +0 -18
  194. data/test/interopR2/clientNuSOAP.rb +0 -20
  195. data/test/interopR2/clientNuWave.rb +0 -16
  196. data/test/interopR2/clientOpenLink.rb +0 -16
  197. data/test/interopR2/clientOracle.rb +0 -16
  198. data/test/interopR2/clientPEAR.rb +0 -19
  199. data/test/interopR2/clientPhalanx.rb +0 -19
  200. data/test/interopR2/clientSIMACE.rb +0 -19
  201. data/test/interopR2/clientSOAP4R.rb +0 -19
  202. data/test/interopR2/clientSOAP__Lite.rb +0 -15
  203. data/test/interopR2/clientSQLData.rb +0 -19
  204. data/test/interopR2/clientSilverStream.rb +0 -18
  205. data/test/interopR2/clientSpray2001.rb +0 -18
  206. data/test/interopR2/clientSun.rb +0 -20
  207. data/test/interopR2/clientVWOpentalkSoap.rb +0 -20
  208. data/test/interopR2/clientWASP.rb +0 -20
  209. data/test/interopR2/clientWASPC.rb +0 -19
  210. data/test/interopR2/clientWebMethods.rb +0 -16
  211. data/test/interopR2/clientWhiteMesa.rb +0 -29
  212. data/test/interopR2/clientWingfoot.rb +0 -16
  213. data/test/interopR2/clientXMLBus.rb +0 -20
  214. data/test/interopR2/clientXMLRPC-EPI.rb +0 -18
  215. data/test/interopR2/clientXSOAP.rb +0 -15
  216. data/test/interopR2/clientZSI.rb +0 -20
  217. data/test/interopR2/clienteSOAP.rb +0 -19
  218. data/test/interopR2/clientgSOAP.rb +0 -19
  219. data/test/interopR2/clientkSOAP.rb +0 -18
  220. data/test/interopR2/iSimonReg.rb +0 -113
  221. data/test/interopR2/interopResultBase.rb +0 -115
  222. data/test/interopR2/interopService.rb +0 -248
  223. data/test/interopR2/rwikiInteropService.rb +0 -106
  224. data/test/interopR2/server.cgi +0 -271
  225. data/test/interopR2/server.rb +0 -276
  226. data/test/interopR2/simonReg.rb +0 -124
  227. data/test/interopR2/test.sh +0 -49
  228. data/test/interopR4/client.rb +0 -113
  229. data/test/runner.rb +0 -8
  230. data/test/sm11/classDef.rb +0 -157
  231. data/test/sm11/client.rb +0 -543
  232. data/test/sm11/driver.rb +0 -184
  233. data/test/sm11/servant.rb +0 -1068
  234. data/test/sm11/server.rb +0 -26
  235. data/test/soap/asp.net/hello.wsdl +0 -96
  236. data/test/soap/asp.net/test_aspdotnet.rb +0 -124
  237. data/test/soap/auth/htdigest +0 -2
  238. data/test/soap/auth/htpasswd +0 -2
  239. data/test/soap/auth/test_basic.rb +0 -118
  240. data/test/soap/auth/test_digest.rb +0 -119
  241. data/test/soap/calc/calc.rb +0 -18
  242. data/test/soap/calc/calc2.rb +0 -30
  243. data/test/soap/calc/server.cgi +0 -16
  244. data/test/soap/calc/server.rb +0 -18
  245. data/test/soap/calc/server2.rb +0 -21
  246. data/test/soap/calc/test_calc.rb +0 -53
  247. data/test/soap/calc/test_calc2.rb +0 -57
  248. data/test/soap/calc/test_calc_cgi.rb +0 -72
  249. data/test/soap/case/test_mapping.rb +0 -58
  250. data/test/soap/fault/test_customfault.rb +0 -61
  251. data/test/soap/fault/test_fault.rb +0 -47
  252. data/test/soap/fault/test_soaparray.rb +0 -36
  253. data/test/soap/filter/test_filter.rb +0 -147
  254. data/test/soap/header/server.cgi +0 -121
  255. data/test/soap/header/test_authheader.rb +0 -241
  256. data/test/soap/header/test_authheader_cgi.rb +0 -122
  257. data/test/soap/header/test_simplehandler.rb +0 -117
  258. data/test/soap/helloworld/hw_s.rb +0 -17
  259. data/test/soap/helloworld/test_helloworld.rb +0 -45
  260. data/test/soap/htpasswd +0 -2
  261. data/test/soap/literalArrayMapping/amazonEc.rb +0 -4779
  262. data/test/soap/literalArrayMapping/amazonEcDriver.rb +0 -173
  263. data/test/soap/literalArrayMapping/amazonresponse.xml +0 -100
  264. data/test/soap/literalArrayMapping/test_definedarray.rb +0 -35
  265. data/test/soap/marshal/marshaltestlib.rb +0 -498
  266. data/test/soap/marshal/test_digraph.rb +0 -57
  267. data/test/soap/marshal/test_marshal.rb +0 -28
  268. data/test/soap/marshal/test_struct.rb +0 -48
  269. data/test/soap/ssl/README +0 -1
  270. data/test/soap/ssl/ca.cert +0 -23
  271. data/test/soap/ssl/client.cert +0 -19
  272. data/test/soap/ssl/client.key +0 -15
  273. data/test/soap/ssl/server.cert +0 -19
  274. data/test/soap/ssl/server.key +0 -15
  275. data/test/soap/ssl/sslsvr.rb +0 -59
  276. data/test/soap/ssl/subca.cert +0 -21
  277. data/test/soap/ssl/test_ssl.rb +0 -236
  278. data/test/soap/struct/test_struct.rb +0 -71
  279. data/test/soap/styleuse/client.rb +0 -21
  280. data/test/soap/styleuse/server.rb +0 -87
  281. data/test/soap/swa/test_file.rb +0 -76
  282. data/test/soap/test_basetype.rb +0 -1091
  283. data/test/soap/test_cookie.rb +0 -113
  284. data/test/soap/test_custom_ns.rb +0 -106
  285. data/test/soap/test_custommap.rb +0 -111
  286. data/test/soap/test_empty.rb +0 -106
  287. data/test/soap/test_envelopenamespace.rb +0 -86
  288. data/test/soap/test_extraattr.rb +0 -55
  289. data/test/soap/test_generator.rb +0 -32
  290. data/test/soap/test_httpconfigloader.rb +0 -72
  291. data/test/soap/test_mapping.rb +0 -132
  292. data/test/soap/test_nestedexception.rb +0 -71
  293. data/test/soap/test_nil.rb +0 -71
  294. data/test/soap/test_no_indent.rb +0 -89
  295. data/test/soap/test_property.rb +0 -429
  296. data/test/soap/test_response_as_xml.rb +0 -118
  297. data/test/soap/test_soapelement.rb +0 -139
  298. data/test/soap/test_streamhandler.rb +0 -271
  299. data/test/soap/test_styleuse.rb +0 -327
  300. data/test/soap/wsdlDriver/README.txt +0 -2
  301. data/test/soap/wsdlDriver/calc.wsdl +0 -126
  302. data/test/soap/wsdlDriver/document.wsdl +0 -54
  303. data/test/soap/wsdlDriver/echo_version.rb +0 -30
  304. data/test/soap/wsdlDriver/simpletype.wsdl +0 -63
  305. data/test/soap/wsdlDriver/test_calc.rb +0 -72
  306. data/test/soap/wsdlDriver/test_document.rb +0 -72
  307. data/test/soap/wsdlDriver/test_simpletype.rb +0 -82
  308. data/test/testutil.rb +0 -55
  309. data/test/wsdl/abstract/abstract.wsdl +0 -176
  310. data/test/wsdl/abstract/test_abstract.rb +0 -160
  311. data/test/wsdl/anonymous/expectedClassDef.rb +0 -129
  312. data/test/wsdl/anonymous/expectedDriver.rb +0 -60
  313. data/test/wsdl/anonymous/expectedMappingRegistry.rb +0 -177
  314. data/test/wsdl/anonymous/lp.wsdl +0 -147
  315. data/test/wsdl/anonymous/test_anonymous.rb +0 -131
  316. data/test/wsdl/any/any.wsdl +0 -114
  317. data/test/wsdl/any/expectedDriver.rb +0 -69
  318. data/test/wsdl/any/expectedEcho.rb +0 -58
  319. data/test/wsdl/any/expectedMappingRegistry.rb +0 -64
  320. data/test/wsdl/any/expectedService.rb +0 -70
  321. data/test/wsdl/any/test_any.rb +0 -194
  322. data/test/wsdl/axisArray/axisArray.wsdl +0 -87
  323. data/test/wsdl/axisArray/test_axisarray.rb +0 -125
  324. data/test/wsdl/choice/choice.wsdl +0 -167
  325. data/test/wsdl/choice/test_choice.rb +0 -311
  326. data/test/wsdl/complexcontent/complexContent.wsdl +0 -83
  327. data/test/wsdl/complexcontent/test_echo.rb +0 -91
  328. data/test/wsdl/datetime/DatetimeService.rb +0 -45
  329. data/test/wsdl/datetime/datetime.rb +0 -0
  330. data/test/wsdl/datetime/datetime.wsdl +0 -45
  331. data/test/wsdl/datetime/datetimeServant.rb +0 -23
  332. data/test/wsdl/datetime/test_datetime.rb +0 -88
  333. data/test/wsdl/document/array/double.wsdl +0 -161
  334. data/test/wsdl/document/array/test_array.rb +0 -202
  335. data/test/wsdl/document/document.wsdl +0 -76
  336. data/test/wsdl/document/number.wsdl +0 -54
  337. data/test/wsdl/document/ping_nosoapaction.wsdl +0 -66
  338. data/test/wsdl/document/test_nosoapaction.rb +0 -103
  339. data/test/wsdl/document/test_number.rb +0 -93
  340. data/test/wsdl/document/test_rpc.rb +0 -356
  341. data/test/wsdl/emptycomplextype.wsdl +0 -31
  342. data/test/wsdl/fault/fault.wsdl +0 -79
  343. data/test/wsdl/fault/multifault.wsdl +0 -96
  344. data/test/wsdl/fault/test_fault.rb +0 -120
  345. data/test/wsdl/fault/test_multifault.rb +0 -135
  346. data/test/wsdl/group/expectedClassdef.rb +0 -59
  347. data/test/wsdl/group/expectedDriver.rb +0 -52
  348. data/test/wsdl/group/expectedMappingRegistry.rb +0 -68
  349. data/test/wsdl/group/group.wsdl +0 -88
  350. data/test/wsdl/group/test_rpc.rb +0 -146
  351. data/test/wsdl/list/list.wsdl +0 -93
  352. data/test/wsdl/list/test_list.rb +0 -125
  353. data/test/wsdl/map/map.wsdl +0 -92
  354. data/test/wsdl/map/map.xml +0 -43
  355. data/test/wsdl/map/test_map.rb +0 -100
  356. data/test/wsdl/marshal/person.wsdl +0 -21
  357. data/test/wsdl/marshal/person_org.rb +0 -24
  358. data/test/wsdl/marshal/test_wsdlmarshal.rb +0 -76
  359. data/test/wsdl/multiplefault.wsdl +0 -75
  360. data/test/wsdl/oneway/oneway.wsdl +0 -36
  361. data/test/wsdl/oneway/test_oneway.rb +0 -109
  362. data/test/wsdl/overload/expectedClient.rb +0 -38
  363. data/test/wsdl/overload/expectedDriver.rb +0 -62
  364. data/test/wsdl/overload/expectedServant.rb +0 -36
  365. data/test/wsdl/overload/overload.wsdl +0 -70
  366. data/test/wsdl/overload/test_overload.rb +0 -132
  367. data/test/wsdl/qualified/lp.wsdl +0 -47
  368. data/test/wsdl/qualified/lp.xsd +0 -26
  369. data/test/wsdl/qualified/np.wsdl +0 -51
  370. data/test/wsdl/qualified/test_qualified.rb +0 -138
  371. data/test/wsdl/qualified/test_unqualified.rb +0 -139
  372. data/test/wsdl/raa/RAAService.rb +0 -126
  373. data/test/wsdl/raa/README.txt +0 -8
  374. data/test/wsdl/raa/expectedClassDef.rb +0 -101
  375. data/test/wsdl/raa/expectedDriver.rb +0 -97
  376. data/test/wsdl/raa/expectedMappingRegistry.rb +0 -122
  377. data/test/wsdl/raa/raa.wsdl +0 -264
  378. data/test/wsdl/raa/test_raa.rb +0 -127
  379. data/test/wsdl/ref/expectedDriver.rb +0 -52
  380. data/test/wsdl/ref/expectedProduct.rb +0 -244
  381. data/test/wsdl/ref/product.wsdl +0 -147
  382. data/test/wsdl/ref/test_ref.rb +0 -269
  383. data/test/wsdl/rpc/rpc.wsdl +0 -109
  384. data/test/wsdl/rpc/test-rpc-lit.wsdl +0 -371
  385. data/test/wsdl/rpc/test_rpc.rb +0 -177
  386. data/test/wsdl/rpc/test_rpc_lit.rb +0 -471
  387. data/test/wsdl/simplecontent/simplecontent.wsdl +0 -84
  388. data/test/wsdl/simplecontent/test_simplecontent.rb +0 -103
  389. data/test/wsdl/simpletype/rpc/expectedClient.rb +0 -35
  390. data/test/wsdl/simpletype/rpc/expectedDriver.rb +0 -59
  391. data/test/wsdl/simpletype/rpc/expectedEchoVersion.rb +0 -37
  392. data/test/wsdl/simpletype/rpc/expectedMappingRegistry.rb +0 -58
  393. data/test/wsdl/simpletype/rpc/expectedServant.rb +0 -33
  394. data/test/wsdl/simpletype/rpc/expectedService.rb +0 -56
  395. data/test/wsdl/simpletype/rpc/rpc.wsdl +0 -98
  396. data/test/wsdl/simpletype/rpc/test_rpc.rb +0 -53
  397. data/test/wsdl/simpletype/simpletype.wsdl +0 -114
  398. data/test/wsdl/simpletype/test_simpletype.rb +0 -93
  399. data/test/wsdl/soap/soapbodyparts.wsdl +0 -103
  400. data/test/wsdl/soap/test_soapbodyparts.rb +0 -80
  401. data/test/wsdl/soap/wsdl2ruby/expectedClassdef.rb +0 -22
  402. data/test/wsdl/soap/wsdl2ruby/expectedClient.rb +0 -35
  403. data/test/wsdl/soap/wsdl2ruby/expectedDriver.rb +0 -59
  404. data/test/wsdl/soap/wsdl2ruby/expectedMappingRegistry.rb +0 -37
  405. data/test/wsdl/soap/wsdl2ruby/expectedServant.rb +0 -33
  406. data/test/wsdl/soap/wsdl2ruby/expectedService.cgi +0 -49
  407. data/test/wsdl/soap/wsdl2ruby/expectedService.rb +0 -56
  408. data/test/wsdl/soap/wsdl2ruby/rpc.wsdl +0 -80
  409. data/test/wsdl/soap/wsdl2ruby/section/expectedClassdef.rb +0 -38
  410. data/test/wsdl/soap/wsdl2ruby/section/section.xsd +0 -31
  411. data/test/wsdl/soap/wsdl2ruby/section/test_section.rb +0 -54
  412. data/test/wsdl/soap/wsdl2ruby/soapenc/soapenc.wsdl +0 -64
  413. data/test/wsdl/soap/wsdl2ruby/soapenc/test_soapenc.rb +0 -84
  414. data/test/wsdl/soap/wsdl2ruby/test_wsdl2ruby.rb +0 -103
  415. data/test/wsdl/soaptype/soaptype.wsdl +0 -61
  416. data/test/wsdl/soaptype/test_soaptype.rb +0 -179
  417. data/test/wsdl/test_emptycomplextype.rb +0 -22
  418. data/test/wsdl/test_fault.rb +0 -51
  419. data/test/wsdl/test_multiplefault.rb +0 -42
  420. data/test/xsd/codegen/test_classdef.rb +0 -245
  421. data/test/xsd/noencoding.xml +0 -4
  422. data/test/xsd/test_noencoding.rb +0 -33
  423. data/test/xsd/test_ns.rb +0 -42
  424. data/test/xsd/test_xmlschemaparser.rb +0 -23
  425. data/test/xsd/test_xsd.rb +0 -1639
  426. data/test/xsd/xmllang.xml +0 -43
  427. data/test/xsd/xmlschema.xml +0 -12
  428. data/test/xsd/xsd2ruby/expected_mysample.rb +0 -66
  429. data/test/xsd/xsd2ruby/expected_mysample_mapper.rb +0 -12
  430. data/test/xsd/xsd2ruby/expected_mysample_mapping_registry.rb +0 -52
  431. data/test/xsd/xsd2ruby/section.xsd +0 -49
  432. data/test/xsd/xsd2ruby/test_xsd2ruby.rb +0 -91
@@ -1,1639 +0,0 @@
1
- # encoding: ASCII-8BIT
2
- require 'helper'
3
- require 'xsd/datatypes'
4
-
5
-
6
- module XSD
7
-
8
-
9
- class TestXSD < Test::Unit::TestCase
10
- NegativeZero = (-1.0 / (1.0 / 0.0))
11
-
12
- def setup
13
- end
14
-
15
- def teardown
16
- end
17
-
18
- def assert_parsed_result(klass, str)
19
- o = klass.new(str)
20
- assert_equal(str, o.to_s)
21
- end
22
-
23
- def test_NSDBase
24
- o = XSD::NSDBase.new
25
- assert_equal(nil, o.type)
26
- end
27
-
28
- def test_XSDBase
29
- o = XSD::XSDAnySimpleType.new
30
- assert_equal(nil, o.data)
31
- assert_equal(true, o.is_nil)
32
- assert_equal('', o.to_s)
33
- end
34
-
35
- def test_XSDNil
36
- o = XSD::XSDNil.new
37
- assert_equal(XSD::Namespace, o.type.namespace)
38
- assert_equal(XSD::NilLiteral, o.type.name)
39
- assert_equal(nil, o.data)
40
- assert_equal(true, o.is_nil)
41
-
42
- o = XSD::XSDNil.new(nil)
43
- assert_equal(true, o.is_nil)
44
- assert_equal(nil, o.data)
45
- assert_equal("", o.to_s)
46
- o = XSD::XSDNil.new('var')
47
- assert_equal(false, o.is_nil)
48
- assert_equal('var', o.data)
49
- assert_equal('var', o.to_s)
50
- end
51
-
52
- def test_XSDString_UTF8
53
- o = XSD::XSDString.new
54
- assert_equal(XSD::Namespace, o.type.namespace)
55
- assert_equal(XSD::StringLiteral, o.type.name)
56
- assert_equal(nil, o.data)
57
- assert_equal(true, o.is_nil)
58
-
59
- str = "abc"
60
- assert_equal(str, XSD::XSDString.new(str).data)
61
- assert_equal(str, XSD::XSDString.new(str).to_s)
62
- back = XSD::XSDString.strict_ces_validation
63
- XSD::XSDString.strict_ces_validation = true
64
- begin
65
- assert_raises(XSD::ValueSpaceError) do
66
- XSD::XSDString.new("\0")
67
- end
68
- assert_raises(XSD::ValueSpaceError) do
69
- p XSD::XSDString.new("\xC0\xC0").to_s
70
- end
71
- ensure
72
- XSD::XSDString.strict_ces_validation = back
73
- end
74
- end
75
-
76
- def test_XSDString_NONE
77
- XSD::Charset.module_eval { @encoding_backup = @internal_encoding; @internal_encoding = "NONE" }
78
- begin
79
- o = XSD::XSDString.new
80
- assert_equal(XSD::Namespace, o.type.namespace)
81
- assert_equal(XSD::StringLiteral, o.type.name)
82
- assert_equal(nil, o.data)
83
- assert_equal(true, o.is_nil)
84
-
85
- str = "abc"
86
- assert_equal(str, XSD::XSDString.new(str).data)
87
- assert_equal(str, XSD::XSDString.new(str).to_s)
88
- back = XSD::XSDString.strict_ces_validation
89
- XSD::XSDString.strict_ces_validation = true
90
- begin
91
- assert_raises(XSD::ValueSpaceError) do
92
- XSD::XSDString.new("\0")
93
- end
94
- assert_raises(XSD::ValueSpaceError) do
95
- XSD::XSDString.new("\xC0\xC0").to_s
96
- end
97
- ensure
98
- XSD::XSDString.strict_ces_validation = back
99
- end
100
- ensure
101
- XSD::Charset.module_eval { @internal_encoding = @encoding_backup }
102
- end
103
- end
104
-
105
- def test_XSDNormalizedString
106
- XSD::Charset.module_eval { @encoding_backup = @internal_encoding; @internal_encoding = "NONE" }
107
- begin
108
- o = XSD::XSDNormalizedString.new
109
- assert_equal(XSD::Namespace, o.type.namespace)
110
- assert_equal(XSD::NormalizedStringLiteral, o.type.name)
111
- assert_equal(nil, o.data)
112
- assert_equal(true, o.is_nil)
113
-
114
- str = "abc"
115
- assert_equal(str, XSD::XSDNormalizedString.new(str).data)
116
- assert_equal(str, XSD::XSDNormalizedString.new(str).to_s)
117
- back = XSD::XSDString.strict_ces_validation
118
- XSD::XSDString.strict_ces_validation = true
119
- begin
120
- assert_raises(XSD::ValueSpaceError) do
121
- XSD::XSDNormalizedString.new("\0")
122
- end
123
- assert_raises(XSD::ValueSpaceError) do
124
- XSD::XSDNormalizedString.new("\xC0\xC0").to_s
125
- end
126
- assert_raises(XSD::ValueSpaceError) do
127
- XSD::XSDNormalizedString.new("a\tb").to_s
128
- end
129
- assert_raises(XSD::ValueSpaceError) do
130
- XSD::XSDNormalizedString.new("a\r").to_s
131
- end
132
- assert_raises(XSD::ValueSpaceError) do
133
- XSD::XSDNormalizedString.new("\nb").to_s
134
- end
135
- ensure
136
- XSD::XSDString.strict_ces_validation = back
137
- end
138
- ensure
139
- XSD::Charset.module_eval { @internal_encoding = @encoding_backup }
140
- end
141
- end
142
-
143
- def test_XSDToken
144
- XSD::Charset.module_eval { @encoding_backup = @internal_encoding; @internal_encoding = "NONE" }
145
- begin
146
- o = XSD::XSDToken.new
147
- assert_equal(XSD::Namespace, o.type.namespace)
148
- assert_equal(XSD::TokenLiteral, o.type.name)
149
- assert_equal(nil, o.data)
150
- assert_equal(true, o.is_nil)
151
-
152
- str = "abc"
153
- assert_equal(str, XSD::XSDToken.new(str).data)
154
- assert_equal(str, XSD::XSDToken.new(str).to_s)
155
- back = XSD::XSDString.strict_ces_validation
156
- XSD::XSDString.strict_ces_validation = true
157
- begin
158
- assert_raises(XSD::ValueSpaceError) do
159
- XSD::XSDToken.new("\0")
160
- end
161
- assert_raises(XSD::ValueSpaceError) do
162
- XSD::XSDToken.new("\xC0\xC0").to_s
163
- end
164
- assert_raises(XSD::ValueSpaceError) do
165
- XSD::XSDToken.new("a\tb").to_s
166
- end
167
- assert_raises(XSD::ValueSpaceError) do
168
- XSD::XSDToken.new("a\r").to_s
169
- end
170
- assert_raises(XSD::ValueSpaceError) do
171
- XSD::XSDToken.new("\nb").to_s
172
- end
173
- assert_raises(XSD::ValueSpaceError) do
174
- XSD::XSDToken.new(" a").to_s
175
- end
176
- assert_raises(XSD::ValueSpaceError) do
177
- XSD::XSDToken.new("b ").to_s
178
- end
179
- assert_raises(XSD::ValueSpaceError) do
180
- XSD::XSDToken.new("a b").to_s
181
- end
182
- assert_equal("a b", XSD::XSDToken.new("a b").data)
183
- ensure
184
- XSD::XSDString.strict_ces_validation = back
185
- end
186
- ensure
187
- XSD::Charset.module_eval { @internal_encoding = @encoding_backup }
188
- end
189
- end
190
-
191
- def test_XSDLanguage
192
- o = XSD::XSDLanguage.new
193
- assert_equal(XSD::Namespace, o.type.namespace)
194
- assert_equal(XSD::LanguageLiteral, o.type.name)
195
- assert_equal(nil, o.data)
196
- assert_equal(true, o.is_nil)
197
-
198
- str = "ja"
199
- assert_equal(str, XSD::XSDLanguage.new(str).data)
200
- assert_equal(str, XSD::XSDLanguage.new(str).to_s)
201
- str = "ja-jp"
202
- assert_equal(str, XSD::XSDLanguage.new(str).data)
203
- assert_equal(str, XSD::XSDLanguage.new(str).to_s)
204
- assert_raises(XSD::ValueSpaceError) do
205
- XSD::XSDLanguage.new("ja-jp-")
206
- end
207
- assert_raises(XSD::ValueSpaceError) do
208
- XSD::XSDLanguage.new("-ja-")
209
- end
210
- assert_raises(XSD::ValueSpaceError) do
211
- XSD::XSDLanguage.new("ja-")
212
- end
213
- assert_raises(XSD::ValueSpaceError) do
214
- XSD::XSDLanguage.new("a1-01")
215
- end
216
- assert_equal("aA-01", XSD::XSDLanguage.new("aA-01").to_s)
217
- end
218
-
219
- def test_XSDBoolean
220
- o = XSD::XSDBoolean.new
221
- assert_equal(XSD::Namespace, o.type.namespace)
222
- assert_equal(XSD::BooleanLiteral, o.type.name)
223
- assert_equal(nil, o.data)
224
- assert_equal(true, o.is_nil)
225
-
226
- targets = [
227
- ["true", true],
228
- ["1", true],
229
- ["false", false],
230
- ["0", false],
231
- ]
232
- targets.each do |data, expected|
233
- assert_equal(expected, XSD::XSDBoolean.new(data).data)
234
- assert_equal(expected.to_s, XSD::XSDBoolean.new(data).to_s)
235
- end
236
-
237
- assert_raises(XSD::ValueSpaceError) do
238
- XSD::XSDBoolean.new("nil").to_s
239
- end
240
- end
241
-
242
- def test_XSDDecimal
243
- o = XSD::XSDDecimal.new
244
- assert_equal(XSD::Namespace, o.type.namespace)
245
- assert_equal(XSD::DecimalLiteral, o.type.name)
246
- assert_equal(nil, o.data)
247
- assert_equal(true, o.is_nil)
248
-
249
- targets = [
250
- 0,
251
- 1000000000,
252
- -9999999999,
253
- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
254
- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
255
- -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
256
- ]
257
- targets.each do |dec|
258
- assert_equal(dec.to_s, XSD::XSDDecimal.new(dec).data)
259
- end
260
-
261
- targets = [
262
- "0",
263
- "0.00000001",
264
- "1000000000",
265
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
266
- "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123.45678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
267
- ]
268
- targets.each do |str|
269
- assert_equal(str, XSD::XSDDecimal.new(str).to_s)
270
- end
271
-
272
- targets = [
273
- ["-0", "0"],
274
- ["+0", "0"],
275
- ["0.0", "0"],
276
- ["-0.0", "0"],
277
- ["+0.0", "0"],
278
- ["0.", "0"],
279
- [".0", "0"],
280
- [
281
- "+0.12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
282
- "0.1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
283
- ],
284
- [
285
- ".0000012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
286
- "0.000001234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
287
- ],
288
- [
289
- "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.",
290
- "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
291
- ],
292
- ]
293
- targets.each do |data, expected|
294
- assert_equal(expected, XSD::XSDDecimal.new(data).to_s)
295
- end
296
-
297
- targets = [
298
- "0.000000000000a",
299
- "00a.0000000000001",
300
- "+-5",
301
- ]
302
- targets.each do |d|
303
- assert_raises(XSD::ValueSpaceError) do
304
- XSD::XSDDecimal.new(d)
305
- end
306
- end
307
- end
308
-
309
- def test_XSDFloat
310
- o = XSD::XSDFloat.new
311
- assert_equal(XSD::Namespace, o.type.namespace)
312
- assert_equal(XSD::FloatLiteral, o.type.name)
313
- assert_equal(nil, o.data)
314
- assert_equal(true, o.is_nil)
315
-
316
- targets = [
317
- 3.14159265358979,
318
- 12.34e36,
319
- 1.402e-45,
320
- -1.402e-45,
321
- ]
322
- targets.each do |f|
323
- assert_equal(f, XSD::XSDFloat.new(f).data)
324
- end
325
-
326
- targets = [
327
- "+3.141592654",
328
- "+1.234e+37",
329
- "+1.402e-45",
330
- "-1.402e-45",
331
- ]
332
- targets.each do |f|
333
- assert_equal(f, XSD::XSDFloat.new(f).to_s)
334
- end
335
-
336
- targets = [
337
- [3, "+3"], # should be 3.0?
338
- [-2, "-2"], # ditto
339
- [3.14159265358979, "+3.141592654"],
340
- [12.34e36, "+1.234e+37"],
341
- [1.402e-45, "+1.402e-45"],
342
- [-1.402e-45, "-1.402e-45"],
343
- ["1.402e", "+1.402"],
344
- ["12.34E36", "+1.234e+37"],
345
- ["1.402E-45", "+1.402e-45"],
346
- ["-1.402E-45", "-1.402e-45"],
347
- ["1.402E", "+1.402"],
348
- ]
349
- targets.each do |f, str|
350
- assert_equal(str, XSD::XSDFloat.new(f).to_s)
351
- end
352
-
353
- assert_equal("+0", XSD::XSDFloat.new(+0.0).to_s)
354
- assert_equal("-0", XSD::XSDFloat.new(NegativeZero).to_s)
355
- assert(XSD::XSDFloat.new(0.0/0.0).data.nan?)
356
- assert_equal("INF", XSD::XSDFloat.new(1.0/0.0).to_s)
357
- assert_equal(1, XSD::XSDFloat.new(1.0/0.0).data.infinite?)
358
- assert_equal("-INF", XSD::XSDFloat.new(-1.0/0.0).to_s)
359
- assert_equal(-1, XSD::XSDFloat.new(-1.0/0.0).data.infinite?)
360
-
361
- targets = [
362
- "0.000000000000a",
363
- "00a.0000000000001",
364
- "+-5",
365
- "5_0",
366
- ]
367
- targets.each do |d|
368
- assert_raises(XSD::ValueSpaceError) do
369
- XSD::XSDFloat.new(d)
370
- end
371
- end
372
- end
373
-
374
- def test_XSDDouble
375
- o = XSD::XSDDouble.new
376
- assert_equal(XSD::Namespace, o.type.namespace)
377
- assert_equal(XSD::DoubleLiteral, o.type.name)
378
- assert_equal(nil, o.data)
379
- assert_equal(true, o.is_nil)
380
-
381
- targets = [
382
- 3.14159265358979,
383
- 12.34e36,
384
- 1.402e-45,
385
- -1.402e-45,
386
- ]
387
- targets.each do |f|
388
- assert_equal(f, XSD::XSDDouble.new(f).data)
389
- end
390
-
391
- targets = [
392
- "+3.14159265358979",
393
- "+1.234e+37",
394
- "+1.402e-45",
395
- "-1.402e-45",
396
- ]
397
- targets.each do |f|
398
- assert_equal(f, XSD::XSDDouble.new(f).to_s)
399
- end
400
-
401
- targets = [
402
- [3, "+3"], # should be 3.0?
403
- [-2, "-2"], # ditto.
404
- [3.14159265358979, "+3.14159265358979"],
405
- [12.34e36, "+1.234e+37"],
406
- [1.402e-45, "+1.402e-45"],
407
- [-1.402e-45, "-1.402e-45"],
408
- ["1.402e", "+1.402"],
409
- ["12.34E36", "+1.234e+37"],
410
- ["1.402E-45", "+1.402e-45"],
411
- ["-1.402E-45", "-1.402e-45"],
412
- ["1.402E", "+1.402"],
413
- ]
414
- targets.each do |f, str|
415
- assert_equal(str, XSD::XSDDouble.new(f).to_s)
416
- end
417
-
418
- assert_equal("+0", XSD::XSDFloat.new(+0.0).to_s)
419
- assert_equal("-0", XSD::XSDFloat.new(NegativeZero).to_s)
420
- assert_equal("NaN", XSD::XSDDouble.new(0.0/0.0).to_s)
421
- assert(XSD::XSDDouble.new(0.0/0.0).data.nan?)
422
- assert_equal("INF", XSD::XSDDouble.new(1.0/0.0).to_s)
423
- assert_equal(1, XSD::XSDDouble.new(1.0/0.0).data.infinite?)
424
- assert_equal("-INF", XSD::XSDDouble.new(-1.0/0.0).to_s)
425
- assert_equal(-1, XSD::XSDDouble.new(-1.0/0.0).data.infinite?)
426
-
427
- targets = [
428
- "0.000000000000a",
429
- "00a.0000000000001",
430
- "+-5",
431
- ]
432
- targets.each do |d|
433
- assert_raises(XSD::ValueSpaceError) do
434
- XSD::XSDDouble.new(d)
435
- end
436
- end
437
- end
438
-
439
- def test_XSDDuration
440
- o = XSD::XSDDuration.new
441
- assert_equal(XSD::Namespace, o.type.namespace)
442
- assert_equal(XSD::DurationLiteral, o.type.name)
443
- assert_equal(nil, o.data)
444
- assert_equal(true, o.is_nil)
445
-
446
- targets = [
447
- "P1Y2M3DT4H5M6S",
448
- "P1234Y5678M9012DT3456H7890M1234.5678S",
449
- "PT3456H7890M1234.5678S",
450
- "P1234Y5678M9012D",
451
- "-P1234Y5678M9012DT3456H7890M1234.5678S",
452
- "P5678M9012DT3456H7890M1234.5678S",
453
- "-P1234Y9012DT3456H7890M1234.5678S",
454
- "+P1234Y5678MT3456H7890M1234.5678S",
455
- "P1234Y5678M9012DT7890M1234.5678S",
456
- "-P1234Y5678M9012DT3456H1234.5678S",
457
- "+P1234Y5678M9012DT3456H7890M",
458
- "P123400000000000Y",
459
- "-P567800000000000M",
460
- "+P901200000000000D",
461
- "PT345600000000000H",
462
- "-PT789000000000000M",
463
- "+PT123400000000000.000000000005678S",
464
- "P1234YT1234.5678S",
465
- "-P5678MT7890M",
466
- "+P9012DT3456H",
467
- "PT5S",
468
- ]
469
- targets.each do |str|
470
- assert_parsed_result(XSD::XSDDuration, str)
471
- end
472
-
473
- targets = [
474
- ["P0Y0M0DT0H0M0S",
475
- "P0D"],
476
- ["-P0DT0S",
477
- "-P0D"],
478
- ["P01234Y5678M9012DT3456H7890M1234.5678S",
479
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
480
- ["P1234Y005678M9012DT3456H7890M1234.5678S",
481
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
482
- ["P1234Y5678M0009012DT3456H7890M1234.5678S",
483
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
484
- ["P1234Y5678M9012DT00003456H7890M1234.5678S",
485
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
486
- ["P1234Y5678M9012DT3456H000007890M1234.5678S",
487
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
488
- ["P1234Y5678M9012DT3456H7890M0000001234.5678S",
489
- "P1234Y5678M9012DT3456H7890M1234.5678S"],
490
- ]
491
- targets.each do |data, expected|
492
- assert_equal(expected, XSD::XSDDuration.new(data).to_s)
493
- end
494
- end
495
-
496
- def test_XSDDateTime
497
- o = XSD::XSDDateTime.new
498
- assert_equal(XSD::Namespace, o.type.namespace)
499
- assert_equal(XSD::DateTimeLiteral, o.type.name)
500
- assert_equal(nil, o.data)
501
- assert_equal(true, o.is_nil)
502
-
503
- targets = [
504
- "2002-05-18T16:52:20Z",
505
- "0001-01-01T00:00:00Z",
506
- "9999-12-31T23:59:59Z",
507
- "19999-12-31T23:59:59Z",
508
- "2002-12-31T23:59:59.999Z",
509
- "2002-12-31T23:59:59.001Z",
510
- "2002-12-31T23:59:59.99999999999999999999Z",
511
- "2002-12-31T23:59:59.00000000000000000001Z",
512
- "2002-12-31T23:59:59+09:00",
513
- "2002-12-31T23:59:59+00:01",
514
- "2002-12-31T23:59:59-00:01",
515
- "2002-12-31T23:59:59-23:59",
516
- "2002-12-31T23:59:59.00000000000000000001+13:30",
517
- "2002-12-31T23:59:59.5137Z",
518
- "2002-12-31T23:59:59.51375Z", # 411/800
519
- "2002-12-31T23:59:59.51375+12:34",
520
- "-2002-05-18T16:52:20Z",
521
- "-4713-01-01T12:00:00Z",
522
- "-2002-12-31T23:59:59+00:01",
523
- "-0001-12-31T23:59:59.00000000000000000001+13:30",
524
- ]
525
- targets.each do |str|
526
- assert_parsed_result(XSD::XSDDateTime, str)
527
- end
528
-
529
- targets = [
530
- ["2002-12-31T23:59:59.00",
531
- "2002-12-31T23:59:59Z"],
532
- ["2002-12-31T23:59:59+00:00",
533
- "2002-12-31T23:59:59Z"],
534
- ["2002-12-31T23:59:59-00:00",
535
- "2002-12-31T23:59:59Z"],
536
- ["-2002-12-31T23:59:59.00",
537
- "-2002-12-31T23:59:59Z"],
538
- ["-2002-12-31T23:59:59+00:00",
539
- "-2002-12-31T23:59:59Z"],
540
- ["-2002-12-31T23:59:59-00:00",
541
- "-2002-12-31T23:59:59Z"],
542
- ]
543
- targets.each do |data, expected|
544
- assert_equal(expected, XSD::XSDDateTime.new(data).to_s)
545
- d = DateTime.parse(data)
546
- d >>= 12 if d.year < 0 # XSDDateTime.year(-1) == DateTime.year(0)
547
- assert_equal(expected, XSD::XSDDateTime.new(d).to_s)
548
- end
549
-
550
- targets = [
551
- "0000-05-18T16:52:20Z",
552
- "05-18T16:52:20Z",
553
- "2002-05T16:52:20Z",
554
- "2002-05-18T16:52Z",
555
- "",
556
- ]
557
- targets.each do |d|
558
- assert_raises(XSD::ValueSpaceError, d.to_s) do
559
- XSD::XSDDateTime.new(d)
560
- end
561
- end
562
- end
563
-
564
- def test_XSDTime
565
- o = XSD::XSDTime.new
566
- assert_equal(XSD::Namespace, o.type.namespace)
567
- assert_equal(XSD::TimeLiteral, o.type.name)
568
- assert_equal(nil, o.data)
569
- assert_equal(true, o.is_nil)
570
-
571
- targets = [
572
- "16:52:20Z",
573
- "00:00:00Z",
574
- "23:59:59Z",
575
- "23:59:59.999Z",
576
- "23:59:59.001Z",
577
- "23:59:59.99999999999999999999Z",
578
- "23:59:59.00000000000000000001Z",
579
- "23:59:59+09:00",
580
- "23:59:59+00:01",
581
- "23:59:59-00:01",
582
- "23:59:59-23:59",
583
- "23:59:59.00000000000000000001+13:30",
584
- "23:59:59.51345Z",
585
- "23:59:59.51345+12:34",
586
- "23:59:59+00:01",
587
- ]
588
- targets.each do |str|
589
- assert_parsed_result(XSD::XSDTime, str)
590
- end
591
-
592
- targets = [
593
- ["23:59:59.00",
594
- "23:59:59Z"],
595
- ["23:59:59+00:00",
596
- "23:59:59Z"],
597
- ["23:59:59-00:00",
598
- "23:59:59Z"],
599
- ]
600
- targets.each do |data, expected|
601
- assert_equal(expected, XSD::XSDTime.new(data).to_s)
602
- end
603
- end
604
-
605
- def test_XSDDate
606
- o = XSD::XSDDate.new
607
- assert_equal(XSD::Namespace, o.type.namespace)
608
- assert_equal(XSD::DateLiteral, o.type.name)
609
- assert_equal(nil, o.data)
610
- assert_equal(true, o.is_nil)
611
-
612
- targets = [
613
- "2002-05-18Z",
614
- "0001-01-01Z",
615
- "9999-12-31Z",
616
- "19999-12-31Z",
617
- "2002-12-31+09:00",
618
- "2002-12-31+00:01",
619
- "2002-12-31-00:01",
620
- "2002-12-31-23:59",
621
- "2002-12-31+13:30",
622
- "-2002-05-18Z",
623
- "-19999-12-31Z",
624
- "-2002-12-31+00:01",
625
- "-0001-12-31+13:30",
626
- ]
627
- targets.each do |str|
628
- assert_parsed_result(XSD::XSDDate, str)
629
- end
630
-
631
- targets = [
632
- ["2002-12-31",
633
- "2002-12-31Z"],
634
- ["2002-12-31+00:00",
635
- "2002-12-31Z"],
636
- ["2002-12-31-00:00",
637
- "2002-12-31Z"],
638
- ["-2002-12-31",
639
- "-2002-12-31Z"],
640
- ["-2002-12-31+00:00",
641
- "-2002-12-31Z"],
642
- ["-2002-12-31-00:00",
643
- "-2002-12-31Z"],
644
- ]
645
- targets.each do |data, expected|
646
- assert_equal(expected, XSD::XSDDate.new(data).to_s)
647
- d = Date.parse(data)
648
- d >>= 12 if d.year < 0 # XSDDate.year(-1) == Date.year(0)
649
- assert_equal(expected, XSD::XSDDate.new(d).to_s)
650
- end
651
- end
652
- end
653
-
654
- class TestXSD2 < Test::Unit::TestCase
655
- def setup
656
- # Nothing to do.
657
- end
658
-
659
- def teardown
660
- # Nothing to do.
661
- end
662
-
663
- def assert_parsed_result(klass, str)
664
- o = klass.new(str)
665
- assert_equal(str, o.to_s)
666
- end
667
-
668
- def test_XSDGYearMonth
669
- o = XSD::XSDGYearMonth.new
670
- assert_equal(XSD::Namespace, o.type.namespace)
671
- assert_equal(XSD::GYearMonthLiteral, o.type.name)
672
- assert_equal(nil, o.data)
673
- assert_equal(true, o.is_nil)
674
-
675
- targets = [
676
- "2002-05Z",
677
- "0001-01Z",
678
- "9999-12Z",
679
- "19999-12Z",
680
- "2002-12+09:00",
681
- "2002-12+00:01",
682
- "2002-12-00:01",
683
- "2002-12-23:59",
684
- "2002-12+13:30",
685
- "-2002-05Z",
686
- "-19999-12Z",
687
- "-2002-12+00:01",
688
- "-0001-12+13:30",
689
- ]
690
- targets.each do |str|
691
- assert_parsed_result(XSD::XSDGYearMonth, str)
692
- end
693
-
694
- targets = [
695
- ["2002-12",
696
- "2002-12Z"],
697
- ["2002-12+00:00",
698
- "2002-12Z"],
699
- ["2002-12-00:00",
700
- "2002-12Z"],
701
- ["-2002-12",
702
- "-2002-12Z"],
703
- ["-2002-12+00:00",
704
- "-2002-12Z"],
705
- ["-2002-12-00:00",
706
- "-2002-12Z"],
707
- ]
708
- targets.each do |data, expected|
709
- assert_equal(expected, XSD::XSDGYearMonth.new(data).to_s)
710
- end
711
- end
712
-
713
- def test_XSDGYear
714
- o = XSD::XSDGYear.new
715
- assert_equal(XSD::Namespace, o.type.namespace)
716
- assert_equal(XSD::GYearLiteral, o.type.name)
717
- assert_equal(nil, o.data)
718
- assert_equal(true, o.is_nil)
719
-
720
- targets = [
721
- "2002Z",
722
- "0001Z",
723
- "9999Z",
724
- "19999Z",
725
- "2002+09:00",
726
- "2002+00:01",
727
- "2002-00:01",
728
- "2002-23:59",
729
- "2002+13:30",
730
- "-2002Z",
731
- "-19999Z",
732
- "-2002+00:01",
733
- "-0001+13:30",
734
- ]
735
- targets.each do |str|
736
- assert_parsed_result(XSD::XSDGYear, str)
737
- end
738
-
739
- targets = [
740
- ["2002",
741
- "2002Z"],
742
- ["2002+00:00",
743
- "2002Z"],
744
- ["2002-00:00",
745
- "2002Z"],
746
- ["-2002",
747
- "-2002Z"],
748
- ["-2002+00:00",
749
- "-2002Z"],
750
- ["-2002-00:00",
751
- "-2002Z"],
752
- ]
753
- targets.each do |data, expected|
754
- assert_equal(expected, XSD::XSDGYear.new(data).to_s)
755
- end
756
- end
757
-
758
- def test_XSDGMonthDay
759
- o = XSD::XSDGMonthDay.new
760
- assert_equal(XSD::Namespace, o.type.namespace)
761
- assert_equal(XSD::GMonthDayLiteral, o.type.name)
762
- assert_equal(nil, o.data)
763
- assert_equal(true, o.is_nil)
764
-
765
- targets = [
766
- "--05-18Z",
767
- "--01-01Z",
768
- "--12-31Z",
769
- "--12-31+09:00",
770
- "--12-31+00:01",
771
- "--12-31-00:01",
772
- "--12-31-23:59",
773
- "--12-31+13:30",
774
- ]
775
- targets.each do |str|
776
- assert_parsed_result(XSD::XSDGMonthDay, str)
777
- end
778
-
779
- targets = [
780
- ["--12-31",
781
- "--12-31Z"],
782
- ["--12-31+00:00",
783
- "--12-31Z"],
784
- ["--12-31-00:00",
785
- "--12-31Z"],
786
- ]
787
- targets.each do |data, expected|
788
- assert_equal(expected, XSD::XSDGMonthDay.new(data).to_s)
789
- end
790
- end
791
-
792
- def test_XSDGDay
793
- o = XSD::XSDGDay.new
794
- assert_equal(XSD::Namespace, o.type.namespace)
795
- assert_equal(XSD::GDayLiteral, o.type.name)
796
- assert_equal(nil, o.data)
797
- assert_equal(true, o.is_nil)
798
-
799
- targets = [
800
- "---18Z",
801
- "---01Z",
802
- "---31Z",
803
- "---31+09:00",
804
- "---31+00:01",
805
- "---31-00:01",
806
- "---31-23:59",
807
- "---31+13:30",
808
- ]
809
- targets.each do |str|
810
- assert_parsed_result(XSD::XSDGDay, str)
811
- end
812
-
813
- targets = [
814
- ["---31",
815
- "---31Z"],
816
- ["---31+00:00",
817
- "---31Z"],
818
- ["---31-00:00",
819
- "---31Z"],
820
- ]
821
- targets.each do |data, expected|
822
- assert_equal(expected, XSD::XSDGDay.new(data).to_s)
823
- end
824
- end
825
-
826
- def test_XSDGMonth
827
- o = XSD::XSDGMonth.new
828
- assert_equal(XSD::Namespace, o.type.namespace)
829
- assert_equal(XSD::GMonthLiteral, o.type.name)
830
- assert_equal(nil, o.data)
831
- assert_equal(true, o.is_nil)
832
-
833
- targets = [
834
- "--05Z",
835
- "--01Z",
836
- "--12Z",
837
- "--12+09:00",
838
- "--12+00:01",
839
- "--12-00:01",
840
- "--12-23:59",
841
- "--12+13:30",
842
- ]
843
- targets.each do |str|
844
- assert_parsed_result(XSD::XSDGMonth, str)
845
- end
846
-
847
- targets = [
848
- ["--12",
849
- "--12Z"],
850
- ["--12+00:00",
851
- "--12Z"],
852
- ["--12-00:00",
853
- "--12Z"],
854
- ]
855
- targets.each do |data, expected|
856
- assert_equal(expected, XSD::XSDGMonth.new(data).to_s)
857
- end
858
- end
859
-
860
- def test_XSDHexBinary
861
- o = XSD::XSDHexBinary.new
862
- assert_equal(XSD::Namespace, o.type.namespace)
863
- assert_equal(XSD::HexBinaryLiteral, o.type.name)
864
- assert_equal(nil, o.data)
865
- assert_equal(true, o.is_nil)
866
-
867
- targets = [
868
- "abcdef",
869
- "\xe3\x81\xaa\xe3\x81\xb2",
870
- %Q(\0),
871
- "",
872
- ]
873
- targets.each do |str|
874
- assert_equal(str, XSD::XSDHexBinary.new(str).string)
875
- assert_equal(str.unpack("H*")[0 ].tr('a-f', 'A-F'),
876
- XSD::XSDHexBinary.new(str).data)
877
- o = XSD::XSDHexBinary.new
878
- o.set_encoded(str.unpack("H*")[0 ].tr('a-f', 'A-F'))
879
- assert_equal(str, o.string)
880
- o.set_encoded(str.unpack("H*")[0 ].tr('A-F', 'a-f'))
881
- assert_equal(str, o.string)
882
- end
883
-
884
- targets = [
885
- "0FG7",
886
- "0fg7",
887
- ]
888
- targets.each do |d|
889
- assert_raises(XSD::ValueSpaceError, d.to_s) do
890
- o = XSD::XSDHexBinary.new
891
- o.set_encoded(d)
892
- p o.string
893
- end
894
- end
895
- end
896
-
897
- def test_XSDBase64Binary
898
- o = XSD::XSDBase64Binary.new
899
- assert_equal(XSD::Namespace, o.type.namespace)
900
- assert_equal(XSD::Base64BinaryLiteral, o.type.name)
901
- assert_equal(nil, o.data)
902
- assert_equal(true, o.is_nil)
903
-
904
- targets = [
905
- "abcdef",
906
- "\xe3\x81\xaa\xe3\x81\xb2",
907
- %Q(\0),
908
- "",
909
- ]
910
- targets.each do |str|
911
- assert_equal(str, XSD::XSDBase64Binary.new(str).string)
912
- assert_equal([str ].pack("m").chomp, XSD::XSDBase64Binary.new(str).data)
913
- o = XSD::XSDBase64Binary.new
914
- o.set_encoded([str ].pack("m").chomp)
915
- assert_equal(str, o.string)
916
- end
917
-
918
- targets = [
919
- "-",
920
- "*",
921
- ]
922
- targets.each do |d|
923
- assert_raises(XSD::ValueSpaceError, d.to_s) do
924
- o = XSD::XSDBase64Binary.new
925
- o.set_encoded(d)
926
- p o.string
927
- end
928
- end
929
- end
930
-
931
- def test_XSDAnyURI
932
- o = XSD::XSDAnyURI.new
933
- assert_equal(XSD::Namespace, o.type.namespace)
934
- assert_equal(XSD::AnyURILiteral, o.type.name)
935
- assert_equal(nil, o.data)
936
- assert_equal(true, o.is_nil)
937
-
938
- # Too few tests here I know. Believe uri module. :)
939
- targets = [
940
- "foo",
941
- "http://foo",
942
- "http://foo/bar/baz",
943
- "http://foo/bar#baz",
944
- "http://foo/bar%20%20?a+b",
945
- "HTTP://FOO/BAR%20%20?A+B",
946
- ]
947
- targets.each do |str|
948
- assert_parsed_result(XSD::XSDAnyURI, str)
949
- end
950
- end
951
-
952
- def test_XSDQName
953
- o = XSD::XSDQName.new
954
- assert_equal(XSD::Namespace, o.type.namespace)
955
- assert_equal(XSD::QNameLiteral, o.type.name)
956
- assert_equal(nil, o.data)
957
- assert_equal(true, o.is_nil)
958
-
959
- # More strict test is needed but current implementation allows all non-':'
960
- # chars like ' ', C0 or C1...
961
- targets = [
962
- "foo",
963
- "foo:bar",
964
- "a:b",
965
- ]
966
- targets.each do |str|
967
- assert_parsed_result(XSD::XSDQName, str)
968
- end
969
- end
970
-
971
-
972
- ###
973
- ## Derived types
974
- #
975
-
976
- def test_XSDInteger
977
- o = XSD::XSDInteger.new
978
- assert_equal(XSD::Namespace, o.type.namespace)
979
- assert_equal(XSD::IntegerLiteral, o.type.name)
980
- assert_equal(nil, o.data)
981
- assert_equal(true, o.is_nil)
982
-
983
- targets = [
984
- 0,
985
- 1000000000,
986
- -9999999999,
987
- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
988
- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
989
- -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
990
- ]
991
- targets.each do |int|
992
- assert_equal(int, XSD::XSDInteger.new(int).data)
993
- end
994
-
995
- targets = [
996
- "0",
997
- "1000000000",
998
- "-9999999999",
999
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
1000
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
1001
- "-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
1002
- ]
1003
- targets.each do |str|
1004
- assert_equal(str, XSD::XSDInteger.new(str).to_s)
1005
- end
1006
-
1007
- targets = [
1008
- ["-0", "0"],
1009
- ["+0", "0"],
1010
- ["000123", "123"],
1011
- ["-000123", "-123"],
1012
- [
1013
- "+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
1014
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
1015
- ],
1016
- ]
1017
- targets.each do |data, expected|
1018
- assert_equal(expected, XSD::XSDInteger.new(data).to_s)
1019
- end
1020
-
1021
- targets = [
1022
- "0.0",
1023
- "-5.2",
1024
- "0.000000000000a",
1025
- "+-5",
1026
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
1027
- ]
1028
- targets.each do |d|
1029
- assert_raises(XSD::ValueSpaceError) do
1030
- XSD::XSDInteger.new(d)
1031
- end
1032
- end
1033
- end
1034
-
1035
- def test_XSDNonPositiveInteger
1036
- o = XSD::XSDNonPositiveInteger.new
1037
- assert_equal(XSD::Namespace, o.type.namespace)
1038
- assert_equal(XSD::NonPositiveIntegerLiteral, o.type.name)
1039
- assert_equal(nil, o.data)
1040
- assert_equal(true, o.is_nil)
1041
-
1042
- targets = [
1043
- 0,
1044
- -9999999999,
1045
- -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
1046
- ]
1047
- targets.each do |int|
1048
- assert_equal(int, XSD::XSDNonPositiveInteger.new(int).data)
1049
- end
1050
-
1051
- targets = [
1052
- "0",
1053
- "-9999999999",
1054
- "-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
1055
- ]
1056
- targets.each do |str|
1057
- assert_equal(str, XSD::XSDNonPositiveInteger.new(str).to_s)
1058
- end
1059
-
1060
- targets = [
1061
- ["-0", "0"],
1062
- ["-000123", "-123"],
1063
- ]
1064
- targets.each do |data, expected|
1065
- assert_equal(expected, XSD::XSDNonPositiveInteger.new(data).to_s)
1066
- end
1067
-
1068
- targets = [
1069
- "0.0",
1070
- "-5.2",
1071
- "0.000000000000a",
1072
- "+-5",
1073
- "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
1074
- ]
1075
- targets.each do |d|
1076
- assert_raises(XSD::ValueSpaceError) do
1077
- XSD::XSDNonPositiveInteger.new(d)
1078
- end
1079
- end
1080
- end
1081
-
1082
- def test_XSDNegativeInteger
1083
- o = XSD::XSDNegativeInteger.new
1084
- assert_equal(XSD::Namespace, o.type.namespace)
1085
- assert_equal(XSD::NegativeIntegerLiteral, o.type.name)
1086
- assert_equal(nil, o.data)
1087
- assert_equal(true, o.is_nil)
1088
-
1089
- targets = [
1090
- -1,
1091
- -9999999999,
1092
- -1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789,
1093
- ]
1094
- targets.each do |int|
1095
- assert_equal(int, XSD::XSDNegativeInteger.new(int).data)
1096
- end
1097
-
1098
- targets = [
1099
- "-1",
1100
- "-9999999999",
1101
- "-1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789",
1102
- ]
1103
- targets.each do |str|
1104
- assert_equal(str, XSD::XSDNegativeInteger.new(str).to_s)
1105
- end
1106
-
1107
- targets = [
1108
- ["-000123", "-123"],
1109
- ]
1110
- targets.each do |data, expected|
1111
- assert_equal(expected, XSD::XSDNegativeInteger.new(data).to_s)
1112
- end
1113
-
1114
- targets = [
1115
- "-0.0",
1116
- "-5.2",
1117
- "-0.000000000000a",
1118
- "+-5",
1119
- "-12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
1120
- ]
1121
- targets.each do |d|
1122
- assert_raises(XSD::ValueSpaceError) do
1123
- XSD::XSDNegativeInteger.new(d)
1124
- end
1125
- end
1126
- end
1127
-
1128
- def test_XSDLong
1129
- o = XSD::XSDLong.new
1130
- assert_equal(XSD::Namespace, o.type.namespace)
1131
- assert_equal(XSD::LongLiteral, o.type.name)
1132
- assert_equal(nil, o.data)
1133
- assert_equal(true, o.is_nil)
1134
-
1135
- targets = [
1136
- 0,
1137
- 123,
1138
- -123,
1139
- 9223372036854775807,
1140
- -9223372036854775808,
1141
- ]
1142
- targets.each do |lng|
1143
- assert_equal(lng, XSD::XSDLong.new(lng).data)
1144
- end
1145
-
1146
- targets = [
1147
- "0",
1148
- "123",
1149
- "-123",
1150
- "9223372036854775807",
1151
- "-9223372036854775808",
1152
- ]
1153
- targets.each do |str|
1154
- assert_equal(str, XSD::XSDLong.new(str).to_s)
1155
- end
1156
-
1157
- targets = [
1158
- ["-0", "0"],
1159
- ["+0", "0"],
1160
- ["000123", "123"],
1161
- ["-000123", "-123"],
1162
- ]
1163
- targets.each do |data, expected|
1164
- assert_equal(expected, XSD::XSDLong.new(data).to_s)
1165
- end
1166
-
1167
- targets = [
1168
- 9223372036854775808,
1169
- -9223372036854775809,
1170
- "0.0",
1171
- "-5.2",
1172
- "0.000000000000a",
1173
- "+-5",
1174
- ]
1175
- targets.each do |d|
1176
- assert_raises(XSD::ValueSpaceError) do
1177
- XSD::XSDLong.new(d)
1178
- end
1179
- end
1180
- end
1181
-
1182
- def test_XSDInt
1183
- o = XSD::XSDInt.new
1184
- assert_equal(XSD::Namespace, o.type.namespace)
1185
- assert_equal(XSD::IntLiteral, o.type.name)
1186
- assert_equal(nil, o.data)
1187
- assert_equal(true, o.is_nil)
1188
-
1189
- targets = [
1190
- 0,
1191
- 123,
1192
- -123,
1193
- 2147483647,
1194
- -2147483648,
1195
- ]
1196
- targets.each do |lng|
1197
- assert_equal(lng, XSD::XSDInt.new(lng).data)
1198
- end
1199
-
1200
- targets = [
1201
- "0",
1202
- "123",
1203
- "-123",
1204
- "2147483647",
1205
- "-2147483648",
1206
- ]
1207
- targets.each do |str|
1208
- assert_equal(str, XSD::XSDInt.new(str).to_s)
1209
- end
1210
-
1211
- targets = [
1212
- ["-0", "0"],
1213
- ["+0", "0"],
1214
- ["000123", "123"],
1215
- ["-000123", "-123"],
1216
- ]
1217
- targets.each do |data, expected|
1218
- assert_equal(expected, XSD::XSDInt.new(data).to_s)
1219
- end
1220
-
1221
- targets = [
1222
- 2147483648,
1223
- -2147483649,
1224
- "0.0",
1225
- "-5.2",
1226
- "0.000000000000a",
1227
- "+-5",
1228
- ]
1229
- targets.each do |d|
1230
- assert_raises(XSD::ValueSpaceError) do
1231
- XSD::XSDInt.new(d)
1232
- end
1233
- end
1234
- end
1235
-
1236
- def test_XSDShort
1237
- o = XSD::XSDShort.new
1238
- assert_equal(XSD::Namespace, o.type.namespace)
1239
- assert_equal(XSD::ShortLiteral, o.type.name)
1240
- assert_equal(nil, o.data)
1241
- assert_equal(true, o.is_nil)
1242
-
1243
- targets = [
1244
- 0,
1245
- 123,
1246
- -123,
1247
- 32767,
1248
- -32768,
1249
- ]
1250
- targets.each do |lng|
1251
- assert_equal(lng, XSD::XSDShort.new(lng).data)
1252
- end
1253
-
1254
- targets = [
1255
- "0",
1256
- "123",
1257
- "-123",
1258
- "32767",
1259
- "-32768",
1260
- ]
1261
- targets.each do |str|
1262
- assert_equal(str, XSD::XSDShort.new(str).to_s)
1263
- end
1264
-
1265
- targets = [
1266
- ["-0", "0"],
1267
- ["+0", "0"],
1268
- ["000123", "123"],
1269
- ["-000123", "-123"],
1270
- ]
1271
- targets.each do |data, expected|
1272
- assert_equal(expected, XSD::XSDShort.new(data).to_s)
1273
- end
1274
-
1275
- targets = [
1276
- 32768,
1277
- -32769,
1278
- "0.0",
1279
- "-5.2",
1280
- "0.000000000000a",
1281
- "+-5",
1282
- ]
1283
- targets.each do |d|
1284
- assert_raises(XSD::ValueSpaceError) do
1285
- XSD::XSDShort.new(d)
1286
- end
1287
- end
1288
- end
1289
-
1290
- def test_XSDByte
1291
- o = XSD::XSDByte.new
1292
- assert_equal(XSD::Namespace, o.type.namespace)
1293
- assert_equal(XSD::ByteLiteral, o.type.name)
1294
- assert_equal(nil, o.data)
1295
- assert_equal(true, o.is_nil)
1296
-
1297
- targets = [
1298
- 0,
1299
- 123,
1300
- -123,
1301
- 127,
1302
- -128,
1303
- ]
1304
- targets.each do |lng|
1305
- assert_equal(lng, XSD::XSDByte.new(lng).data)
1306
- end
1307
-
1308
- targets = [
1309
- "0",
1310
- "123",
1311
- "-123",
1312
- "127",
1313
- "-128",
1314
- ]
1315
- targets.each do |str|
1316
- assert_equal(str, XSD::XSDByte.new(str).to_s)
1317
- end
1318
-
1319
- targets = [
1320
- ["-0", "0"],
1321
- ["+0", "0"],
1322
- ["000123", "123"],
1323
- ["-000123", "-123"],
1324
- ]
1325
- targets.each do |data, expected|
1326
- assert_equal(expected, XSD::XSDByte.new(data).to_s)
1327
- end
1328
-
1329
- targets = [
1330
- 128,
1331
- -129,
1332
- "0.0",
1333
- "-5.2",
1334
- "0.000000000000a",
1335
- "+-5",
1336
- ]
1337
- targets.each do |d|
1338
- assert_raises(XSD::ValueSpaceError) do
1339
- XSD::XSDByte.new(d)
1340
- end
1341
- end
1342
- end
1343
-
1344
- def test_XSDNonNegativeInteger
1345
- o = XSD::XSDNonNegativeInteger.new
1346
- assert_equal(XSD::Namespace, o.type.namespace)
1347
- assert_equal(XSD::NonNegativeIntegerLiteral, o.type.name)
1348
- assert_equal(nil, o.data)
1349
- assert_equal(true, o.is_nil)
1350
-
1351
- targets = [
1352
- 0,
1353
- 1000000000,
1354
- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
1355
- ]
1356
- targets.each do |int|
1357
- assert_equal(int, XSD::XSDNonNegativeInteger.new(int).data)
1358
- end
1359
-
1360
- targets = [
1361
- "0",
1362
- "1000000000",
1363
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
1364
- ]
1365
- targets.each do |str|
1366
- assert_equal(str, XSD::XSDNonNegativeInteger.new(str).to_s)
1367
- end
1368
-
1369
- targets = [
1370
- ["-0", "0"],
1371
- ["+0", "0"],
1372
- ["000123", "123"],
1373
- [
1374
- "+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
1375
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
1376
- ],
1377
- ]
1378
- targets.each do |data, expected|
1379
- assert_equal(expected, XSD::XSDNonNegativeInteger.new(data).to_s)
1380
- end
1381
-
1382
- targets = [
1383
- "0.0",
1384
- "0.000000000000a",
1385
- "+-5",
1386
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
1387
- ]
1388
- targets.each do |d|
1389
- assert_raises(XSD::ValueSpaceError) do
1390
- XSD::XSDNonNegativeInteger.new(d)
1391
- end
1392
- end
1393
- end
1394
-
1395
- def test_XSDUnsignedLong
1396
- o = XSD::XSDUnsignedLong.new
1397
- assert_equal(XSD::Namespace, o.type.namespace)
1398
- assert_equal(XSD::UnsignedLongLiteral, o.type.name)
1399
- assert_equal(nil, o.data)
1400
- assert_equal(true, o.is_nil)
1401
-
1402
- targets = [
1403
- 0,
1404
- 1000000000,
1405
- 18446744073709551615,
1406
- ]
1407
- targets.each do |int|
1408
- assert_equal(int, XSD::XSDUnsignedLong.new(int).data)
1409
- end
1410
-
1411
- targets = [
1412
- "0",
1413
- "1000000000",
1414
- "18446744073709551615",
1415
- ]
1416
- targets.each do |str|
1417
- assert_equal(str, XSD::XSDUnsignedLong.new(str).to_s)
1418
- end
1419
-
1420
- targets = [
1421
- ["-0", "0"],
1422
- ["+0", "0"],
1423
- ["000123", "123"],
1424
- ["+18446744073709551615", "18446744073709551615"],
1425
- ]
1426
- targets.each do |data, expected|
1427
- assert_equal(expected, XSD::XSDUnsignedLong.new(data).to_s)
1428
- end
1429
-
1430
- targets = [
1431
- "0.0",
1432
- "0.000000000000a",
1433
- "+-5",
1434
- "18446744073709551615."
1435
- ]
1436
- targets.each do |d|
1437
- assert_raises(XSD::ValueSpaceError) do
1438
- XSD::XSDUnsignedLong.new(d)
1439
- end
1440
- end
1441
- end
1442
-
1443
- def test_XSDUnsignedInt
1444
- o = XSD::XSDUnsignedInt.new
1445
- assert_equal(XSD::Namespace, o.type.namespace)
1446
- assert_equal(XSD::UnsignedIntLiteral, o.type.name)
1447
- assert_equal(nil, o.data)
1448
- assert_equal(true, o.is_nil)
1449
-
1450
- targets = [
1451
- 0,
1452
- 1000000000,
1453
- 4294967295,
1454
- ]
1455
- targets.each do |int|
1456
- assert_equal(int, XSD::XSDUnsignedInt.new(int).data)
1457
- end
1458
-
1459
- targets = [
1460
- "0",
1461
- "1000000000",
1462
- "4294967295",
1463
- ]
1464
- targets.each do |str|
1465
- assert_equal(str, XSD::XSDUnsignedInt.new(str).to_s)
1466
- end
1467
-
1468
- targets = [
1469
- ["-0", "0"],
1470
- ["+0", "0"],
1471
- ["000123", "123"],
1472
- ["+4294967295", "4294967295"],
1473
- ]
1474
- targets.each do |data, expected|
1475
- assert_equal(expected, XSD::XSDUnsignedInt.new(data).to_s)
1476
- end
1477
-
1478
- targets = [
1479
- "0.0",
1480
- "0.000000000000a",
1481
- "+-5",
1482
- "4294967295."
1483
- ]
1484
- targets.each do |d|
1485
- assert_raises(XSD::ValueSpaceError) do
1486
- XSD::XSDUnsignedInt.new(d)
1487
- end
1488
- end
1489
- end
1490
-
1491
- def test_XSDUnsignedShort
1492
- o = XSD::XSDUnsignedShort.new
1493
- assert_equal(XSD::Namespace, o.type.namespace)
1494
- assert_equal(XSD::UnsignedShortLiteral, o.type.name)
1495
- assert_equal(nil, o.data)
1496
- assert_equal(true, o.is_nil)
1497
-
1498
- targets = [
1499
- 0,
1500
- 10000,
1501
- 65535,
1502
- ]
1503
- targets.each do |int|
1504
- assert_equal(int, XSD::XSDUnsignedShort.new(int).data)
1505
- end
1506
-
1507
- targets = [
1508
- "0",
1509
- "1000",
1510
- "65535",
1511
- ]
1512
- targets.each do |str|
1513
- assert_equal(str, XSD::XSDUnsignedShort.new(str).to_s)
1514
- end
1515
-
1516
- targets = [
1517
- ["-0", "0"],
1518
- ["+0", "0"],
1519
- ["000123", "123"],
1520
- ["+65535", "65535"],
1521
- ]
1522
- targets.each do |data, expected|
1523
- assert_equal(expected, XSD::XSDUnsignedShort.new(data).to_s)
1524
- end
1525
-
1526
- targets = [
1527
- "0.0",
1528
- "0.000000000000a",
1529
- "+-5",
1530
- "65535."
1531
- ]
1532
- targets.each do |d|
1533
- assert_raises(XSD::ValueSpaceError) do
1534
- XSD::XSDUnsignedShort.new(d)
1535
- end
1536
- end
1537
- end
1538
-
1539
- def test_XSDUnsignedByte
1540
- o = XSD::XSDUnsignedByte.new
1541
- assert_equal(XSD::Namespace, o.type.namespace)
1542
- assert_equal(XSD::UnsignedByteLiteral, o.type.name)
1543
- assert_equal(nil, o.data)
1544
- assert_equal(true, o.is_nil)
1545
-
1546
- targets = [
1547
- 0,
1548
- 10,
1549
- 255,
1550
- ]
1551
- targets.each do |int|
1552
- assert_equal(int, XSD::XSDUnsignedByte.new(int).data)
1553
- end
1554
-
1555
- targets = [
1556
- "0",
1557
- "10",
1558
- "255",
1559
- ]
1560
- targets.each do |str|
1561
- assert_equal(str, XSD::XSDUnsignedByte.new(str).to_s)
1562
- end
1563
-
1564
- targets = [
1565
- ["-0", "0"],
1566
- ["+0", "0"],
1567
- ["000123", "123"],
1568
- ["+255", "255"],
1569
- ]
1570
- targets.each do |data, expected|
1571
- assert_equal(expected, XSD::XSDUnsignedByte.new(data).to_s)
1572
- end
1573
-
1574
- targets = [
1575
- "0.0",
1576
- "0.000000000000a",
1577
- "+-5",
1578
- "255."
1579
- ]
1580
- targets.each do |d|
1581
- assert_raises(XSD::ValueSpaceError) do
1582
- XSD::XSDUnsignedByte.new(d)
1583
- end
1584
- end
1585
- end
1586
-
1587
- def test_XSDPositiveInteger
1588
- o = XSD::XSDPositiveInteger.new
1589
- assert_equal(XSD::Namespace, o.type.namespace)
1590
- assert_equal(XSD::PositiveIntegerLiteral, o.type.name)
1591
- assert_equal(nil, o.data)
1592
- assert_equal(true, o.is_nil)
1593
-
1594
- targets = [
1595
- 1,
1596
- 1000000000,
1597
- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890,
1598
- ]
1599
- targets.each do |int|
1600
- assert_equal(int, XSD::XSDPositiveInteger.new(int).data)
1601
- end
1602
-
1603
- targets = [
1604
- "1",
1605
- "1000000000",
1606
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
1607
- ]
1608
- targets.each do |str|
1609
- assert_equal(str, XSD::XSDPositiveInteger.new(str).to_s)
1610
- end
1611
-
1612
- targets = [
1613
- ["+1", "1"],
1614
- ["000123", "123"],
1615
- [
1616
- "+12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890",
1617
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
1618
- ],
1619
- ]
1620
- targets.each do |data, expected|
1621
- assert_equal(expected, XSD::XSDPositiveInteger.new(data).to_s)
1622
- end
1623
-
1624
- targets = [
1625
- "1.0",
1626
- "1.000000000000a",
1627
- "+-5",
1628
- "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890."
1629
- ]
1630
- targets.each do |d|
1631
- assert_raises(XSD::ValueSpaceError) do
1632
- XSD::XSDPositiveInteger.new(d)
1633
- end
1634
- end
1635
- end
1636
- end
1637
-
1638
-
1639
- end