voruby 1.0.1

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.
Files changed (156) hide show
  1. data/LICENSE +339 -0
  2. data/REQUIREMENTS +4 -0
  3. data/Rakefile.rb +296 -0
  4. data/lib/voruby/adql/adql.rb +2735 -0
  5. data/lib/voruby/adql/ext.rb +15 -0
  6. data/lib/voruby/adql/loader.rb +5 -0
  7. data/lib/voruby/adql/operations.rb +54 -0
  8. data/lib/voruby/adql/parser.rb +160 -0
  9. data/lib/voruby/adql/transforms.rb +573 -0
  10. data/lib/voruby/ext.rb +17 -0
  11. data/lib/voruby/loader.rb +4 -0
  12. data/lib/voruby/misc/propertyfile.rb +36 -0
  13. data/lib/voruby/plastic/applications.rb +174 -0
  14. data/lib/voruby/plastic/constants.rb +30 -0
  15. data/lib/voruby/plastic/loader.rb +10 -0
  16. data/lib/voruby/plastic/plastic.rb +1 -0
  17. data/lib/voruby/resources/conesearch/conesearch.rb +9 -0
  18. data/lib/voruby/resources/conesearch/conesearch_v0_2.rb +55 -0
  19. data/lib/voruby/resources/conesearch/conesearch_v0_3.rb +50 -0
  20. data/lib/voruby/resources/conesearch/conesearch_v1_0.rb +72 -0
  21. data/lib/voruby/resources/conesearch/loader.rb +4 -0
  22. data/lib/voruby/resources/loader.rb +50 -0
  23. data/lib/voruby/resources/nodes.rb +190 -0
  24. data/lib/voruby/resources/openskynode/loader.rb +4 -0
  25. data/lib/voruby/resources/openskynode/openskynode.rb +9 -0
  26. data/lib/voruby/resources/openskynode/openskynode_v0_1.rb +54 -0
  27. data/lib/voruby/resources/sia/loader.rb +5 -0
  28. data/lib/voruby/resources/sia/sia.rb +9 -0
  29. data/lib/voruby/resources/sia/sia_v0_6.rb +90 -0
  30. data/lib/voruby/resources/sia/sia_v0_7.rb +89 -0
  31. data/lib/voruby/resources/sia/sia_v1_0.rb +122 -0
  32. data/lib/voruby/resources/stsci.rb +59 -0
  33. data/lib/voruby/resources/vodataservice/coverage_v0_2.rb +195 -0
  34. data/lib/voruby/resources/vodataservice/coverage_v0_3.rb +158 -0
  35. data/lib/voruby/resources/vodataservice/loader.rb +5 -0
  36. data/lib/voruby/resources/vodataservice/vodataservice.rb +9 -0
  37. data/lib/voruby/resources/vodataservice/vodataservice_v0_4.rb +189 -0
  38. data/lib/voruby/resources/vodataservice/vodataservice_v0_5.rb +163 -0
  39. data/lib/voruby/resources/vodataservice/vodataservice_v1_0.rb +221 -0
  40. data/lib/voruby/resources/voregistry/loader.rb +4 -0
  41. data/lib/voruby/resources/voregistry/voregistry.rb +9 -0
  42. data/lib/voruby/resources/voregistry/voregistry_v0_2.rb +40 -0
  43. data/lib/voruby/resources/voregistry/voregistry_v0_3.rb +30 -0
  44. data/lib/voruby/resources/voregistry/voregistry_v1_0.rb +86 -0
  45. data/lib/voruby/resources/voresource/loader.rb +17 -0
  46. data/lib/voruby/resources/voresource/voresource.rb +9 -0
  47. data/lib/voruby/resources/voresource/voresource_v0_10.rb +322 -0
  48. data/lib/voruby/resources/voresource/voresource_v0_9.rb +405 -0
  49. data/lib/voruby/resources/voresource/voresource_v1_0.rb +230 -0
  50. data/lib/voruby/services/ext.rb +11 -0
  51. data/lib/voruby/services/gestalt/footprint.rb +95 -0
  52. data/lib/voruby/services/gestalt/wcs_fixer.rb +105 -0
  53. data/lib/voruby/services/gestalt/wesix.rb +155 -0
  54. data/lib/voruby/services/loader.rb +7 -0
  55. data/lib/voruby/services/registry/registry.rb +53 -0
  56. data/lib/voruby/services/resolver/resolver.rb +35 -0
  57. data/lib/voruby/sesame/loader.rb +6 -0
  58. data/lib/voruby/sesame/sesame_v1_0.rb +64 -0
  59. data/lib/voruby/simple/loader.rb +6 -0
  60. data/lib/voruby/simple/parameters.rb +196 -0
  61. data/lib/voruby/simple/sap.rb +446 -0
  62. data/lib/voruby/spacetime/loader.rb +3 -0
  63. data/lib/voruby/spacetime/spacetime.rb +607 -0
  64. data/lib/voruby/stc/coords_v1_20.rb +900 -0
  65. data/lib/voruby/stc/loader.rb +55 -0
  66. data/lib/voruby/stc/region_v1_20.rb +274 -0
  67. data/lib/voruby/stc/stc_v1_20.rb +1196 -0
  68. data/lib/voruby/util.rb +27 -0
  69. data/lib/voruby/voevent/loader.rb +7 -0
  70. data/lib/voruby/voevent/voevent_v1_0.rb +213 -0
  71. data/lib/voruby/voevent/voevent_v1_1.rb +196 -0
  72. data/lib/voruby/votables/chandra.rb +410 -0
  73. data/lib/voruby/votables/cnoc.rb +393 -0
  74. data/lib/voruby/votables/data.rb +179 -0
  75. data/lib/voruby/votables/galex.rb +390 -0
  76. data/lib/voruby/votables/hst.rb +391 -0
  77. data/lib/voruby/votables/int.rb +391 -0
  78. data/lib/voruby/votables/libxml_parser.rb +411 -0
  79. data/lib/voruby/votables/libxml_votable.rb +67 -0
  80. data/lib/voruby/votables/loader.rb +10 -0
  81. data/lib/voruby/votables/meta.rb +763 -0
  82. data/lib/voruby/votables/misc.rb +51 -0
  83. data/lib/voruby/votables/nsa.rb +393 -0
  84. data/lib/voruby/votables/nsar3.rb +410 -0
  85. data/lib/voruby/votables/rexml_parser.rb +408 -0
  86. data/lib/voruby/votables/rexml_votable.rb +67 -0
  87. data/lib/voruby/votables/sdss.rb +393 -0
  88. data/lib/voruby/votables/transforms.rb +388 -0
  89. data/lib/voruby/votables/tree.rb +45 -0
  90. data/lib/voruby/votables/types.rb +391 -0
  91. data/lib/voruby/votables/votable.rb +630 -0
  92. data/lib/voruby/votables/xmm.rb +394 -0
  93. data/test/adql/test1.adql +49 -0
  94. data/test/adql/test2.adql +51 -0
  95. data/test/adql/test3.adql +81 -0
  96. data/test/adql/test4.adql +53 -0
  97. data/test/adql/test5.adql +55 -0
  98. data/test/adql/test6.adql +18 -0
  99. data/test/adql/test7.adql +48 -0
  100. data/test/adql/unittest.rb +1672 -0
  101. data/test/plastic/test.rb +44 -0
  102. data/test/plastic/test.vot +5385 -0
  103. data/test/plastic/unittest.rb +66 -0
  104. data/test/resources/conesearch/conesearch_v0_3.xml +31 -0
  105. data/test/resources/conesearch/conesearch_v1_0.xml +86 -0
  106. data/test/resources/conesearch/unittest_v0_3.rb +22 -0
  107. data/test/resources/conesearch/unittest_v1_0.rb +24 -0
  108. data/test/resources/openskynode/open_sky_node_v0_1.xml +32 -0
  109. data/test/resources/openskynode/unittest_v0_1.rb +31 -0
  110. data/test/resources/sia/simple_image_access_v0_7.xml +36 -0
  111. data/test/resources/sia/simple_image_access_v1_0.xml +122 -0
  112. data/test/resources/sia/unittest_v0_7.rb +24 -0
  113. data/test/resources/sia/unittest_v1_0.rb +29 -0
  114. data/test/resources/stsci.xml +336 -0
  115. data/test/resources/unittest_stsci.rb +25 -0
  116. data/test/resources/vodataservice/catalog_service_resource_v1_0.xml +128 -0
  117. data/test/resources/vodataservice/data_collection_resource_v0_5.xml +54 -0
  118. data/test/resources/vodataservice/data_collection_resource_v1_0.xml +117 -0
  119. data/test/resources/vodataservice/data_service_resource_v1_0.xml +115 -0
  120. data/test/resources/vodataservice/sky_service_resource_v0_10.xml +45 -0
  121. data/test/resources/vodataservice/table_service_resource_v1_0.xml +122 -0
  122. data/test/resources/vodataservice/tabular_sky_service_resource_v0_10.xml +60 -0
  123. data/test/resources/vodataservice/unittest_v0_5.rb +126 -0
  124. data/test/resources/vodataservice/unittest_v1_0.rb +151 -0
  125. data/test/resources/voregistry/authority_resource_v0_3.xml +20 -0
  126. data/test/resources/voregistry/authority_resource_v1_0.xml +82 -0
  127. data/test/resources/voregistry/registry_service_v0_3.xml +20 -0
  128. data/test/resources/voregistry/registry_service_v1_0.xml +107 -0
  129. data/test/resources/voregistry/unittest_v0_3.rb +31 -0
  130. data/test/resources/voregistry/unittest_v1_0.rb +34 -0
  131. data/test/resources/voresource/organisation_resource_v1_0.xml +90 -0
  132. data/test/resources/voresource/resource_organisation_v0_10.xml +22 -0
  133. data/test/resources/voresource/resource_service_v0_10.xml +19 -0
  134. data/test/resources/voresource/resource_v0_10.xml +19 -0
  135. data/test/resources/voresource/resource_v1_0.xml +79 -0
  136. data/test/resources/voresource/service_resource_v1_0.xml +91 -0
  137. data/test/resources/voresource/unittest_v0_10.rb +61 -0
  138. data/test/resources/voresource/unittest_v0_9.rb +4 -0
  139. data/test/resources/voresource/unittest_v1_0.rb +190 -0
  140. data/test/services/gestalt/unittest.rb +74 -0
  141. data/test/services/registry/unittest.rb +34 -0
  142. data/test/services/resolver/unittest.rb +38 -0
  143. data/test/simple/unittest.rb +46 -0
  144. data/test/spacetime/unittest.rb +39 -0
  145. data/test/stc/catalog_entry_location_v1_20.xml +112 -0
  146. data/test/stc/obs_data_location_v1_20.xml +108 -0
  147. data/test/stc/search_location_v1_20.xml +54 -0
  148. data/test/stc/stc_resource_profile_v1_20.xml +60 -0
  149. data/test/stc/unittest_v1_20.rb +620 -0
  150. data/test/voevent/unittest_v1_0.rb +79 -0
  151. data/test/voevent/unittest_v1_1.rb +70 -0
  152. data/test/voevent/voevent_v1_0.xml +96 -0
  153. data/test/voevent/voevent_v1_1.xml +76 -0
  154. data/test/votables/test.vot +366 -0
  155. data/test/votables/unittest.rb +54 -0
  156. metadata +256 -0
@@ -0,0 +1,79 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <resource
3
+ xmlns:vr="http://www.ivoa.net/xml/VOResource/v1.0"
4
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5
+ xsi:schemaLocation="http://www.ivoa.net/xml/VOResource/v1.0
6
+ http://www.ivoa.net/xml/VOResource/v1.0"
7
+ created="2006-08-14T08:00:00"
8
+ updated="2006-08-14T13:26:00">
9
+
10
+ <validationLevel validatedBy="ivo://noao.edu/">2</validationLevel>
11
+ <validationLevel validatedBy="ivo://ncsa.uiuc.edu/">3</validationLevel>
12
+
13
+ <title>NCSA Radio Astronomy Imaging</title>
14
+ <shortName>NCSA-RAI</shortName>
15
+ <identifier>ivo://rai.ncsa/RAI</identifier>
16
+
17
+ <curation>
18
+ <publisher ivo-id="ivo://ncsa.uiuc/NCSA">
19
+ National Center for Supercomputing Applications
20
+ </publisher>
21
+ <creator>
22
+ <name> Dr. Richard Crutcher </name>
23
+ <logo>http://rai.ncsa.uiuc.edu/rai.jpg</logo>
24
+ </creator>
25
+ <creator>
26
+ <name> David Gasson </name>
27
+ <logo>
28
+ http://www.noao.edu/rai.jpg
29
+ </logo>
30
+ </creator>
31
+ <contributor>Dave Bell</contributor>
32
+ <contributor>Chris Miller</contributor>
33
+ <date>1993-01-01T02:34:45</date>
34
+ <date>2006-08-14T12:25:23</date>
35
+ <version>1.1</version>
36
+ <contact>
37
+ <name>Dr. Raymond Plante</name>
38
+ <email>rplante@ncsa.uiuc.edu</email>
39
+ </contact>
40
+ <contact>
41
+ <name>David Gasson</name>
42
+ <email>dgasson@noao.edu</email>
43
+ <address>950 N. Cherry Avenue, Tucson, AZ 85719 USA</address>
44
+ <telephone>+1-520-318-8381</telephone>
45
+ </contact>
46
+ </curation>
47
+
48
+ <content>
49
+ <subject>radio astronomy</subject>
50
+ <subject>data repositories</subject>
51
+ <subject>digital libraries</subject>
52
+ <subject>grid-based processing</subject>
53
+ <description>
54
+ The Radio Astronomy Imaging Group at the National Center for
55
+ Supercomputing Applications is focused on applying
56
+ high-performance computing to astronomical research. Our
57
+ projects include the NCSA Astronomy Digital Image Library,
58
+ the BIMA Data Archive, the BIMA Image Pipeline, and the
59
+ National Virtual Observatory.
60
+ </description>
61
+ <referenceURL>http://rai.ncsa.uiuc.edu/</referenceURL>
62
+ <source format="bibcode">1989ApJ...342L..71R</source>
63
+ <type>Organisation</type>
64
+ <type>Archive</type>
65
+ <type>Survey</type>
66
+ <contentLevel>Elementary Education</contentLevel>
67
+ <contentLevel>Middle School Education</contentLevel>
68
+ <contentLevel>General</contentLevel>
69
+ <relationship>
70
+ <relationshipType>Relationship 1</relationshipType>
71
+ <relatedResource>http://blah</relatedResource>
72
+ <relatedResource>http://blah2</relatedResource>
73
+ </relationship>
74
+ <relationship>
75
+ <relationshipType>Relationship 2</relationshipType>
76
+ <relatedResource>http://blah3</relatedResource>
77
+ </relationship>
78
+ </content>
79
+ </resource>
@@ -0,0 +1,91 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <resource xmlns:vr="http://www.ivoa.net/xml/VOResource/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Service" xsi:schemaLocation="http://www.ivoa.net/xml/VOResource/v1.0 http://www.ivoa.net/xml/VOResource/v1.0" created="2006-08-14T08:00:00" updated="2006-08-14T13:26:00">
3
+ <validationLevel validatedBy="ivo://noao.edu/">2</validationLevel>
4
+ <validationLevel validatedBy="ivo://ncsa.uiuc.edu/">3</validationLevel>
5
+ <title>NCSA Radio Astronomy Imaging</title>
6
+ <shortName>NCSA-RAI</shortName>
7
+ <identifier>ivo://rai.ncsa/RAI</identifier>
8
+ <curation>
9
+ <publisher ivo-id="ivo://ncsa.uiuc/NCSA">
10
+ National Center for Supercomputing Applications
11
+ </publisher>
12
+ <creator>
13
+ <name> Dr. Richard Crutcher </name>
14
+ <logo>
15
+ http://rai.ncsa.uiuc.edu/rai.jpg
16
+ </logo>
17
+ </creator>
18
+ <creator>
19
+ <name> David Gasson </name>
20
+ <logo>
21
+ http://www.noao.edu/rai.jpg
22
+ </logo>
23
+ </creator>
24
+ <contributor>Dave Bell</contributor>
25
+ <contributor>Chris Miller</contributor>
26
+ <date>1993-01-01T02:34:45</date>
27
+ <date>2006-08-14T12:25:23</date>
28
+ <version>1.1</version>
29
+ <contact>
30
+ <name>Dr. Raymond Plante</name>
31
+ <email>rplante@ncsa.uiuc.edu</email>
32
+ </contact>
33
+ <contact>
34
+ <name>David Gasson</name>
35
+ <email>dgasson@noao.edu</email>
36
+ <address>950 N. Cherry Avenue, Tucson, AZ 85719 USA</address>
37
+ <telephone>+1-520-318-8381</telephone>
38
+ </contact>
39
+ </curation>
40
+ <content>
41
+ <subject>radio astronomy</subject>
42
+ <subject>data repositories</subject>
43
+ <subject>digital libraries</subject>
44
+ <subject>grid-based processing</subject>
45
+ <description>
46
+ The Radio Astronomy Imaging Group at the National Center for
47
+ Supercomputing Applications is focused on applying
48
+ high-performance computing to astronomical research. Our
49
+ projects include the NCSA Astronomy Digital Image Library,
50
+ the BIMA Data Archive, the BIMA Image Pipeline, and the
51
+ National Virtual Observatory.
52
+ </description>
53
+ <referenceURL>http://rai.ncsa.uiuc.edu/</referenceURL>
54
+ <source format="bibcode">1989ApJ...342L..71R</source>
55
+ <type>Organisation</type>
56
+ <type>Archive</type>
57
+ <type>Survey</type>
58
+ <contentLevel>Elementary Education</contentLevel>
59
+ <contentLevel>Middle School Education</contentLevel>
60
+ <contentLevel>General</contentLevel>
61
+ <relationship>
62
+ <relationshipType>Relationship 1</relationshipType>
63
+ <relatedResource>http://blah</relatedResource>
64
+ <relatedResource>http://blah2</relatedResource>
65
+ </relationship>
66
+ <relationship>
67
+ <relationshipType>Relationship 2</relationshipType>
68
+ <relatedResource>http://blah3</relatedResource>
69
+ </relationship>
70
+ </content>
71
+ <rights>secure</rights>
72
+ <rights>public</rights>
73
+ <capability>
74
+ <validationLevel validatedBy="ivo://noao.edu/">1</validationLevel>
75
+ <validationLevel validatedBy="ivo://ncsa.uiuc.edu/">3</validationLevel>
76
+ <description>This is a fake capability signifying nothing.</description>
77
+ <interface xsi:type="vr:WebBrowser" role="std" version="1.1">
78
+ <accessURL use="base">www.noao.edu</accessURL>
79
+ <accessURL>http://nsa.noao.edu/</accessURL>
80
+ <securityMethod standardID="ivo://representative/security_uri/"/>
81
+ <securityMethod standardID="ivo://representative/security_uri/2/"/>
82
+ </interface>
83
+ <interface xsi:type="vr:WebService" role="std" version="1.1">
84
+ <accessURL use="base">www.noao.edu</accessURL>
85
+ <accessURL>http://nsa.noao.edu/</accessURL>
86
+ <securityMethod standardID="ivo://representative/security_uri/"/>
87
+ <securityMethod standardID="ivo://representative/security_uri/2/"/>
88
+ <wsdlURL>http://www.noao.edu?wsdl</wsdlURL>
89
+ </interface>
90
+ </capability>
91
+ </resource>
@@ -0,0 +1,61 @@
1
+ require 'test/unit'
2
+ require 'voruby/resources/voresource/voresource_v0_10'
3
+
4
+ include VORuby::Resources::VOResource::V0_10
5
+
6
+ class ResourceTest < Test::Unit::TestCase
7
+ def setup
8
+ assert_nothing_raised {
9
+ @res = Resource.load_from_file('test/resources/voresource/resource_v0_10.xml')
10
+ }
11
+ end
12
+
13
+ def test_update
14
+ assert_equal('2000-12-16', @res.updated.strftime('%Y-%m-%d'))
15
+ end
16
+
17
+ def test_title
18
+ assert_equal('1997 WIYN binary stars speckle observations (Horch+, 1999) - Individual notes (tables 2, 3 and 4)',
19
+ @res.title.strip)
20
+ end
21
+
22
+ def test_short_name
23
+ assert_equal('ivo://CDS/VizieR/J/AJ/117/548/notes', @res.identifier.value.to_s)
24
+ end
25
+
26
+ def test_curation
27
+ assert_equal('CDS', @res.curation.publisher.value)
28
+ assert_equal('NOT PROVIDED', @res.curation.contributors[0].value)
29
+ assert_equal('NOT PROVIDED', @res.curation.version)
30
+ end
31
+
32
+ def test_content
33
+ assert_equal('Multiple_Stars', @res.content.subjects[0].value)
34
+ assert_equal('http://vizier.u-strasbg.fr/cgi-bin/Cat?J/AJ/117/548/notes', @res.content.reference_url.value.to_s)
35
+ assert_equal('Research', @res.content.content_levels[0].value)
36
+ end
37
+ end
38
+
39
+ class OrganisationTest < ResourceTest
40
+ def setup
41
+ assert_nothing_raised {
42
+ @res = Organisation.load_from_file('test/resources/voresource/resource_organisation_v0_10.xml')
43
+ }
44
+ end
45
+
46
+ def test_facilities
47
+ assert_equal('WIYN', @res.facilities[0].value)
48
+ end
49
+
50
+ def test_instruments
51
+ assert_equal('MAMA', @res.instruments[0].value)
52
+ end
53
+ end
54
+
55
+ class ServiceTest < ResourceTest
56
+ def setup
57
+ assert_nothing_raised {
58
+ @res = Service.load_from_file('test/resources/voresource/resource_service_v0_10.xml')
59
+ }
60
+ end
61
+ end
@@ -0,0 +1,4 @@
1
+ require 'test/unit'
2
+ require 'voruby/resources/voresource/voresource_v0_9'
3
+
4
+ include VORuby::Resources::VOResource::V0_9
@@ -0,0 +1,190 @@
1
+ require 'test/unit'
2
+ require 'voruby/resources/voresource/voresource'
3
+
4
+ include VORuby::Resources::VOResource::V1_0
5
+
6
+ class ResourceTest < Test::Unit::TestCase
7
+ def setup
8
+ assert_nothing_raised {
9
+ @res = Resource.load_from_file('test/resources/voresource/resource_v1_0.xml')
10
+ }
11
+ end
12
+
13
+ def test_resource_attributes
14
+ assert_equal('2006-08-14T08:00:00Z', @res.created.to_s)
15
+ assert_equal('2006-08-14T13:26:00Z', @res.updated.to_s)
16
+ assert_equal('active', @res.status)
17
+ end
18
+
19
+ def test_validation_levels
20
+ assert_equal(2, @res.validation_levels[0].value)
21
+ assert_equal('ivo://noao.edu/', @res.validation_levels[0].validated_by.value.to_s)
22
+ assert_equal(3, @res.validation_levels[1].value)
23
+ assert_equal('ivo://ncsa.uiuc.edu/', @res.validation_levels[1].validated_by.value.to_s)
24
+ end
25
+
26
+ def test_title
27
+ assert_equal('NCSA Radio Astronomy Imaging', @res.title.strip())
28
+ end
29
+
30
+ def test_short_name
31
+ assert_equal('NCSA-RAI', @res.short_name.value.strip())
32
+ end
33
+
34
+ def test_identifier
35
+ assert_equal('ivo://rai.ncsa/RAI', @res.identifier.value.to_s())
36
+ end
37
+
38
+ def test_curation_publisher
39
+ assert_equal('National Center for Supercomputing Applications', @res.curation.publisher.value.strip())
40
+ assert_equal('ivo://ncsa.uiuc/NCSA', @res.curation.publisher.ivo_id.value.to_s)
41
+ end
42
+
43
+ def test_curation_creators
44
+ assert_equal('Dr. Richard Crutcher', @res.curation.creators[0].name.value.strip())
45
+ assert_equal('http://rai.ncsa.uiuc.edu/rai.jpg', @res.curation.creators[0].logo.value.to_s)
46
+ assert_equal('David Gasson', @res.curation.creators[1].name.value.strip())
47
+ assert_equal('http://www.noao.edu/rai.jpg', @res.curation.creators[1].logo.value.to_s)
48
+ end
49
+
50
+ def test_curation_contributors
51
+ assert_equal('Dave Bell', @res.curation.contributors[0].value.strip())
52
+ assert_equal('Chris Miller', @res.curation.contributors[1].value.strip())
53
+ end
54
+
55
+ def test_curation_dates
56
+ assert_equal('1993-01-01T02:34:45', @res.curation.dates[0].value.strftime("%Y-%m-%dT%H:%M:%S"))
57
+ assert_equal('2006-08-14T12:25:23', @res.curation.dates[1].value.strftime("%Y-%m-%dT%H:%M:%S"))
58
+ end
59
+
60
+ def test_curation_version
61
+ assert_equal('1.1', @res.curation.version.strip())
62
+ end
63
+
64
+ def test_curation_contacts
65
+ assert_equal('Dr. Raymond Plante', @res.curation.contacts[0].name.value.strip())
66
+ assert_equal('rplante@ncsa.uiuc.edu', @res.curation.contacts[0].email.strip())
67
+ assert_equal('David Gasson', @res.curation.contacts[1].name.value.strip())
68
+ assert_equal('dgasson@noao.edu', @res.curation.contacts[1].email.strip())
69
+ assert_equal('950 N. Cherry Avenue, Tucson, AZ 85719 USA', @res.curation.contacts[1].address.strip())
70
+ assert_equal('+1-520-318-8381', @res.curation.contacts[1].telephone.strip())
71
+ end
72
+
73
+ def test_content_subjects
74
+ assert_equal('radio astronomy', @res.content.subjects[0].value.strip())
75
+ assert_equal('data repositories', @res.content.subjects[1].value.strip())
76
+ assert_equal('digital libraries', @res.content.subjects[2].value.strip())
77
+ assert_equal('grid-based processing', @res.content.subjects[3].value.strip())
78
+ end
79
+
80
+ def test_content_description
81
+ assert @res.content.description
82
+ end
83
+
84
+ def test_content_reference_url
85
+ assert_equal('http://rai.ncsa.uiuc.edu/', @res.content.reference_url.value.to_s)
86
+ end
87
+
88
+ def test_content_source
89
+ assert_equal('1989ApJ...342L..71R', @res.content.source.value.strip())
90
+ assert_equal('bibcode', @res.content.source.format.strip())
91
+ end
92
+
93
+ def test_content_types
94
+ assert_equal('Organisation', @res.content.types[0].value.strip())
95
+ assert_equal('Archive', @res.content.types[1].value.strip())
96
+ assert_equal('Survey', @res.content.types[2].value.strip())
97
+ end
98
+
99
+ def test_content_levels
100
+ assert_equal('Elementary Education', @res.content.content_levels[0].value.strip())
101
+ assert_equal('Middle School Education', @res.content.content_levels[1].value.strip())
102
+ assert_equal('General', @res.content.content_levels[2].value.strip())
103
+ end
104
+
105
+ def test_content_relationships
106
+ rel1 = @res.content.relationships[0]
107
+ rel2 = @res.content.relationships[1]
108
+
109
+ assert_equal('Relationship 1', rel1.relationship_type)
110
+ assert_equal('http://blah', rel1.related_resources[0].value)
111
+ assert_equal('http://blah2', rel1.related_resources[1].value)
112
+ assert_equal('Relationship 2', rel2.relationship_type)
113
+ assert_equal('http://blah3', rel2.related_resources[0].value)
114
+ end
115
+ end
116
+
117
+ class OrganisationTest < ResourceTest
118
+ def setup
119
+ assert_nothing_raised {
120
+ @res = Organisation.load_from_file('test/resources/voresource/organisation_resource_v1_0.xml')
121
+ }
122
+ end
123
+
124
+ def test_resource_facilities
125
+ assert_equal('Berkeley-Illinois-Maryland Array (BIMA)', @res.facilities[0].value.strip())
126
+ assert_equal('Combined Array for Research in Millimeter Astronomy (CARMA)', @res.facilities[1].value.strip())
127
+ end
128
+
129
+ def test_resource_instruments
130
+ assert_equal('MOSA', @res.instruments[0].value.strip())
131
+ assert_equal('MOSAIC', @res.instruments[1].value.strip())
132
+ end
133
+ end
134
+
135
+ class ServiceTest < ResourceTest
136
+ def setup
137
+ assert_nothing_raised {
138
+ @res = Service.load_from_file('test/resources/voresource/service_resource_v1_0.xml')
139
+ }
140
+ end
141
+
142
+ def test_resource_rights
143
+ assert_equal('secure', @res.rights[0].value.strip())
144
+ assert_equal('public', @res.rights[1].value.strip())
145
+ end
146
+
147
+ def test_capability_validation_levels
148
+ cap1 = @res.capabilities[0]
149
+
150
+ assert_equal('ivo://noao.edu/', cap1.validation_levels[0].validated_by.value.to_s)
151
+ assert_equal(1, cap1.validation_levels[0].value)
152
+ assert_equal('ivo://ncsa.uiuc.edu/', cap1.validation_levels[1].validated_by.value.to_s)
153
+ assert_equal(3, cap1.validation_levels[1].value)
154
+
155
+ assert_equal('This is a fake capability signifying nothing.', cap1.description.strip())
156
+ end
157
+
158
+ def test_capability_interface_access_urls
159
+ assert_equal('www.noao.edu', @res.capabilities[0].interfaces[0].access_urls[0].value.to_s)
160
+ assert_equal('base', @res.capabilities[0].interfaces[0].access_urls[0].use)
161
+ assert_equal('http://nsa.noao.edu/', @res.capabilities[0].interfaces[0].access_urls[1].value.to_s)
162
+ end
163
+
164
+ def test_capability_interface_security_methods
165
+ assert_equal('ivo://representative/security_uri/',
166
+ @res.capabilities[0].interfaces[0].security_methods[0].standard_id.value.to_s)
167
+ assert_equal('ivo://representative/security_uri/2/',
168
+ @res.capabilities[0].interfaces[0].security_methods[1].standard_id.value.to_s)
169
+ end
170
+
171
+ def test_capability_interface_type
172
+ full_iface_type = @res.capabilities[0].interfaces[0].interface_type
173
+ ns, iface_type = full_iface_type.split(':')
174
+ iface_type = ns if !iface_type
175
+
176
+ assert_equal('WebBrowser', iface_type)
177
+ end
178
+
179
+ def test_capability_interface_role
180
+ assert_equal('std', @res.capabilities[0].interfaces[0].role)
181
+ end
182
+
183
+ def test_capability_interface_version
184
+ assert_equal('1.1', @res.capabilities[0].interfaces[0].version)
185
+ end
186
+
187
+ def test_capability_interface_wsdl_url
188
+ assert_equal('http://www.noao.edu?wsdl', @res.capabilities[0].interfaces[1].wsdl_urls[0].value.to_s)
189
+ end
190
+ end
@@ -0,0 +1,74 @@
1
+ require 'test/unit'
2
+ require 'voruby/services/gestalt/footprint'
3
+ require 'voruby/services/gestalt/wcs_fixer'
4
+ require 'voruby/services/gestalt/wesix'
5
+
6
+ include VORuby::Services::Gestalt
7
+
8
+ class FootprintTest < Test::Unit::TestCase
9
+ def setup
10
+ @ra = [179.5, 180.5]
11
+ @dec = [-1.5, 1.5]
12
+ @radius = [1.0, 1.0]
13
+ end
14
+
15
+ def test_footprint
16
+ footprint = nil
17
+ assert_nothing_raised {
18
+ footprint = FootPrintService.from_wsdl()
19
+
20
+ map_names = footprint.makeCircleMap(@ra, @dec, @radius)
21
+ puts "Map Name(s): #{map_names.join(', ')}"
22
+
23
+ map_plot_url = footprint.makePlot(map_names, *FootPrintService::plot_limits(@ra, @dec, @radius))
24
+ puts "Plot URL: #{map_plot_url}"
25
+
26
+ deletion_responses = footprint.deleteAllTables(map_names)
27
+ puts "Deleted #{map_names.join(', ')}: #{deletion_responses.join(', ')}"
28
+ }
29
+ end
30
+ end
31
+
32
+ class WCSFixerTest < Test::Unit::TestCase
33
+ def setup
34
+ @save_file = 'test/services/gestalt/example.fix.fits'
35
+ end
36
+
37
+ def test_wcsfixer
38
+ assert_nothing_raised {
39
+ fixer = WCSFixerService.from_wsdl()
40
+ fixed = fixer.fixUrl('http://nvogre.phyast.pitt.edu/wcs/example.fits', @save_file)
41
+ fixed.close()
42
+ }
43
+ end
44
+
45
+ def teardown
46
+ File.delete(@save_file)
47
+ end
48
+ end
49
+
50
+ class WesixTest < Test::Unit::TestCase
51
+ def test_wesix
52
+ assert_nothing_raised {
53
+ wesix = Wesix.from_wsdl()
54
+
55
+ wesix.number = false
56
+ wesix.flux_iso = true
57
+ wesix.fluxerr_iso = true
58
+
59
+ wesix.detect_thresh = 5.0
60
+ wesix.analysis_thresh = 1.5
61
+ wesix.back_size = 64
62
+ wesix.back_filtersize = 3
63
+ wesix.pixel_scale = 0
64
+ wesix.seeing_fwhm = 1.2
65
+
66
+ votable = wesix.wsextractorURL3VO('http://nvogre.phyast.pitt.edu:8080/wesix/testr.fits')
67
+ puts votable.resources[0].tables[0].name
68
+ puts votable.resources[0].tables[0].fields.collect{|field| field.name + "(#{field.datatype.value},#{field.width.value})"}.join(' ')
69
+ votable.resources[0].tables[0].data.format.trs.each do |tr|
70
+ puts tr.tds.collect{|td| td.value}.join(' ')
71
+ end
72
+ }
73
+ end
74
+ end
@@ -0,0 +1,34 @@
1
+ require 'test/unit'
2
+
3
+ require 'soap/processor'
4
+ require 'voruby/services/registry/registry'
5
+
6
+ include VORuby::Services::Registry
7
+
8
+ class STScIRegistryTest < Test::Unit::TestCase
9
+ def setup
10
+ assert_nothing_raised {
11
+ @registry = STScI.from_wsdl()
12
+ }
13
+ end
14
+
15
+ def test_queryVOResource_registry
16
+ assert_nothing_raised {
17
+ predicate = "ResourceType like 'REGISTRY'"
18
+ puts "Query: #{predicate}"
19
+ @registry.queryVOResource(predicate).resources.each do |res|
20
+ puts "\t#{res.title}"
21
+ end
22
+ }
23
+ end
24
+
25
+ def test_queryVOResource_cone
26
+ assert_nothing_raised {
27
+ predicate = "maxSearchRadius > 1 and ResourceType like 'CONE'"
28
+ puts "Query: #{predicate}"
29
+ @registry.queryVOResource(predicate).resources.each do |res|
30
+ puts "\t#{res.title}"
31
+ end
32
+ }
33
+ end
34
+ end
@@ -0,0 +1,38 @@
1
+ require 'test/unit'
2
+
3
+ require 'voruby/services/resolver/resolver'
4
+
5
+ include VORuby::Services::Resolver
6
+
7
+ class SesameTest < Test::Unit::TestCase
8
+ def setup
9
+ assert_nothing_raised {
10
+ @sesame = Sesame.from_wsdl()
11
+ }
12
+ end
13
+
14
+ def test_query
15
+ query = @sesame.query('m31')
16
+
17
+ assert_equal('m31', query.target.value)
18
+ assert_equal('A', query.target.option)
19
+
20
+ resolver1 = query.resolvers[0]
21
+ assert_equal('from cache', resolver1.info[0].value)
22
+ assert_equal('00:42:44.31 +41:16:09.4', resolver1.jpos)
23
+ assert_equal(10.6846250, resolver1.jradeg)
24
+ assert_equal(41.2692778, resolver1.jdedeg)
25
+ assert_equal('1999ApJS..125..409C', resolver1.ref_pos)
26
+ assert_equal(10800, resolver1.err_ra_mas)
27
+ assert_equal(10800, resolver1.err_de_mas)
28
+ assert_equal('2C 56', resolver1.oname)
29
+ assert_equal('IRAS F00400+4059', resolver1.aliases[4].value)
30
+ assert_equal(4663, resolver1.nrefs)
31
+ assert_equal('Simbad', resolver1.name)
32
+ end
33
+
34
+ def test_query_position
35
+ coords = @sesame.query_position('m1')
36
+ assert_equal('05:34:31.97, +22:00:52.10', coords.to_s)
37
+ end
38
+ end
@@ -0,0 +1,46 @@
1
+ require 'test/unit'
2
+ require 'voruby/simple/sap'
3
+
4
+ module TestMethods
5
+ def test_simple_access
6
+ assert_nothing_raised {
7
+ nsa_siap = VORuby::Simple::ImageAccess.new('http://archive.noao.edu/nvo/sim/voquery.php',
8
+ '23:00:00, 2:00:00', 7, nil, 30, @parser)
9
+ mast_cone = VORuby::Simple::ConeSearch.new('http://archive.stsci.edu/hst/search.php',
10
+ 53.084, -27.873, 0.01, nil, 30, @parser)
11
+
12
+ VORuby::Simple::QueryExecutor.new([nsa_siap, mast_cone], @objectifier).results().each do |query, votable|
13
+ puts "#{query.to_s()}..."
14
+ votable.fields().each do |field|
15
+ puts "#{field.id()}, #{field.name()}, #{field.ucd().value() if field.ucd() != nil}"
16
+ end
17
+
18
+ puts "\n"
19
+ end
20
+ }
21
+ end
22
+ end
23
+
24
+ class LibxmlSimpleAccessTest < Test::Unit::TestCase
25
+ include TestMethods
26
+
27
+ def setup
28
+ @objectifier = Proc.new { |query|
29
+ query.marshall().votable().votable()
30
+ }
31
+ @parser = 'libxml'
32
+ end
33
+ end
34
+
35
+ class RexmlSimpleAccessTest < Test::Unit::TestCase
36
+ include TestMethods
37
+
38
+ def setup
39
+ @objectifier = Proc.new { |query|
40
+ query.marshall().votable().votable()
41
+ }
42
+ @parser = 'rexml'
43
+ end
44
+ end
45
+
46
+
@@ -0,0 +1,39 @@
1
+ require 'test/unit'
2
+ require 'voruby/spacetime/spacetime'
3
+
4
+ include VORuby::CoordinateSystems
5
+
6
+ class EquatorialPositionTest < Test::Unit::TestCase
7
+ def setup
8
+ @menkalinan = Equatorial::RADecPosition.new('5:59:31.67', '44:56:50.8')
9
+ @capella = Equatorial::RADecPosition.new('5:16:41.43', '45:59:50.0')
10
+ @vega = Equatorial::RADecPosition.new('18:36:56.48', '38:47:03.1')
11
+ @arcturus = Equatorial::RADecPosition.new('14:15:39.14', '19:10:43.8')
12
+ @antares = Equatorial::RADecPosition.new('16:29:24.45', '-26:25:55.4')
13
+
14
+ @rlyr = Equatorial::RADecPosition.new(283.45, 43.883, nil, 1950.0, :fk4)
15
+ @pole = Equatorial::RADecPosition.new('02:31:46.3', '89:15:50.6')
16
+ @epsind = Equatorial::RADecPosition.new('21:59:33.053', '-56:59:33.053', nil, 1950.0, :fk4)
17
+ end
18
+
19
+ def test_to_s
20
+ assert_equal(@menkalinan.to_s, '05:59:31.67, +44:56:50.80')
21
+ assert_equal(@capella.to_s, '05:16:41.43, +45:59:50.00')
22
+ assert_equal(@vega.to_s, '18:36:56.48, +38:47:3.10')
23
+ assert_equal(@arcturus.to_s, '14:15:39.14, +19:10:43.80')
24
+ assert_equal(@antares.to_s, '16:29:24.45, -26:25:55.40')
25
+ end
26
+
27
+ def test_angular_sep
28
+ assert_equal(sprintf("%.2f", @menkalinan.angular_separation(@capella)), '7.58')
29
+ assert_equal(sprintf("%.2f", @menkalinan.angular_separation(@vega)), '95.85')
30
+ assert_equal(sprintf("%.2f", @capella.angular_separation(@vega)), '93.33')
31
+ assert_equal(sprintf("%.2f", @arcturus.angular_separation(@antares)), '55.98')
32
+ end
33
+
34
+ def test_precess
35
+ assert_equal(@rlyr.precess(2000.0).to_s, '18:55:19.21, +43:56:55.15')
36
+ assert_equal(@pole.precess(1985.0).to_s, '02:16:22.73, +89:11:47.30')
37
+ assert_equal(@epsind.precess(1975.0, :fk4).to_s, '22:01:15.46, -56:52:18.70')
38
+ end
39
+ end