adiwg-json_schemas 0.5.0 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -2
- data/examples/full_example.json +2 -3
- data/examples/lcc_project_example.json +1 -1
- data/examples/uri.json +9 -1
- data/lib/adiwg/json_schemas/version.rb +1 -1
- data/schema/schema/citation.json +37 -28
- data/schema/schema/contact.json +2 -2
- data/schema/schema/dataQuality.json +1 -1
- data/schema/schema/distributor.json +1 -1
- data/schema/schema/extent.json +11 -3
- data/schema/schema/geojson/geojson.json +4 -1
- data/schema/schema/keyword.json +1 -1
- data/schema/schema/metadata.json +7 -7
- data/schema/schema/resolution.json +2 -0
- data/schema/schema/resourceInfo.json +15 -15
- data/schema/schema.json +1 -1
- data/test/tc_schemas.rb +121 -115
- data/test/tc_utils.rb +1 -1
- metadata +2 -4
- data/examples/adiwg_project_example_1.json +0 -847
- data/examples/data_example.json +0 -371
data/test/tc_schemas.rb
CHANGED
@@ -6,123 +6,129 @@
|
|
6
6
|
=end
|
7
7
|
|
8
8
|
require "test/unit"
|
9
|
-
require
|
9
|
+
require "json"
|
10
10
|
require 'json-schema'
|
11
|
+
require File.dirname(__FILE__) + '/../lib/adiwg-json_schemas.rb'
|
11
12
|
|
12
13
|
class TestExamples < Test::Unit::TestCase
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
15
|
+
@@dir = File.dirname(__FILE__) + '/../schema/'
|
16
|
+
@@ex = File.dirname(__FILE__) + '/../examples/'
|
17
|
+
@@schema = File.dirname(__FILE__) + '/../schema/schema.json'
|
18
|
+
|
19
|
+
def test_data_template
|
20
|
+
errors = JSON::Validator.fully_validate(@@schema, @@dir + '../templates/adiwg_metadata_template.json', :strict => false)
|
21
|
+
assert(errors.empty?, errors.join("/n"))
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_full_example
|
25
|
+
errors = JSON::Validator.fully_validate(@@schema , @@ex + 'full_example.json')
|
26
|
+
assert(errors.empty?, errors.join("/n"))
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_lcc_example
|
30
|
+
errors = JSON::Validator.fully_validate(@@schema , @@ex + 'lcc_project_example.json')
|
31
|
+
assert(errors.empty?, errors.join("/n"))
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_contact
|
35
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/contact.json', @@ex + 'contact.json')
|
36
|
+
assert(errors.empty?, errors.join("/n"))
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_citation
|
40
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/citation.json', @@ex + 'citation.json', :list => true)
|
41
|
+
assert(errors.empty?, errors.join("/n"))
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_taxonomy
|
45
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/taxonomy.json', @@ex + 'taxonomy.json', :list => true)
|
46
|
+
assert(errors.empty?, errors.join("/n"))
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_usage
|
50
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/usage.json', @@ex + 'usage.json', :list => true)
|
51
|
+
assert(errors.empty?, errors.join("/n"))
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_resolution
|
55
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/resolution.json', @@ex + 'resolution.json', :list => true)
|
56
|
+
assert(errors.empty?, errors.join("/n"))
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_graphicOverview
|
60
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/graphicOverview.json', @@ex + 'graphicOverview.json', :list => true)
|
61
|
+
assert(errors.empty?, errors.join("/n"))
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_resourceInfo
|
65
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/resourceInfo.json', @@ex + 'resourceInfo.json', :list => true)
|
66
|
+
assert(errors.empty?, errors.join("/n"))
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_onlineResource
|
70
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/onlineResource.json', @@ex + 'onlineResource.json', :list => true)
|
71
|
+
assert(errors.empty?, errors.join("/n"))
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_resourceConstraint
|
75
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/resourceConstraint.json', @@ex + 'resourceConstraints.json', :list => true)
|
76
|
+
assert(errors.empty?, errors.join("/n"))
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_date
|
80
|
+
errors = JSON::Validator.fully_validate(@@schema, @@ex + 'date.json', :fragment => "#/definitions/date", :list => true)
|
81
|
+
assert(errors.empty?, errors.join("/n"))
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_contactRef
|
85
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/contact.json', @@ex + 'contactRef.json', :fragment => "#/definitions/contactRef", :list => true)
|
86
|
+
assert(errors.empty?, errors.join("/n"))
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_keywords
|
90
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/keyword.json', @@ex + 'keywords.json', :list => true)
|
91
|
+
assert(errors.empty?, errors.join("/n"))
|
92
|
+
end
|
93
|
+
|
94
|
+
def test_distributor
|
95
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/distributor.json', @@ex + 'distributor.json', :list => true)
|
96
|
+
assert(errors.empty?, errors.join("/n"))
|
97
|
+
end
|
98
|
+
|
99
|
+
def test_geojson
|
100
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/geojson/geojson.json', @@ex + 'geojson.json', :list => true)
|
101
|
+
assert(errors.empty?, errors.join("/n"))
|
102
|
+
end
|
103
|
+
|
104
|
+
def test_extent_linestring
|
105
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/extent.json', @@ex + 'extent_linestring.json', :list => true)
|
106
|
+
assert(errors.empty?, errors.join("/n"))
|
107
|
+
end
|
108
|
+
|
109
|
+
def test_extent_point
|
110
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/extent.json', @@ex + 'extent_point.json', :list => true)
|
111
|
+
assert(errors.empty?, errors.join("/n"))
|
112
|
+
end
|
113
|
+
|
114
|
+
def test_extent_polygon
|
115
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/extent.json', @@ex + 'extent_polygon.json', :list => true)
|
116
|
+
assert(errors.empty?, errors.join("/n"))
|
117
|
+
end
|
118
|
+
|
119
|
+
def test_maintInfo
|
120
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/maintInfo.json', @@ex + 'maintInfo.json', :list => true)
|
121
|
+
errors = errors + JSON::Validator.fully_validate(@@dir + 'schema/maintInfo.json', @@ex + 'resourceMaintenance.json', :list => true)
|
122
|
+
assert(errors.empty?, errors.join("/n"))
|
123
|
+
end
|
124
|
+
|
125
|
+
def test_dataQuality
|
126
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/dataQuality.json', @@ex + 'dataQuality.json', :list => true)
|
127
|
+
assert(errors.empty?, errors.join("/n"))
|
128
|
+
end
|
129
|
+
|
130
|
+
def test_uri
|
131
|
+
errors = JSON::Validator.fully_validate(@@schema, @@ex + 'uri.json', :fragment => "#/definitions/uri", :list => true)
|
132
|
+
assert(errors.empty?, errors.join("/n"))
|
133
|
+
end
|
128
134
|
end
|
data/test/tc_utils.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adiwg-json_schemas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Bradley, Stan Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -82,12 +82,10 @@ files:
|
|
82
82
|
- README.md
|
83
83
|
- Rakefile
|
84
84
|
- adiwg-json_schemas.gemspec
|
85
|
-
- examples/adiwg_project_example_1.json
|
86
85
|
- examples/citation.json
|
87
86
|
- examples/contact.json
|
88
87
|
- examples/contactRef.json
|
89
88
|
- examples/dataQuality.json
|
90
|
-
- examples/data_example.json
|
91
89
|
- examples/date.json
|
92
90
|
- examples/distributor.json
|
93
91
|
- examples/extent_linestring.json
|