voruby 1.1.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile.rb +107 -224
- data/lib/misc.rb +1 -0
- data/lib/misc/misc.rb +60 -0
- data/lib/misc/propertyfile.rb +31 -0
- data/lib/symphony.rb +1 -0
- data/lib/symphony/symphony.rb +247 -0
- data/lib/voruby.rb +186 -0
- data/lib/voruby/active_votable/active_votable.rb +468 -347
- data/lib/voruby/adql/1.0/adql.rb +2418 -0
- data/lib/voruby/adql/support.rb +2 -0
- data/lib/voruby/misc.rb +351 -0
- data/lib/voruby/misc/connection_monitor.rb +97 -0
- data/lib/voruby/misc/libxml_ext.rb +121 -0
- data/lib/voruby/misc/rexml_ext.rb +223 -0
- data/lib/voruby/resolver/resolver.rb +12 -0
- data/lib/voruby/resolver/sesame.rb +299 -0
- data/lib/voruby/sky_query/sky_query.rb +192 -0
- data/lib/voruby/stc/1.10/coords.rb +2272 -0
- data/lib/voruby/stc/1.10/region.rb +892 -0
- data/lib/voruby/stc/1.10/stc.rb +3271 -0
- data/lib/voruby/stc/1.30/stc.rb +8666 -0
- data/lib/voruby/stc/support.rb +2 -0
- data/lib/voruby/ucd/ucd.rb +173 -0
- data/lib/voruby/voevent/1.1/voevent.rb +1124 -0
- data/lib/voruby/voevent/support.rb +5 -0
- data/lib/voruby/votable/1.0/votable.rb +1807 -0
- data/lib/voruby/votable/1.1/votable.rb +2100 -0
- data/lib/voruby/votable/votable.rb +305 -0
- data/lib/voruby/wesix/wesix.rb +491 -0
- data/lib/voruby/xlink/1.2/xlink.rb +21 -0
- data/test/voruby/active_votable/complex.vot +60 -0
- data/test/voruby/active_votable/error.vot +6 -0
- data/test/voruby/active_votable/large.vot +130040 -0
- data/test/voruby/active_votable/simple1.vot +38 -0
- data/test/voruby/active_votable/simple2.vot +38 -0
- data/test/voruby/active_votable/test.rb +193 -0
- data/test/voruby/adql/1.0/adql-alias.sql +1 -0
- data/test/voruby/adql/1.0/adql-alias.xml +26 -0
- data/test/voruby/adql/1.0/adql-avg.sql +1 -0
- data/test/voruby/adql/1.0/adql-avg.xml +31 -0
- data/test/voruby/adql/1.0/adql-circle.sql +1 -0
- data/test/voruby/adql/1.0/adql-circle.xml +46 -0
- data/test/voruby/adql/1.0/adql-expr.sql +1 -0
- data/test/voruby/adql/1.0/adql-expr.xml +34 -0
- data/test/voruby/adql/1.0/adql-function.sql +1 -0
- data/test/voruby/adql/1.0/adql-function.xml +41 -0
- data/test/voruby/adql/1.0/adql-group.sql +1 -0
- data/test/voruby/adql/1.0/adql-group.xml +51 -0
- data/test/voruby/adql/1.0/adql-having.sql +1 -0
- data/test/voruby/adql/1.0/adql-having.xml +25 -0
- data/test/voruby/adql/1.0/adql-like.sql +1 -0
- data/test/voruby/adql/1.0/adql-like.xml +17 -0
- data/test/voruby/adql/1.0/adql-order.sql +1 -0
- data/test/voruby/adql/1.0/adql-order.xml +37 -0
- data/test/voruby/adql/1.0/adql-simple.sql +1 -0
- data/test/voruby/adql/1.0/adql-simple.xml +12 -0
- data/test/voruby/adql/1.0/adql-top.sql +1 -0
- data/test/voruby/adql/1.0/adql-top.xml +33 -0
- data/test/voruby/adql/1.0/test.rb +2220 -0
- data/test/voruby/misc/test.rb +32 -0
- data/test/voruby/resolver/sesame/test.rb +56 -0
- data/test/voruby/sky_query/test.rb +107 -0
- data/test/voruby/stc/1.10/coords_test.rb +3704 -0
- data/test/voruby/stc/1.10/region_test.rb +993 -0
- data/test/voruby/stc/1.10/stc-catalog-entry-location.xml +112 -0
- data/test/voruby/stc/1.10/stc-obs-data-location.xml +126 -0
- data/test/voruby/stc/1.10/stc-region-circle.xml +5 -0
- data/test/voruby/stc/1.10/stc-region-convex.xml +11 -0
- data/test/voruby/stc/1.10/stc-region-convexhull.xml +5 -0
- data/test/voruby/stc/1.10/stc-region-ellipse.xml +7 -0
- data/test/voruby/stc/1.10/stc-region-intersection.xml +25 -0
- data/test/voruby/stc/1.10/stc-region-negation.xml +7 -0
- data/test/voruby/stc/1.10/stc-region-polygon.xml +13 -0
- data/test/voruby/stc/1.10/stc-region-sector.xml +6 -0
- data/test/voruby/stc/1.10/stc-region-union.xml +25 -0
- data/test/voruby/stc/1.10/stc-resource-profile.xml +60 -0
- data/test/voruby/stc/1.10/stc-search-location.xml +54 -0
- data/test/voruby/stc/1.10/stc_test.rb +4626 -0
- data/test/voruby/stc/1.30/stc-catalog-entry-location.xml +210 -0
- data/test/voruby/stc/1.30/stc-obs-data-location-arecibo.xml +353 -0
- data/test/voruby/stc/1.30/stc-obs-data-location-fits.xml +250 -0
- data/test/voruby/stc/1.30/stc-obs-data-location-xlink.xml +63 -0
- data/test/voruby/stc/1.30/stc-obs-data-location.xml +216 -0
- data/test/voruby/stc/1.30/stc-resource-profile-unusual-ref-pos.xml +39 -0
- data/test/voruby/stc/1.30/stc-resource-profile.xml +129 -0
- data/test/voruby/stc/1.30/stc-search-location-arecibo.xml +86 -0
- data/test/voruby/stc/1.30/stc-search-location.xml +101 -0
- data/test/voruby/stc/1.30/test.rb +6274 -0
- data/test/voruby/ucd/test.rb +48 -0
- data/test/voruby/voevent/1.1/test.rb +812 -0
- data/test/{voevent/voevent_v1_1.xml → voruby/voevent/1.1/voevent.xml} +2 -2
- data/test/voruby/voregistry/0.3/test.rb +137 -0
- data/test/voruby/votable/1.0/test.rb +714 -0
- data/test/voruby/votable/1.0/votable.basic.xml +660 -0
- data/test/voruby/votable/1.0/votable.html +86 -0
- data/test/voruby/votable/1.0/votable.ns.xml +56 -0
- data/test/voruby/votable/1.1/test.rb +785 -0
- data/test/voruby/votable/1.1/votable.basic.xml +38 -0
- data/test/voruby/votable/1.1/votable.html +86 -0
- data/test/voruby/votable/1.1/votable.ns.xml +56 -0
- data/test/voruby/votable/test.rb +15 -0
- data/test/voruby/wesix/test.rb +268 -0
- data/test/voruby/wesix/testr.fits +28 -0
- metadata +234 -247
- data/REQUIREMENTS +0 -6
- data/lib/voruby/active_votable/loader.rb +0 -5
- data/lib/voruby/adql/adql.rb +0 -2787
- data/lib/voruby/adql/ext.rb +0 -14
- data/lib/voruby/adql/loader.rb +0 -6
- data/lib/voruby/adql/operations.rb +0 -54
- data/lib/voruby/adql/parser.rb +0 -160
- data/lib/voruby/adql/transforms.rb +0 -573
- data/lib/voruby/ext.rb +0 -17
- data/lib/voruby/loader.rb +0 -4
- data/lib/voruby/misc/propertyfile.rb +0 -36
- data/lib/voruby/plastic/applications.rb +0 -174
- data/lib/voruby/plastic/constants.rb +0 -30
- data/lib/voruby/plastic/loader.rb +0 -10
- data/lib/voruby/plastic/plastic.rb +0 -1
- data/lib/voruby/resources/conesearch/conesearch.rb +0 -9
- data/lib/voruby/resources/conesearch/conesearch_v0_2.rb +0 -55
- data/lib/voruby/resources/conesearch/conesearch_v0_3.rb +0 -50
- data/lib/voruby/resources/conesearch/conesearch_v1_0.rb +0 -72
- data/lib/voruby/resources/conesearch/loader.rb +0 -4
- data/lib/voruby/resources/loader.rb +0 -50
- data/lib/voruby/resources/nodes.rb +0 -190
- data/lib/voruby/resources/openskynode/loader.rb +0 -4
- data/lib/voruby/resources/openskynode/openskynode.rb +0 -9
- data/lib/voruby/resources/openskynode/openskynode_v0_1.rb +0 -54
- data/lib/voruby/resources/sia/loader.rb +0 -5
- data/lib/voruby/resources/sia/sia.rb +0 -9
- data/lib/voruby/resources/sia/sia_v0_6.rb +0 -90
- data/lib/voruby/resources/sia/sia_v0_7.rb +0 -89
- data/lib/voruby/resources/sia/sia_v1_0.rb +0 -122
- data/lib/voruby/resources/stsci.rb +0 -59
- data/lib/voruby/resources/vodataservice/coverage_v0_2.rb +0 -195
- data/lib/voruby/resources/vodataservice/coverage_v0_3.rb +0 -158
- data/lib/voruby/resources/vodataservice/loader.rb +0 -5
- data/lib/voruby/resources/vodataservice/vodataservice.rb +0 -9
- data/lib/voruby/resources/vodataservice/vodataservice_v0_4.rb +0 -189
- data/lib/voruby/resources/vodataservice/vodataservice_v0_5.rb +0 -163
- data/lib/voruby/resources/vodataservice/vodataservice_v1_0.rb +0 -221
- data/lib/voruby/resources/voregistry/loader.rb +0 -4
- data/lib/voruby/resources/voregistry/voregistry.rb +0 -9
- data/lib/voruby/resources/voregistry/voregistry_v0_2.rb +0 -40
- data/lib/voruby/resources/voregistry/voregistry_v0_3.rb +0 -30
- data/lib/voruby/resources/voregistry/voregistry_v1_0.rb +0 -86
- data/lib/voruby/resources/voresource/loader.rb +0 -17
- data/lib/voruby/resources/voresource/voresource.rb +0 -9
- data/lib/voruby/resources/voresource/voresource_v0_10.rb +0 -327
- data/lib/voruby/resources/voresource/voresource_v0_9.rb +0 -405
- data/lib/voruby/resources/voresource/voresource_v1_0.rb +0 -230
- data/lib/voruby/services/ext.rb +0 -11
- data/lib/voruby/services/gestalt/footprint.rb +0 -95
- data/lib/voruby/services/gestalt/wcs_fixer.rb +0 -105
- data/lib/voruby/services/gestalt/wesix.rb +0 -155
- data/lib/voruby/services/loader.rb +0 -7
- data/lib/voruby/services/registry/registry.rb +0 -53
- data/lib/voruby/services/resolver/resolver.rb +0 -35
- data/lib/voruby/services/schema/schema.rb +0 -644
- data/lib/voruby/sesame/loader.rb +0 -6
- data/lib/voruby/sesame/sesame_v1_0.rb +0 -64
- data/lib/voruby/simple/loader.rb +0 -6
- data/lib/voruby/simple/parameters.rb +0 -196
- data/lib/voruby/simple/sap.rb +0 -446
- data/lib/voruby/spacetime/loader.rb +0 -3
- data/lib/voruby/spacetime/spacetime.rb +0 -607
- data/lib/voruby/stc/coords_v1_20.rb +0 -900
- data/lib/voruby/stc/loader.rb +0 -55
- data/lib/voruby/stc/region_v1_20.rb +0 -274
- data/lib/voruby/stc/stc_v1_20.rb +0 -1196
- data/lib/voruby/util.rb +0 -27
- data/lib/voruby/voevent/loader.rb +0 -7
- data/lib/voruby/voevent/voevent_v1_0.rb +0 -213
- data/lib/voruby/voevent/voevent_v1_1.rb +0 -196
- data/lib/voruby/votables/chandra.rb +0 -373
- data/lib/voruby/votables/data.rb +0 -179
- data/lib/voruby/votables/galex.rb +0 -377
- data/lib/voruby/votables/int.rb +0 -354
- data/lib/voruby/votables/libxml_parser.rb +0 -411
- data/lib/voruby/votables/libxml_votable.rb +0 -67
- data/lib/voruby/votables/loader.rb +0 -10
- data/lib/voruby/votables/meta.rb +0 -763
- data/lib/voruby/votables/misc.rb +0 -51
- data/lib/voruby/votables/nsa.rb +0 -410
- data/lib/voruby/votables/rexml_parser.rb +0 -408
- data/lib/voruby/votables/rexml_votable.rb +0 -67
- data/lib/voruby/votables/sdss.rb +0 -356
- data/lib/voruby/votables/transforms.rb +0 -388
- data/lib/voruby/votables/tree.rb +0 -45
- data/lib/voruby/votables/types.rb +0 -391
- data/lib/voruby/votables/votable.rb +0 -687
- data/test/active_votable/database.yml +0 -6
- data/test/active_votable/test.vot +0 -168492
- data/test/active_votable/unittest.rb +0 -41
- data/test/adql/test1.adql +0 -49
- data/test/adql/test2.adql +0 -51
- data/test/adql/test3.adql +0 -81
- data/test/adql/test4.adql +0 -53
- data/test/adql/test5.adql +0 -55
- data/test/adql/test6.adql +0 -18
- data/test/adql/test7.adql +0 -48
- data/test/adql/unittest.rb +0 -1672
- data/test/plastic/test.rb +0 -44
- data/test/plastic/test.vot +0 -5385
- data/test/plastic/unittest.rb +0 -66
- data/test/resources/conesearch/conesearch_v0_3.xml +0 -31
- data/test/resources/conesearch/conesearch_v1_0.xml +0 -86
- data/test/resources/conesearch/unittest_v0_3.rb +0 -22
- data/test/resources/conesearch/unittest_v1_0.rb +0 -24
- data/test/resources/openskynode/open_sky_node_v0_1.xml +0 -32
- data/test/resources/openskynode/unittest_v0_1.rb +0 -31
- data/test/resources/sia/simple_image_access_v0_7.xml +0 -36
- data/test/resources/sia/simple_image_access_v1_0.xml +0 -122
- data/test/resources/sia/unittest_v0_7.rb +0 -24
- data/test/resources/sia/unittest_v1_0.rb +0 -29
- data/test/resources/stsci.xml +0 -336
- data/test/resources/unittest_stsci.rb +0 -25
- data/test/resources/vodataservice/catalog_service_resource_v1_0.xml +0 -128
- data/test/resources/vodataservice/data_collection_resource_v0_5.xml +0 -54
- data/test/resources/vodataservice/data_collection_resource_v1_0.xml +0 -117
- data/test/resources/vodataservice/data_service_resource_v1_0.xml +0 -115
- data/test/resources/vodataservice/sky_service_resource_v0_10.xml +0 -45
- data/test/resources/vodataservice/table_service_resource_v1_0.xml +0 -122
- data/test/resources/vodataservice/tabular_sky_service_resource_v0_10.xml +0 -60
- data/test/resources/vodataservice/unittest_v0_5.rb +0 -126
- data/test/resources/vodataservice/unittest_v1_0.rb +0 -151
- data/test/resources/voregistry/authority_resource_v0_3.xml +0 -20
- data/test/resources/voregistry/authority_resource_v1_0.xml +0 -82
- data/test/resources/voregistry/registry_service_v0_3.xml +0 -20
- data/test/resources/voregistry/registry_service_v1_0.xml +0 -107
- data/test/resources/voregistry/unittest_v0_3.rb +0 -31
- data/test/resources/voregistry/unittest_v1_0.rb +0 -34
- data/test/resources/voresource/organisation_resource_v1_0.xml +0 -90
- data/test/resources/voresource/resource_organisation_v0_10.xml +0 -22
- data/test/resources/voresource/resource_service_v0_10.xml +0 -19
- data/test/resources/voresource/resource_v0_10.xml +0 -19
- data/test/resources/voresource/resource_v1_0.xml +0 -79
- data/test/resources/voresource/service_resource_v1_0.xml +0 -91
- data/test/resources/voresource/unittest_v0_10.rb +0 -61
- data/test/resources/voresource/unittest_v0_9.rb +0 -4
- data/test/resources/voresource/unittest_v1_0.rb +0 -190
- data/test/services/gestalt/unittest.rb +0 -74
- data/test/services/registry/unittest.rb +0 -34
- data/test/services/resolver/unittest.rb +0 -38
- data/test/simple/unittest.rb +0 -46
- data/test/spacetime/unittest.rb +0 -39
- data/test/stc/catalog_entry_location_v1_20.xml +0 -112
- data/test/stc/obs_data_location_v1_20.xml +0 -108
- data/test/stc/search_location_v1_20.xml +0 -54
- data/test/stc/stc_resource_profile_v1_20.xml +0 -60
- data/test/stc/unittest_v1_20.rb +0 -620
- data/test/voevent/unittest_v1_0.rb +0 -79
- data/test/voevent/unittest_v1_1.rb +0 -70
- data/test/voevent/voevent_v1_0.xml +0 -96
- data/test/votables/test.vot +0 -366
- data/test/votables/unittest.rb +0 -54
@@ -1,61 +0,0 @@
|
|
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
|
@@ -1,190 +0,0 @@
|
|
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_match('2006-08-14T08:00:00', @res.created.to_s)
|
15
|
-
assert_match('2006-08-14T13:26:00', @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
|
@@ -1,74 +0,0 @@
|
|
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
|
@@ -1,34 +0,0 @@
|
|
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
|
@@ -1,38 +0,0 @@
|
|
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
|
data/test/simple/unittest.rb
DELETED
@@ -1,46 +0,0 @@
|
|
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
|
-
|