1818
1919import com .fasterxml .jackson .databind .JsonNode ;
2020import com .fasterxml .jackson .databind .ObjectMapper ;
21+ import org .junit .jupiter .api .Disabled ;
2122import org .junit .jupiter .api .Test ;
2223
2324import java .io .IOException ;
@@ -40,13 +41,51 @@ public void testLoadingWithId() throws Exception {
4041 JsonSchema schema = factory .getSchema (schemaJson );
4142 }
4243
44+ @ Test
45+ @ Disabled
46+ public void testFormatDateTimeValidator () throws Exception {
47+ runTestFile ("draft4/optional/format/date-time.json" );
48+ }
49+
50+ @ Test
51+ public void testFormatEmailValidator () throws Exception {
52+ runTestFile ("draft4/optional/format/email.json" );
53+ }
54+
55+ @ Test
56+ public void testFormatHostnameValidator () throws Exception {
57+ runTestFile ("draft4/optional/format/hostname.json" );
58+ }
59+
60+ @ Test
61+ @ Disabled
62+ public void testFormatIpv4Validator () throws Exception {
63+ runTestFile ("draft4/optional/format/ipv4.json" );
64+ }
65+
66+ @ Test
67+ @ Disabled
68+ public void testFormatIpv6Validator () throws Exception {
69+ runTestFile ("draft4/optional/format/ipv6.json" );
70+ }
71+
72+ @ Test
73+ public void testFormatUnknownValidator () throws Exception {
74+ runTestFile ("draft4/optional/format/unknown.json" );
75+ }
76+
77+ @ Test
78+ public void testFormatUriValidator () throws Exception {
79+ runTestFile ("draft4/optional/format/uri.json" );
80+ }
81+
4382 @ Test
4483 public void testBignumValidator () throws Exception {
4584 runTestFile ("draft4/optional/bignum.json" );
4685 }
4786
4887 @ Test
49- public void testFormatValidator () throws Exception {
88+ public void testOptionalFormatValidator () throws Exception {
5089 runTestFile ("draft4/optional/format.json" );
5190 }
5291
@@ -55,6 +94,16 @@ public void testComplexSchema() throws Exception {
5594 runTestFile ("draft4/optional/complex.json" );
5695 }
5796
97+ @ Test
98+ public void testFloatOverflowValidator () throws Exception {
99+ runTestFile ("draft4/optional/float-overflow.json" );
100+ }
101+
102+ @ Test
103+ public void testNonBmpRegexValidator () throws Exception {
104+ runTestFile ("draft4/optional/non-bmp-regex.json" );
105+ }
106+
58107 @ Test
59108 public void testZeroTerminatedFloatsValidator () throws Exception {
60109 runTestFile ("draft4/optional/zeroTerminatedFloats.json" );
@@ -100,6 +149,22 @@ public void testEnumValidator() throws Exception {
100149 runTestFile ("draft4/enum.json" );
101150 }
102151
152+ @ Test
153+ public void testFormatValidator () throws Exception {
154+ runTestFile ("draft4/format.json" );
155+ }
156+
157+ @ Test
158+ @ Disabled
159+ public void testIdValidator () throws Exception {
160+ runTestFile ("draft4/id.json" );
161+ }
162+
163+ @ Test
164+ public void testInfiniteLoopDetectionValidator () throws Exception {
165+ runTestFile ("draft4/infinite-loop-detection.json" );
166+ }
167+
103168 @ Test
104169 public void testItemsValidator () throws Exception {
105170 runTestFile ("draft4/items.json" );
@@ -207,7 +272,7 @@ public void testTypeValidator() throws Exception {
207272
208273 @ Test
209274 public void testUnionTypeValidator () throws Exception {
210- runTestFile ("draft4/union_type.json" );
275+ runTestFile ("draft4/extra/ union_type.json" );
211276 }
212277
213278 @ Test
@@ -222,17 +287,17 @@ public void testEnumObject() throws Exception {
222287
223288 @ Test
224289 public void testIdSchemaWithUrl () throws Exception {
225- runTestFile ("draft4/property.json" );
290+ runTestFile ("draft4/extra/ property.json" );
226291 }
227292
228293 @ Test
229294 public void testSchemaFromClasspath () throws Exception {
230- runTestFile ("draft4/classpath/schema.json" );
295+ runTestFile ("draft4/extra/ classpath/schema.json" );
231296 }
232297
233298 @ Test
234299 public void testUUIDValidator () throws Exception {
235- runTestFile ("draft4/uuid.json" );
300+ runTestFile ("draft4/extra/ uuid.json" );
236301 }
237302
238303 /**
@@ -241,7 +306,7 @@ public void testUUIDValidator() throws Exception {
241306 @ Test
242307 public void testFailFast_AllErrors () throws IOException {
243308 try {
244- validateFailingFastSchemaFor ("product.schema.json" , "product-all-errors-data.json" );
309+ validateFailingFastSchemaFor ("extra/ product/product .schema.json" , "extra/product/ product-all-errors-data.json" );
245310 fail ("Exception must be thrown" );
246311 } catch (JsonSchemaException e ) {
247312 final Set <ValidationMessage > messages = e .getValidationMessages ();
@@ -255,7 +320,7 @@ public void testFailFast_AllErrors() throws IOException {
255320 @ Test
256321 public void testFailFast_OneErrors () throws IOException {
257322 try {
258- validateFailingFastSchemaFor ("product.schema.json" , "product-one-error-data.json" );
323+ validateFailingFastSchemaFor ("extra/ product/product .schema.json" , "extra/product/ product-one-error-data.json" );
259324 fail ("Exception must be thrown" );
260325 } catch (JsonSchemaException e ) {
261326 final Set <ValidationMessage > messages = e .getValidationMessages ();
@@ -269,7 +334,7 @@ public void testFailFast_OneErrors() throws IOException {
269334 @ Test
270335 public void testFailFast_TwoErrors () throws IOException {
271336 try {
272- validateFailingFastSchemaFor ("product.schema.json" , "product-two-errors-data.json" );
337+ validateFailingFastSchemaFor ("extra/ product/product .schema.json" , "extra/product/ product-two-errors-data.json" );
273338 fail ("Exception must be thrown" );
274339 } catch (JsonSchemaException e ) {
275340 final Set <ValidationMessage > messages = e .getValidationMessages ();
@@ -283,7 +348,7 @@ public void testFailFast_TwoErrors() throws IOException {
283348 @ Test
284349 public void testFailFast_NoErrors () throws IOException {
285350 try {
286- final Set <ValidationMessage > messages = validateFailingFastSchemaFor ("product.schema.json" , "product-no-errors-data.json" );
351+ final Set <ValidationMessage > messages = validateFailingFastSchemaFor ("extra/ product/product .schema.json" , "extra/product/ product-no-errors-data.json" );
287352 assertTrue (messages .isEmpty ());
288353 } catch (JsonSchemaException e ) {
289354 fail ("Must not get an errors" );
0 commit comments