Skip to content

Commit c564500

Browse files
committed
samples -> fixtures
1 parent 3a29219 commit c564500

File tree

102 files changed

+76
-76
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+76
-76
lines changed
File renamed without changes.

gulpfile.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ var exitCode = 0;
1111

1212
var json_paths = {
1313
examples: 'examples/**/*.json',
14-
models: 'samples/v2.0/json/models/**/*.json',
15-
resources: 'samples/v2.0/json/resources/**/*.json',
16-
responses: 'samples/v2.0/json/responses/**/*.json'
17-
// What are the other files in samples/v2.0/json/*.json
14+
models: 'fixtures/v2.0/json/models/**/*.json',
15+
resources: 'fixtures/v2.0/json/resources/**/*.json',
16+
responses: 'fixtures/v2.0/json/responses/**/*.json'
17+
// What are the other files in fixtures/v2.0/json/*.json
1818
};
1919

2020
gulp.task('lint', function() {
@@ -26,23 +26,23 @@ gulp.task('lint', function() {
2626
});
2727

2828
gulp.task('yaml2json', function(){
29-
gulp.src('./samples/v2.0/yaml/**.yaml')
29+
gulp.src('./fixtures/v2.0/yaml/**.yaml')
3030
.pipe(gulpyaml({ pretty: true }))
31-
.pipe(gulp.dest('./samples/v2.0/json'));
31+
.pipe(gulp.dest('./fixtures/v2.0/json'));
3232

3333
gulp.src(json_paths.examples)
3434
.pipe(gulpyaml({ pretty: true }))
3535
.pipe(gulp.dest('examples/'));
3636
});
3737

3838
gulp.task('json2yaml', function(){
39-
return gulp.src('./samples/v2.0/json/**/*.json')
39+
return gulp.src('./fixtures/v2.0/json/**/*.json')
4040
.pipe(map(function(file, cb) {
4141
data = JSON.parse(file.contents);
4242
file.contents = new Buffer(String(YAML.stringify(data)));
4343
cb(null, file);
4444
}))
4545
.pipe(ext_replace('.yaml'))
46-
.pipe(gulp.dest('samples/v2.0/yaml'));
46+
.pipe(gulp.dest('fixtures/v2.0/yaml'));
4747
});
4848

src/test/scala/ModelTest.scala

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ModelTest extends FlatSpec with ShouldMatchers with TestBase {
1818
val jsonSchema = factory.getJsonSchema(schema.get("definitions").get("schema"))
1919

2020
it should "validate a model with string property" in {
21-
val json = Source.fromFile("samples/v2.0/json/models/modelWithStringProperty.json").mkString
21+
val json = Source.fromFile("fixtures/v2.0/json/models/modelWithStringProperty.json").mkString
2222
val data = JsonLoader.fromString(json)
2323
val report = jsonSchema.validate(data)
2424
if(report.isSuccess == false)
@@ -27,7 +27,7 @@ class ModelTest extends FlatSpec with ShouldMatchers with TestBase {
2727
}
2828

2929
it should "validate a model with multiple properties" in {
30-
val json = Source.fromFile("samples/v2.0/json/models/modelWithMultipleProperties.json").mkString
30+
val json = Source.fromFile("fixtures/v2.0/json/models/modelWithMultipleProperties.json").mkString
3131
val data = JsonLoader.fromString(json)
3232
val report = jsonSchema.validate(data)
3333
if(report.isSuccess == false)
@@ -36,7 +36,7 @@ class ModelTest extends FlatSpec with ShouldMatchers with TestBase {
3636
}
3737

3838
it should "validate a model with an int32 map" in {
39-
val json = Source.fromFile("samples/v2.0/json/models/modelWithInt32Map.json").mkString
39+
val json = Source.fromFile("fixtures/v2.0/json/models/modelWithInt32Map.json").mkString
4040
val data = JsonLoader.fromString(json)
4141
val report = jsonSchema.validate(data)
4242
if(report.isSuccess == false)
@@ -45,7 +45,7 @@ class ModelTest extends FlatSpec with ShouldMatchers with TestBase {
4545
}
4646

4747
it should "validate a model with an int64 map" in {
48-
val json = Source.fromFile("samples/v2.0/json/models/modelWithInt64Map.json").mkString
48+
val json = Source.fromFile("fixtures/v2.0/json/models/modelWithInt64Map.json").mkString
4949
val data = JsonLoader.fromString(json)
5050
val report = jsonSchema.validate(data)
5151
if(report.isSuccess == false)
@@ -54,7 +54,7 @@ class ModelTest extends FlatSpec with ShouldMatchers with TestBase {
5454
}
5555

5656
it should "validate a model with an date-time map" in {
57-
val json = Source.fromFile("samples/v2.0/json/models/modelWithDateTimeMap.json").mkString
57+
val json = Source.fromFile("fixtures/v2.0/json/models/modelWithDateTimeMap.json").mkString
5858
val data = JsonLoader.fromString(json)
5959
val report = jsonSchema.validate(data)
6060
if(report.isSuccess == false)
@@ -63,11 +63,11 @@ class ModelTest extends FlatSpec with ShouldMatchers with TestBase {
6363
}
6464

6565
it should "validate a model with xml properties" in {
66-
val json = Source.fromFile("samples/v2.0/json/models/modelWithXmlAttributes.json").mkString
66+
val json = Source.fromFile("fixtures/v2.0/json/models/modelWithXmlAttributes.json").mkString
6767
val data = JsonLoader.fromString(json)
6868
val report = jsonSchema.validate(data)
6969
if(report.isSuccess == false)
7070
println(report)
7171
report.isSuccess should be (true)
7272
}
73-
}
73+
}

src/test/scala/ModelsTest.scala

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ModelsTest extends FlatSpec with ShouldMatchers with TestBase {
1818
val jsonSchema = factory.getJsonSchema(schema.get("definitions").get("schema"))
1919

2020
it should "validate a models hash" in {
21-
val json = Source.fromFile("samples/v2.0/json/models/models.json").mkString
21+
val json = Source.fromFile("fixtures/v2.0/json/models/models.json").mkString
2222
val data = JsonLoader.fromString(json)
2323
val report = jsonSchema.validate(data)
2424
if(report.isSuccess == false)
@@ -27,7 +27,7 @@ class ModelsTest extends FlatSpec with ShouldMatchers with TestBase {
2727
}
2828

2929
it should "validate multiple models" in {
30-
val json = Source.fromFile("samples/v2.0/json/models/multipleModels.json").mkString
30+
val json = Source.fromFile("fixtures/v2.0/json/models/multipleModels.json").mkString
3131
val data = JsonLoader.fromString(json)
3232
val report = jsonSchema.validate(data)
3333
if(report.isSuccess == false)
@@ -36,7 +36,7 @@ class ModelsTest extends FlatSpec with ShouldMatchers with TestBase {
3636
}
3737

3838
it should "validate models with examples" in {
39-
val json = Source.fromFile("samples/v2.0/json/models/modelWithExamples.json").mkString
39+
val json = Source.fromFile("fixtures/v2.0/json/models/modelWithExamples.json").mkString
4040
val data = JsonLoader.fromString(json)
4141
val report = jsonSchema.validate(data)
4242
if(report.isSuccess == false)
@@ -45,11 +45,11 @@ class ModelsTest extends FlatSpec with ShouldMatchers with TestBase {
4545
}
4646

4747
it should "validate models with composition" in {
48-
val json = Source.fromFile("samples/v2.0/json/models/modelWithComposition.json").mkString
48+
val json = Source.fromFile("fixtures/v2.0/json/models/modelWithComposition.json").mkString
4949
val data = JsonLoader.fromString(json)
5050
val report = jsonSchema.validate(data)
5151
if(report.isSuccess == false)
5252
println(report)
5353
report.isSuccess should be (true)
5454
}
55-
}
55+
}

src/test/scala/OperationsTest.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class OperationsTest extends FlatSpec with ShouldMatchers with TestBase {
1818
val jsonSchema = factory.getJsonSchema(schema.get("definitions").get("operation"))
1919

2020
it should "validate a resource with string path param" in {
21-
val json = Source.fromFile("samples/v2.0/json/resources/operations/stringPathParamResource.json").mkString
21+
val json = Source.fromFile("fixtures/v2.0/json/resources/operations/stringPathParamResource.json").mkString
2222
val data = JsonLoader.fromString(json)
2323
val report = jsonSchema.validate(data)
2424
if(report.isSuccess == false)
@@ -27,7 +27,7 @@ class OperationsTest extends FlatSpec with ShouldMatchers with TestBase {
2727
}
2828

2929
it should "validate a resource with string path param and boolean query param" in {
30-
val json = Source.fromFile("samples/v2.0/json/resources/operations/stringPathAndBoolQueryParamResource.json").mkString
30+
val json = Source.fromFile("fixtures/v2.0/json/resources/operations/stringPathAndBoolQueryParamResource.json").mkString
3131
val data = JsonLoader.fromString(json)
3232
val report = jsonSchema.validate(data)
3333
if(report.isSuccess == false)
@@ -36,11 +36,11 @@ class OperationsTest extends FlatSpec with ShouldMatchers with TestBase {
3636
}
3737

3838
it should "validate a resource with tags in the operation" in {
39-
val json = Source.fromFile("samples/v2.0/json/resources/operations/operationWithTags.json").mkString
39+
val json = Source.fromFile("fixtures/v2.0/json/resources/operations/operationWithTags.json").mkString
4040
val data = JsonLoader.fromString(json)
4141
val report = jsonSchema.validate(data)
4242
if(report.isSuccess == false)
4343
println(report)
4444
report.isSuccess should be (true)
4545
}
46-
}
46+
}

src/test/scala/ParameterTest.scala

+18-18
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ParameterTest extends FlatSpec with ShouldMatchers with TestBase {
1818
val jsonSchema = factory.getJsonSchema(schema.get("definitions").get("parameter"))
1919

2020
it should "validate a string query parameter" in {
21-
val json = Source.fromFile("samples/v2.0/json/resources/parameters/queryStringParameter.json").mkString
21+
val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/queryStringParameter.json").mkString
2222
val data = JsonLoader.fromString(json)
2323
val report = jsonSchema.validate(data)
2424
if(report.isSuccess == false)
@@ -27,7 +27,7 @@ class ParameterTest extends FlatSpec with ShouldMatchers with TestBase {
2727
}
2828

2929
it should "validate an int64 array query parameter" in {
30-
val json = Source.fromFile("samples/v2.0/json/resources/parameters/queryInt64ArrayParameter.json").mkString
30+
val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/queryInt64ArrayParameter.json").mkString
3131
val data = JsonLoader.fromString(json)
3232
val report = jsonSchema.validate(data)
3333
if(report.isSuccess == false)
@@ -36,14 +36,14 @@ class ParameterTest extends FlatSpec with ShouldMatchers with TestBase {
3636
}
3737

3838
it should "fail to validate a complex query parameter" in {
39-
val json = Source.fromFile("samples/v2.0/json/resources/parameters/queryWithComplexParameter.json").mkString
39+
val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/queryWithComplexParameter.json").mkString
4040
val data = JsonLoader.fromString(json)
4141
val report = jsonSchema.validate(data)
4242
report.isSuccess should be (false)
4343
}
4444

4545
it should "validate a string header parameter" in {
46-
val json = Source.fromFile("samples/v2.0/json/resources/parameters/headerStringParameter.json").mkString
46+
val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/headerStringParameter.json").mkString
4747
val data = JsonLoader.fromString(json)
4848
val report = jsonSchema.validate(data)
4949
if(report.isSuccess == false)
@@ -52,7 +52,7 @@ class ParameterTest extends FlatSpec with ShouldMatchers with TestBase {
5252
}
5353

5454
it should "validate a string array header parameter" in {
55-
val json = Source.fromFile("samples/v2.0/json/resources/parameters/headerStringArrayParameter.json").mkString
55+
val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/headerStringArrayParameter.json").mkString
5656
val data = JsonLoader.fromString(json)
5757
val report = jsonSchema.validate(data)
5858
if(report.isSuccess == false)
@@ -61,7 +61,7 @@ class ParameterTest extends FlatSpec with ShouldMatchers with TestBase {
6161
}
6262

6363
it should "validate a int64 array header parameter" in {
64-
val json = Source.fromFile("samples/v2.0/json/resources/parameters/headerInt64ArrayParameter.json").mkString
64+
val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/headerInt64ArrayParameter.json").mkString
6565
val data = JsonLoader.fromString(json)
6666
val report = jsonSchema.validate(data)
6767
if(report.isSuccess == false)
@@ -70,7 +70,7 @@ class ParameterTest extends FlatSpec with ShouldMatchers with TestBase {
7070
}
7171

7272
it should "validate a string path parameter" in {
73-
val json = Source.fromFile("samples/v2.0/json/resources/parameters/pathStringParameter.json").mkString
73+
val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/pathStringParameter.json").mkString
7474
val data = JsonLoader.fromString(json)
7575
val report = jsonSchema.validate(data)
7676
if(report.isSuccess == false)
@@ -79,7 +79,7 @@ class ParameterTest extends FlatSpec with ShouldMatchers with TestBase {
7979
}
8080

8181
it should "validate a int64 path parameter" in {
82-
val json = Source.fromFile("samples/v2.0/json/resources/parameters/pathInt64Parameter.json").mkString
82+
val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/pathInt64Parameter.json").mkString
8383
val data = JsonLoader.fromString(json)
8484
val report = jsonSchema.validate(data)
8585
if(report.isSuccess == false)
@@ -88,7 +88,7 @@ class ParameterTest extends FlatSpec with ShouldMatchers with TestBase {
8888
}
8989

9090
it should "validate a string array path parameter" in {
91-
val json = Source.fromFile("samples/v2.0/json/resources/parameters/pathStringArrayParameter.json").mkString
91+
val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/pathStringArrayParameter.json").mkString
9292
val data = JsonLoader.fromString(json)
9393
val report = jsonSchema.validate(data)
9494
if(report.isSuccess == false)
@@ -97,7 +97,7 @@ class ParameterTest extends FlatSpec with ShouldMatchers with TestBase {
9797
}
9898

9999
it should "validate an int64 body parameter" in {
100-
val json = Source.fromFile("samples/v2.0/json/resources/parameters/bodyInt64Parameter.json").mkString
100+
val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/bodyInt64Parameter.json").mkString
101101
val data = JsonLoader.fromString(json)
102102
val report = jsonSchema.validate(data)
103103
if(report.isSuccess == false)
@@ -106,7 +106,7 @@ class ParameterTest extends FlatSpec with ShouldMatchers with TestBase {
106106
}
107107

108108
it should "validate a string body parameter" in {
109-
val json = Source.fromFile("samples/v2.0/json/resources/parameters/bodyStringParameter.json").mkString
109+
val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/bodyStringParameter.json").mkString
110110
val data = JsonLoader.fromString(json)
111111
val report = jsonSchema.validate(data)
112112
if(report.isSuccess == false)
@@ -115,7 +115,7 @@ class ParameterTest extends FlatSpec with ShouldMatchers with TestBase {
115115
}
116116

117117
it should "validate a string array body parameter" in {
118-
val json = Source.fromFile("samples/v2.0/json/resources/parameters/bodyStringArrayParameter.json").mkString
118+
val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/bodyStringArrayParameter.json").mkString
119119
val data = JsonLoader.fromString(json)
120120
val report = jsonSchema.validate(data)
121121
if(report.isSuccess == false)
@@ -124,7 +124,7 @@ class ParameterTest extends FlatSpec with ShouldMatchers with TestBase {
124124
}
125125

126126
it should "validate a complex body parameter" in {
127-
val json = Source.fromFile("samples/v2.0/json/resources/parameters/bodyComplexParameter.json").mkString
127+
val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/bodyComplexParameter.json").mkString
128128
val data = JsonLoader.fromString(json)
129129
val report = jsonSchema.validate(data)
130130
if(report.isSuccess == false)
@@ -133,7 +133,7 @@ class ParameterTest extends FlatSpec with ShouldMatchers with TestBase {
133133
}
134134

135135
it should "validate a complex body array parameter" in {
136-
val json = Source.fromFile("samples/v2.0/json/resources/parameters/bodyComplexArrayParameter.json").mkString
136+
val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/bodyComplexArrayParameter.json").mkString
137137
val data = JsonLoader.fromString(json)
138138
val report = jsonSchema.validate(data)
139139
if(report.isSuccess == false)
@@ -142,7 +142,7 @@ class ParameterTest extends FlatSpec with ShouldMatchers with TestBase {
142142
}
143143

144144
it should "validate an int64 form data parameter" in {
145-
val json = Source.fromFile("samples/v2.0/json/resources/parameters/formDataInt64Parameter.json").mkString
145+
val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/formDataInt64Parameter.json").mkString
146146
val data = JsonLoader.fromString(json)
147147
val report = jsonSchema.validate(data)
148148
if(report.isSuccess == false)
@@ -151,7 +151,7 @@ class ParameterTest extends FlatSpec with ShouldMatchers with TestBase {
151151
}
152152

153153
it should "validate a string array form data parameter" in {
154-
val json = Source.fromFile("samples/v2.0/json/resources/parameters/formDataStringArrayParameter.json").mkString
154+
val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/formDataStringArrayParameter.json").mkString
155155
val data = JsonLoader.fromString(json)
156156
val report = jsonSchema.validate(data)
157157
if(report.isSuccess == false)
@@ -160,9 +160,9 @@ class ParameterTest extends FlatSpec with ShouldMatchers with TestBase {
160160
}
161161

162162
ignore should "fail to validate a complex form data parameter" in {
163-
val json = Source.fromFile("samples/v2.0/json/resources/parameters/formDataComplexParameter.json").mkString
163+
val json = Source.fromFile("fixtures/v2.0/json/resources/parameters/formDataComplexParameter.json").mkString
164164
val data = JsonLoader.fromString(json)
165165
val report = jsonSchema.validate(data)
166166
report.isSuccess should be (false)
167167
}
168-
}
168+
}

0 commit comments

Comments
 (0)