You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2018/07/05 18:06:13 UTC
[juneau] branch master updated: Implement OpenApiPartSerializer
This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new ec054fd Implement OpenApiPartSerializer
ec054fd is described below
commit ec054fd83a3049acea3991e169858b137a96e1b0
Author: JamesBognar <ja...@apache.org>
AuthorDate: Thu Jul 5 14:05:58 2018 -0400
Implement OpenApiPartSerializer
---
.../juneau/httppart/HttpPartSchemaTest_Body.java | 174 ++++++-------
.../httppart/HttpPartSchemaTest_FormData.java | 178 +++++++-------
.../juneau/httppart/HttpPartSchemaTest_Header.java | 176 +++++++-------
.../juneau/httppart/HttpPartSchemaTest_Path.java | 172 ++++++-------
.../juneau/httppart/HttpPartSchemaTest_Query.java | 178 +++++++-------
.../httppart/HttpPartSchemaTest_Response.java | 170 ++++++-------
.../HttpPartSchemaTest_ResponseHeader.java | 172 ++++++-------
.../java/org/apache/juneau/dto/LinkString.java | 7 +-
.../org/apache/juneau/http/annotation/Body.java | 3 +-
.../apache/juneau/http/annotation/FormData.java | 39 +--
.../org/apache/juneau/http/annotation/Header.java | 38 +--
.../org/apache/juneau/http/annotation/Path.java | 27 +--
.../org/apache/juneau/http/annotation/Query.java | 39 +--
.../org/apache/juneau/httppart/HttpPartParser.java | 4 +-
.../org/apache/juneau/httppart/HttpPartSchema.java | 84 +++----
.../juneau/httppart/HttpPartSchemaBuilder.java | 6 +-
.../apache/juneau/httppart/HttpPartSerializer.java | 4 +-
.../apache/juneau/httppart/OpenApiPartParser.java | 270 ++++++++++-----------
.../juneau/httppart/OpenApiPartSerializer.java | 164 ++++++++++++-
...ception.java => SchemaValidationException.java} | 4 +-
.../SchemaValidationSerializeException.java | 34 ---
.../org/apache/juneau/httppart/UonPartParser.java | 6 +-
.../apache/juneau/httppart/UonPartSerializer.java | 7 +-
.../org/apache/juneau/rest/client/RestCall.java | 6 +-
.../rest/client/SerializedNameValuePair.java | 2 +-
.../java/org/apache/juneau/rest/RequestBody.java | 4 +-
.../org/apache/juneau/rest/RequestFormData.java | 6 +-
.../org/apache/juneau/rest/RequestHeaders.java | 4 +-
.../org/apache/juneau/rest/RequestPathMatch.java | 4 +-
.../java/org/apache/juneau/rest/RequestQuery.java | 6 +-
.../org/apache/juneau/rest/RestParamDefaults.java | 2 +-
31 files changed, 1031 insertions(+), 959 deletions(-)
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Body.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Body.java
index 0a7242e..b708c9c 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Body.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Body.java
@@ -269,13 +269,13 @@ public class HttpPartSchemaTest_Body {
try {
s.validateInput(null);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("No value specified.", e.getLocalizedMessage());
}
try {
s.validateInput("");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Empty value not allowed.", e.getLocalizedMessage());
}
}
@@ -297,13 +297,13 @@ public class HttpPartSchemaTest_Body {
try {
s.validateInput("");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match expected pattern. Must match pattern: x.*", e.getLocalizedMessage());
}
try {
s.validateInput("y");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match expected pattern. Must match pattern: x.*", e.getLocalizedMessage());
}
}
@@ -340,13 +340,13 @@ public class HttpPartSchemaTest_Body {
try {
s.validateInput("1");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
}
@@ -389,50 +389,50 @@ public class HttpPartSchemaTest_Body {
try {
s.getItems().validateInput("1");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("12");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("123");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("12345");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("123456");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("1234567");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
}
@@ -449,7 +449,7 @@ public class HttpPartSchemaTest_Body {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -466,7 +466,7 @@ public class HttpPartSchemaTest_Body {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -483,7 +483,7 @@ public class HttpPartSchemaTest_Body {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -516,25 +516,25 @@ public class HttpPartSchemaTest_Body {
try {
s.getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['W']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['Y']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['Z']", e.getLocalizedMessage());
}
}
@@ -555,13 +555,13 @@ public class HttpPartSchemaTest_Body {
try {
s.validateOutput(9, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -599,50 +599,50 @@ public class HttpPartSchemaTest_Body {
try {
s.getItems().validateOutput(9, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(99, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(999, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(9999, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -659,13 +659,13 @@ public class HttpPartSchemaTest_Body {
try {
s.validateOutput(10, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -703,50 +703,50 @@ public class HttpPartSchemaTest_Body {
try {
s.getItems().validateOutput(10, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -763,13 +763,13 @@ public class HttpPartSchemaTest_Body {
try {
s.validateOutput(10f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -807,50 +807,50 @@ public class HttpPartSchemaTest_Body {
try {
s.getItems().validateOutput(10f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -867,13 +867,13 @@ public class HttpPartSchemaTest_Body {
try {
s.validateOutput(10.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -911,50 +911,50 @@ public class HttpPartSchemaTest_Body {
try {
s.getItems().validateOutput(10.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -974,7 +974,7 @@ public class HttpPartSchemaTest_Body {
try {
s.validateOutput(11, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1027,25 +1027,25 @@ public class HttpPartSchemaTest_Body {
try {
s.getItems().validateOutput(11, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1063,7 +1063,7 @@ public class HttpPartSchemaTest_Body {
try {
s.validateOutput(10.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1106,25 +1106,25 @@ public class HttpPartSchemaTest_Body {
try {
s.getItems().validateOutput(10.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1164,25 +1164,25 @@ public class HttpPartSchemaTest_Body {
try {
s.getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
}
@@ -1204,25 +1204,25 @@ public class HttpPartSchemaTest_Body {
try {
s.getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
}
@@ -1260,50 +1260,50 @@ public class HttpPartSchemaTest_Body {
try {
s.getItems().validateOutput(new String[0], BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(split("1"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(split("1,2"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(split("1,2,3"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(split("1,2,3"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(split("1,2,3,4"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(split("1,2,3,4,5"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(split("1,2,3,4,5,6"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
}
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_FormData.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_FormData.java
index d8c125a..9f7a030 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_FormData.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_FormData.java
@@ -388,13 +388,13 @@ public class HttpPartSchemaTest_FormData {
try {
s.validateInput(null);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("No value specified.", e.getLocalizedMessage());
}
try {
s.validateInput("");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Empty value not allowed.", e.getLocalizedMessage());
}
}
@@ -422,7 +422,7 @@ public class HttpPartSchemaTest_FormData {
try {
s.validateInput(null);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("No value specified.", e.getLocalizedMessage());
}
}
@@ -438,19 +438,19 @@ public class HttpPartSchemaTest_FormData {
try {
s.validateInput("y");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match expected pattern. Must match pattern: x.*", e.getLocalizedMessage());
}
try {
s.validateInput("yx");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match expected pattern. Must match pattern: x.*", e.getLocalizedMessage());
}
try {
s.validateInput(""); // Empty headers are never allowed.
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Empty value not allowed.", e.getLocalizedMessage());
}
}
@@ -467,13 +467,13 @@ public class HttpPartSchemaTest_FormData {
try {
s.validateInput("1");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
}
@@ -514,50 +514,50 @@ public class HttpPartSchemaTest_FormData {
try {
s.getItems().validateInput("1");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("12");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("123");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("12345");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("123456");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("1234567");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
}
@@ -574,7 +574,7 @@ public class HttpPartSchemaTest_FormData {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -591,7 +591,7 @@ public class HttpPartSchemaTest_FormData {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -608,7 +608,7 @@ public class HttpPartSchemaTest_FormData {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -639,25 +639,25 @@ public class HttpPartSchemaTest_FormData {
try {
s.getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['W']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['Y']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['Z']", e.getLocalizedMessage());
}
}
@@ -678,13 +678,13 @@ public class HttpPartSchemaTest_FormData {
try {
s.validateOutput(9, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -720,50 +720,50 @@ public class HttpPartSchemaTest_FormData {
try {
s.getItems().validateOutput(9, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(99, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(999, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(9999, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -780,13 +780,13 @@ public class HttpPartSchemaTest_FormData {
try {
s.validateOutput(10, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -822,50 +822,50 @@ public class HttpPartSchemaTest_FormData {
try {
s.getItems().validateOutput(10, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -882,13 +882,13 @@ public class HttpPartSchemaTest_FormData {
try {
s.validateOutput(10f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -924,50 +924,50 @@ public class HttpPartSchemaTest_FormData {
try {
s.getItems().validateOutput(10f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -984,13 +984,13 @@ public class HttpPartSchemaTest_FormData {
try {
s.validateOutput(10.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -1026,50 +1026,50 @@ public class HttpPartSchemaTest_FormData {
try {
s.getItems().validateOutput(10.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -1089,7 +1089,7 @@ public class HttpPartSchemaTest_FormData {
try {
s.validateOutput(11, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1140,25 +1140,25 @@ public class HttpPartSchemaTest_FormData {
try {
s.getItems().validateOutput(11, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1176,7 +1176,7 @@ public class HttpPartSchemaTest_FormData {
try {
s.validateOutput(10.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1217,25 +1217,25 @@ public class HttpPartSchemaTest_FormData {
try {
s.getItems().validateOutput(10.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1274,25 +1274,25 @@ public class HttpPartSchemaTest_FormData {
try {
s.getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
}
@@ -1314,25 +1314,25 @@ public class HttpPartSchemaTest_FormData {
try {
s.getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
}
@@ -1369,50 +1369,50 @@ public class HttpPartSchemaTest_FormData {
try {
s.getItems().validateOutput(new String[0], BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(split("1"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(split("1,2"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(split("1,2,3"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(split("1,2,3"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(split("1,2,3,4"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(split("1,2,3,4,5"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(split("1,2,3,4,5,6"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
}
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Header.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Header.java
index eb4bc39..08e92f9 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Header.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Header.java
@@ -386,13 +386,13 @@ public class HttpPartSchemaTest_Header {
try {
s.validateInput(null);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("No value specified.", e.getLocalizedMessage());
}
try {
s.validateInput(""); // Empty headers are never allowed.
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Empty value not allowed.", e.getLocalizedMessage());
}
}
@@ -408,19 +408,19 @@ public class HttpPartSchemaTest_Header {
try {
s.validateInput("y");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match expected pattern. Must match pattern: x.*", e.getLocalizedMessage());
}
try {
s.validateInput("yx");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match expected pattern. Must match pattern: x.*", e.getLocalizedMessage());
}
try {
s.validateInput(""); // Empty headers are never allowed.
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Empty value not allowed.", e.getLocalizedMessage());
}
}
@@ -437,13 +437,13 @@ public class HttpPartSchemaTest_Header {
try {
s.validateInput("1");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
}
@@ -484,50 +484,50 @@ public class HttpPartSchemaTest_Header {
try {
s.getItems().validateInput("1");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("12");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("123");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("12345");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("123456");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("1234567");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
}
@@ -544,7 +544,7 @@ public class HttpPartSchemaTest_Header {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -561,7 +561,7 @@ public class HttpPartSchemaTest_Header {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -578,7 +578,7 @@ public class HttpPartSchemaTest_Header {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -609,25 +609,25 @@ public class HttpPartSchemaTest_Header {
try {
s.getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['W']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['Y']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['Z']", e.getLocalizedMessage());
}
}
@@ -648,13 +648,13 @@ public class HttpPartSchemaTest_Header {
try {
s.validateOutput(9, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -690,50 +690,50 @@ public class HttpPartSchemaTest_Header {
try {
s.getItems().validateOutput(9, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(99, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(999, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(9999, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -750,13 +750,13 @@ public class HttpPartSchemaTest_Header {
try {
s.validateOutput(10, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -792,50 +792,50 @@ public class HttpPartSchemaTest_Header {
try {
s.getItems().validateOutput(10, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -852,13 +852,13 @@ public class HttpPartSchemaTest_Header {
try {
s.validateOutput(10f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -894,50 +894,50 @@ public class HttpPartSchemaTest_Header {
try {
s.getItems().validateOutput(10f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -954,13 +954,13 @@ public class HttpPartSchemaTest_Header {
try {
s.validateOutput(10.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -996,50 +996,50 @@ public class HttpPartSchemaTest_Header {
try {
s.getItems().validateOutput(10.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -1059,7 +1059,7 @@ public class HttpPartSchemaTest_Header {
try {
s.validateOutput(11, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1110,25 +1110,25 @@ public class HttpPartSchemaTest_Header {
try {
s.getItems().validateOutput(11, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1146,7 +1146,7 @@ public class HttpPartSchemaTest_Header {
try {
s.validateOutput(10.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1187,25 +1187,25 @@ public class HttpPartSchemaTest_Header {
try {
s.getItems().validateOutput(10.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1244,25 +1244,25 @@ public class HttpPartSchemaTest_Header {
try {
s.getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
}
@@ -1284,25 +1284,25 @@ public class HttpPartSchemaTest_Header {
try {
s.getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
}
@@ -1339,50 +1339,50 @@ public class HttpPartSchemaTest_Header {
try {
s.getItems().validateOutput(new String[0], BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(split("1"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(split("1,2"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(split("1,2,3"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(split("1,2,3"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(split("1,2,3,4"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(split("1,2,3,4,5"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(split("1,2,3,4,5,6"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
}
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Path.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Path.java
index 2f855e0..4d7194d 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Path.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Path.java
@@ -351,19 +351,19 @@ public class HttpPartSchemaTest_Path {
try {
s.validateInput("y");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match expected pattern. Must match pattern: x.*", e.getLocalizedMessage());
}
try {
s.validateInput("yx");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match expected pattern. Must match pattern: x.*", e.getLocalizedMessage());
}
try {
s.validateInput(""); // Empty headers are never allowed.
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Empty value not allowed.", e.getLocalizedMessage());
}
}
@@ -380,13 +380,13 @@ public class HttpPartSchemaTest_Path {
try {
s.validateInput("1");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
}
@@ -427,50 +427,50 @@ public class HttpPartSchemaTest_Path {
try {
s.getItems().validateInput("1");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("12");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("123");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("12345");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("123456");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("1234567");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
}
@@ -487,7 +487,7 @@ public class HttpPartSchemaTest_Path {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -504,7 +504,7 @@ public class HttpPartSchemaTest_Path {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -521,7 +521,7 @@ public class HttpPartSchemaTest_Path {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -552,25 +552,25 @@ public class HttpPartSchemaTest_Path {
try {
s.getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['W']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['Y']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['Z']", e.getLocalizedMessage());
}
}
@@ -591,13 +591,13 @@ public class HttpPartSchemaTest_Path {
try {
s.validateOutput(9, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -633,50 +633,50 @@ public class HttpPartSchemaTest_Path {
try {
s.getItems().validateOutput(9, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(99, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(999, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(9999, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -693,13 +693,13 @@ public class HttpPartSchemaTest_Path {
try {
s.validateOutput(10, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -735,50 +735,50 @@ public class HttpPartSchemaTest_Path {
try {
s.getItems().validateOutput(10, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -795,13 +795,13 @@ public class HttpPartSchemaTest_Path {
try {
s.validateOutput(10f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -837,50 +837,50 @@ public class HttpPartSchemaTest_Path {
try {
s.getItems().validateOutput(10f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -897,13 +897,13 @@ public class HttpPartSchemaTest_Path {
try {
s.validateOutput(10.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -939,50 +939,50 @@ public class HttpPartSchemaTest_Path {
try {
s.getItems().validateOutput(10.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -1002,7 +1002,7 @@ public class HttpPartSchemaTest_Path {
try {
s.validateOutput(11, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1053,25 +1053,25 @@ public class HttpPartSchemaTest_Path {
try {
s.getItems().validateOutput(11, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1089,7 +1089,7 @@ public class HttpPartSchemaTest_Path {
try {
s.validateOutput(10.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1130,25 +1130,25 @@ public class HttpPartSchemaTest_Path {
try {
s.getItems().validateOutput(10.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1187,25 +1187,25 @@ public class HttpPartSchemaTest_Path {
try {
s.getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
}
@@ -1227,25 +1227,25 @@ public class HttpPartSchemaTest_Path {
try {
s.getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
}
@@ -1282,50 +1282,50 @@ public class HttpPartSchemaTest_Path {
try {
s.getItems().validateOutput(new String[0], BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(split("1"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(split("1,2"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(split("1,2,3"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(split("1,2,3"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(split("1,2,3,4"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(split("1,2,3,4,5"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(split("1,2,3,4,5,6"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
}
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Query.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Query.java
index 0afebbc..d6c92c1 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Query.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Query.java
@@ -388,13 +388,13 @@ public class HttpPartSchemaTest_Query {
try {
s.validateInput(null);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("No value specified.", e.getLocalizedMessage());
}
try {
s.validateInput("");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Empty value not allowed.", e.getLocalizedMessage());
}
}
@@ -422,7 +422,7 @@ public class HttpPartSchemaTest_Query {
try {
s.validateInput(null);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("No value specified.", e.getLocalizedMessage());
}
}
@@ -438,19 +438,19 @@ public class HttpPartSchemaTest_Query {
try {
s.validateInput("y");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match expected pattern. Must match pattern: x.*", e.getLocalizedMessage());
}
try {
s.validateInput("yx");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match expected pattern. Must match pattern: x.*", e.getLocalizedMessage());
}
try {
s.validateInput(""); // Empty headers are never allowed.
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Empty value not allowed.", e.getLocalizedMessage());
}
}
@@ -467,13 +467,13 @@ public class HttpPartSchemaTest_Query {
try {
s.validateInput("1");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
}
@@ -514,50 +514,50 @@ public class HttpPartSchemaTest_Query {
try {
s.getItems().validateInput("1");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("12");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("123");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("12345");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("123456");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("1234567");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
}
@@ -574,7 +574,7 @@ public class HttpPartSchemaTest_Query {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -591,7 +591,7 @@ public class HttpPartSchemaTest_Query {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -608,7 +608,7 @@ public class HttpPartSchemaTest_Query {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -639,25 +639,25 @@ public class HttpPartSchemaTest_Query {
try {
s.getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['W']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['Y']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['Z']", e.getLocalizedMessage());
}
}
@@ -678,13 +678,13 @@ public class HttpPartSchemaTest_Query {
try {
s.validateOutput(9, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -720,50 +720,50 @@ public class HttpPartSchemaTest_Query {
try {
s.getItems().validateOutput(9, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(99, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(999, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(9999, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -780,13 +780,13 @@ public class HttpPartSchemaTest_Query {
try {
s.validateOutput(10, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -822,50 +822,50 @@ public class HttpPartSchemaTest_Query {
try {
s.getItems().validateOutput(10, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -882,13 +882,13 @@ public class HttpPartSchemaTest_Query {
try {
s.validateOutput(10f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -924,50 +924,50 @@ public class HttpPartSchemaTest_Query {
try {
s.getItems().validateOutput(10f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -984,13 +984,13 @@ public class HttpPartSchemaTest_Query {
try {
s.validateOutput(10.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -1026,50 +1026,50 @@ public class HttpPartSchemaTest_Query {
try {
s.getItems().validateOutput(10.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -1089,7 +1089,7 @@ public class HttpPartSchemaTest_Query {
try {
s.validateOutput(11, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1140,25 +1140,25 @@ public class HttpPartSchemaTest_Query {
try {
s.getItems().validateOutput(11, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1176,7 +1176,7 @@ public class HttpPartSchemaTest_Query {
try {
s.validateOutput(10.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1217,25 +1217,25 @@ public class HttpPartSchemaTest_Query {
try {
s.getItems().validateOutput(10.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1274,25 +1274,25 @@ public class HttpPartSchemaTest_Query {
try {
s.getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
}
@@ -1314,25 +1314,25 @@ public class HttpPartSchemaTest_Query {
try {
s.getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
}
@@ -1369,50 +1369,50 @@ public class HttpPartSchemaTest_Query {
try {
s.getItems().validateOutput(new String[0], BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(split("1"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(split("1,2"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(split("1,2,3"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(split("1,2,3"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(split("1,2,3,4"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(split("1,2,3,4,5"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(split("1,2,3,4,5,6"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
}
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Response.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Response.java
index 52688ad..fad918a 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Response.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_Response.java
@@ -268,13 +268,13 @@ public class HttpPartSchemaTest_Response {
try {
s.validateInput("");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match expected pattern. Must match pattern: x.*", e.getLocalizedMessage());
}
try {
s.validateInput("y");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match expected pattern. Must match pattern: x.*", e.getLocalizedMessage());
}
}
@@ -311,13 +311,13 @@ public class HttpPartSchemaTest_Response {
try {
s.validateInput("1");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
}
@@ -360,50 +360,50 @@ public class HttpPartSchemaTest_Response {
try {
s.getItems().validateInput("1");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("12");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("123");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("12345");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("123456");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("1234567");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
}
@@ -420,7 +420,7 @@ public class HttpPartSchemaTest_Response {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -437,7 +437,7 @@ public class HttpPartSchemaTest_Response {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -454,7 +454,7 @@ public class HttpPartSchemaTest_Response {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -487,25 +487,25 @@ public class HttpPartSchemaTest_Response {
try {
s.getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['W']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['Y']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['Z']", e.getLocalizedMessage());
}
}
@@ -526,13 +526,13 @@ public class HttpPartSchemaTest_Response {
try {
s.validateOutput(9, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -570,50 +570,50 @@ public class HttpPartSchemaTest_Response {
try {
s.getItems().validateOutput(9, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(99, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(999, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(9999, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -630,13 +630,13 @@ public class HttpPartSchemaTest_Response {
try {
s.validateOutput(10, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -674,50 +674,50 @@ public class HttpPartSchemaTest_Response {
try {
s.getItems().validateOutput(10, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -734,13 +734,13 @@ public class HttpPartSchemaTest_Response {
try {
s.validateOutput(10f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -778,50 +778,50 @@ public class HttpPartSchemaTest_Response {
try {
s.getItems().validateOutput(10f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -838,13 +838,13 @@ public class HttpPartSchemaTest_Response {
try {
s.validateOutput(10.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -882,50 +882,50 @@ public class HttpPartSchemaTest_Response {
try {
s.getItems().validateOutput(10.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -945,7 +945,7 @@ public class HttpPartSchemaTest_Response {
try {
s.validateOutput(11, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -998,25 +998,25 @@ public class HttpPartSchemaTest_Response {
try {
s.getItems().validateOutput(11, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1034,7 +1034,7 @@ public class HttpPartSchemaTest_Response {
try {
s.validateOutput(10.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1077,25 +1077,25 @@ public class HttpPartSchemaTest_Response {
try {
s.getItems().validateOutput(10.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1135,25 +1135,25 @@ public class HttpPartSchemaTest_Response {
try {
s.getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
}
@@ -1175,25 +1175,25 @@ public class HttpPartSchemaTest_Response {
try {
s.getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
}
@@ -1231,50 +1231,50 @@ public class HttpPartSchemaTest_Response {
try {
s.getItems().validateOutput(new String[0], BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(split("1"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(split("1,2"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(split("1,2,3"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(split("1,2,3"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(split("1,2,3,4"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(split("1,2,3,4,5"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(split("1,2,3,4,5,6"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
}
diff --git a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_ResponseHeader.java b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_ResponseHeader.java
index ef1ec7c..585f9ad 100644
--- a/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_ResponseHeader.java
+++ b/juneau-core/juneau-core-test/src/test/java/org/apache/juneau/httppart/HttpPartSchemaTest_ResponseHeader.java
@@ -377,19 +377,19 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.validateInput("y");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match expected pattern. Must match pattern: x.*", e.getLocalizedMessage());
}
try {
s.validateInput("yx");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match expected pattern. Must match pattern: x.*", e.getLocalizedMessage());
}
try {
s.validateInput(""); // Empty headers are never allowed.
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Empty value not allowed.", e.getLocalizedMessage());
}
}
@@ -406,13 +406,13 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.validateInput("1");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
}
@@ -453,50 +453,50 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.getItems().validateInput("1");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("12");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("123");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum length of value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateInput("1234");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("12345");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("123456");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("1234567");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum length of value exceeded.", e.getLocalizedMessage());
}
}
@@ -513,7 +513,7 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -530,7 +530,7 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -547,7 +547,7 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.validateInput("Z");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X','Y']", e.getLocalizedMessage());
}
}
@@ -578,25 +578,25 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['W']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['X']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['Y']", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateInput("V");
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Value does not match one of the expected values. Must be one of the following: ['Z']", e.getLocalizedMessage());
}
}
@@ -617,13 +617,13 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.validateOutput(9, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -659,50 +659,50 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.getItems().validateOutput(9, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(99, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(999, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(9999, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -719,13 +719,13 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.validateOutput(10, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -761,50 +761,50 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.getItems().validateOutput(10, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -821,13 +821,13 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.validateOutput(10f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -863,50 +863,50 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.getItems().validateOutput(10f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -923,13 +923,13 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.validateOutput(10.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -965,50 +965,50 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.getItems().validateOutput(10.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum value not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(100.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(1000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(10000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(100000.1f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum value exceeded.", e.getLocalizedMessage());
}
}
@@ -1028,7 +1028,7 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.validateOutput(11, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1079,25 +1079,25 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.getItems().validateOutput(11, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(101, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10001, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1115,7 +1115,7 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.validateOutput(10.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1156,25 +1156,25 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.getItems().validateOutput(10.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(100.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(1000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(10000.2f, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Multiple-of not met.", e.getLocalizedMessage());
}
}
@@ -1213,25 +1213,25 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
}
@@ -1253,25 +1253,25 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(bad, BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Duplicate items not allowed.", e.getLocalizedMessage());
}
}
@@ -1308,50 +1308,50 @@ public class HttpPartSchemaTest_ResponseHeader {
try {
s.getItems().validateOutput(new String[0], BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(split("1"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(split("1,2"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(split("1,2,3"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Minimum number of items not met.", e.getLocalizedMessage());
}
try {
s.getItems().validateOutput(split("1,2,3"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().validateOutput(split("1,2,3,4"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().validateOutput(split("1,2,3,4,5"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
try {
s.getItems().getItems().getItems().getItems().validateOutput(split("1,2,3,4,5,6"), BeanContext.DEFAULT);
fail();
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
assertEquals("Maximum number of items exceeded.", e.getLocalizedMessage());
}
}
diff --git a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/LinkString.java b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/LinkString.java
index 5add137..d9a75b0 100644
--- a/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/LinkString.java
+++ b/juneau-core/juneau-dto/src/main/java/org/apache/juneau/dto/LinkString.java
@@ -20,6 +20,7 @@ import org.apache.juneau.annotation.*;
import org.apache.juneau.html.*;
import org.apache.juneau.html.annotation.*;
import org.apache.juneau.httppart.*;
+import org.apache.juneau.serializer.*;
import org.apache.juneau.utils.*;
/**
@@ -119,7 +120,11 @@ public class LinkString implements Comparable<LinkString> {
*/
public LinkString uri(String uri, Object...args) {
for (int i = 0; i < args.length; i++)
- args[i] = SimpleUonPartSerializer.DEFAULT.serialize(HttpPartType.PATH, args[i]);
+ try {
+ args[i] = SimpleUonPartSerializer.DEFAULT.serialize(HttpPartType.PATH, args[i]);
+ } catch (SchemaValidationException | SerializeException e) {
+ throw new RuntimeException(e);
+ }
this.uri = java.net.URI.create(format(uri, args));
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Body.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Body.java
index 5ddb651..daf3e46 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Body.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Body.java
@@ -282,8 +282,7 @@ public @interface Body {
* Determines whether the body is mandatory.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <h5 class='section'>Examples:</h5>
* <p class='bcode'>
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormData.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormData.java
index fa835a1..1287565 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormData.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormData.java
@@ -345,8 +345,7 @@ public @interface FormData {
* Determines whether the parameter is mandatory.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*/
boolean required() default false;
@@ -536,8 +535,7 @@ public @interface FormData {
* <br>The value must be a valid JSON number.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
@@ -551,8 +549,7 @@ public @interface FormData {
* Defines whether the maximum is matched exclusively.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
@@ -568,8 +565,7 @@ public @interface FormData {
* <br>The value must be a valid JSON number.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
@@ -583,8 +579,7 @@ public @interface FormData {
* Defines whether the minimum is matched exclusively.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
@@ -601,8 +596,7 @@ public @interface FormData {
* <br>The value <code>-1</code> is always ignored.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"string"</js>.
@@ -618,8 +612,7 @@ public @interface FormData {
* <br>The value <code>-1</code> is always ignored.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"string"</js>.
@@ -633,8 +626,7 @@ public @interface FormData {
* A string input is valid if it matches the specified regular expression pattern.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"string"</js>.
@@ -648,8 +640,7 @@ public @interface FormData {
* An array or collection is valid if its size is less than, or equal to, the value of this keyword.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"array"</js>.
@@ -663,8 +654,7 @@ public @interface FormData {
* An array or collection is valid if its size is greater than, or equal to, the value of this keyword.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"array"</js>.
@@ -678,8 +668,7 @@ public @interface FormData {
* If <jk>true</jk>, the input validates successfully if all of its elements are unique.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
* <br>If the parameter type is a subclass of {@link Set}, this validation is skipped (since a set can only contain unique items anyway).
* <br>Otherwise, the collection or array is checked for duplicate items.
*
@@ -695,8 +684,7 @@ public @interface FormData {
* If specified, the input validates successfully if it is equal to one of the elements in this array.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} array or comma-delimited list.
@@ -730,8 +718,7 @@ public @interface FormData {
* <br>The value must be a valid JSON number.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
*/
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Header.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Header.java
index 2087808..c908c49 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Header.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Header.java
@@ -309,7 +309,7 @@ public @interface Header {
* Determines whether the parameter is mandatory.
*
* <p>
- * If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during parsing, the part parser will throw a {@link SchemaValidationException}.
*/
boolean required() default false;
@@ -499,8 +499,7 @@ public @interface Header {
* <br>The value must be a valid JSON number.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
@@ -514,8 +513,7 @@ public @interface Header {
* Defines whether the maximum is matched exclusively.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
@@ -531,8 +529,7 @@ public @interface Header {
* <br>The value must be a valid JSON number.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
@@ -546,8 +543,7 @@ public @interface Header {
* Defines whether the minimum is matched exclusively.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
@@ -564,8 +560,7 @@ public @interface Header {
* <br>The value <code>-1</code> is always ignored.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"string"</js>.
@@ -581,8 +576,7 @@ public @interface Header {
* <br>The value <code>-1</code> is always ignored.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"string"</js>.
@@ -596,8 +590,7 @@ public @interface Header {
* A string input is valid if it matches the specified regular expression pattern.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"string"</js>.
@@ -611,8 +604,7 @@ public @interface Header {
* An array or collection is valid if its size is less than, or equal to, the value of this keyword.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"array"</js>.
@@ -626,8 +618,7 @@ public @interface Header {
* An array or collection is valid if its size is greater than, or equal to, the value of this keyword.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"array"</js>.
@@ -641,8 +632,7 @@ public @interface Header {
* If <jk>true</jk> the input validates successfully if all of its elements are unique.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
* <br>If the parameter type is a subclass of {@link Set}, this validation is skipped (since a set can only contain unique items anyway).
* <br>Otherwise, the collection or array is checked for duplicate items.
*
@@ -658,8 +648,7 @@ public @interface Header {
* If specified, the input validates successfully if it is equal to one of the elements in this array.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} array or comma-delimited list.
@@ -693,8 +682,7 @@ public @interface Header {
* <br>The value must be a valid JSON number.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Path.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Path.java
index ba0849a..5942833 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Path.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Path.java
@@ -446,8 +446,7 @@ public @interface Path {
* <br>The value must be a valid JSON number.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
@@ -461,8 +460,7 @@ public @interface Path {
* Defines whether the maximum is matched exclusively.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
@@ -478,8 +476,7 @@ public @interface Path {
* <br>The value must be a valid JSON number.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
@@ -493,8 +490,7 @@ public @interface Path {
* Defines whether the minimum is matched exclusively.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
@@ -511,8 +507,7 @@ public @interface Path {
* <br>The value <code>-1</code> is always ignored.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"string"</js>.
@@ -528,8 +523,7 @@ public @interface Path {
* <br>The value <code>-1</code> is always ignored.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"string"</js>.
@@ -543,8 +537,7 @@ public @interface Path {
* A string input is valid if it matches the specified regular expression pattern.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"string"</js>.
@@ -558,8 +551,7 @@ public @interface Path {
* If specified, the input validates successfully if it is equal to one of the elements in this array.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} array or comma-delimited list.
@@ -595,8 +587,7 @@ public @interface Path {
* <br>The value must be a valid JSON number.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Query.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Query.java
index d6a5e04..a443954 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Query.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Query.java
@@ -341,8 +341,7 @@ public @interface Query {
* Determines whether the parameter is mandatory.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*/
boolean required() default false;
@@ -530,8 +529,7 @@ public @interface Query {
* <br>The value must be a valid JSON number.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
@@ -545,8 +543,7 @@ public @interface Query {
* Defines whether the maximum is matched exclusively.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
@@ -562,8 +559,7 @@ public @interface Query {
* <br>The value must be a valid JSON number.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
@@ -577,8 +573,7 @@ public @interface Query {
* Defines whether the minimum is matched exclusively.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
@@ -595,8 +590,7 @@ public @interface Query {
* <br>The value <code>-1</code> is always ignored.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"string"</js>.
@@ -612,8 +606,7 @@ public @interface Query {
* <br>The value <code>-1</code> is always ignored.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"string"</js>.
@@ -627,8 +620,7 @@ public @interface Query {
* A string input is valid if it matches the specified regular expression pattern.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"string"</js>.
@@ -642,8 +634,7 @@ public @interface Query {
* An array or collection is valid if its size is less than, or equal to, the value of this keyword.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"array"</js>.
@@ -657,8 +648,7 @@ public @interface Query {
* An array or collection is valid if its size is greater than, or equal to, the value of this keyword.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"array"</js>.
@@ -672,8 +662,7 @@ public @interface Query {
* If <jk>true</jk> the input validates successfully if all of its elements are unique.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
* <br>If the parameter type is a subclass of {@link Set}, this validation is skipped (since a set can only contain unique items anyway).
* <br>Otherwise, the collection or array is checked for duplicate items.
*
@@ -689,8 +678,7 @@ public @interface Query {
* If specified, the input validates successfully if it is equal to one of the elements in this array.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* The format is a {@link JsonSerializer#DEFAULT_LAX Simple-JSON} array or comma-delimited list.
@@ -724,8 +712,7 @@ public @interface Query {
* <br>The value must be a valid JSON number.
*
* <p>
- * If validation is not met during serialization, the part parser will throw a {@link SchemaValidationSerializeException}.
- * <br>If validation is not met during parsing, the part parser will throw a {@link SchemaValidationParseException}.
+ * If validation is not met during serialization or parsing, the part serializer/parser will throw a {@link SchemaValidationException}.
*
* <p>
* Only allowed for the following types: <js>"integer"</js>, <js>"number"</js>.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartParser.java
index fd93f84..bd70465 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartParser.java
@@ -52,7 +52,7 @@ public interface HttpPartParser {
* @param type The category of value being parsed.
* @return The parsed value.
* @throws ParseException If a problem occurred while trying to parse the input.
- * @throws SchemaValidationParseException If the input or resulting HTTP part object fails schema validation.
+ * @throws SchemaValidationException If the input or resulting HTTP part object fails schema validation.
*/
- public <T> T parse(HttpPartType partType, HttpPartSchema schema, String in, ClassMeta<T> type) throws ParseException, SchemaValidationParseException;
+ public <T> T parse(HttpPartType partType, HttpPartSchema schema, String in, ClassMeta<T> type) throws ParseException, SchemaValidationException;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchema.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchema.java
index 212a502..30c7876 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchema.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchema.java
@@ -311,7 +311,7 @@ public class HttpPartSchema {
notAllowed.appendIf(exclusiveMaximum != null, "exclusiveMaximum");
notAllowed.appendIf(exclusiveMinimum != null, "exclusiveMinimum");
notAllowed.appendIf(uniqueItems != null, "uniqueItems");
- notAllowed.appendIf(collectionFormat != CollectionFormat.NONE, "collectionFormat");
+ notAllowed.appendIf(collectionFormat != CollectionFormat.NO_COLLECTION_FORMAT, "collectionFormat");
notAllowed.appendIf(items != null, "items");
notAllowed.appendIf(maximum != null, "maximum");
notAllowed.appendIf(minimum != null, "minimum");
@@ -319,7 +319,7 @@ public class HttpPartSchema {
notAllowed.appendIf(maxItems != null, "maxItems");
notAllowed.appendIf(minItems != null, "minItems");
notAllowed.appendIf(minProperties != null, "minProperties");
- invalidFormat = ! format.isOneOf(Format.BYTE, Format.BINARY, Format.BINARY_SPACED, Format.DATE, Format.DATE_TIME, Format.PASSWORD, Format.UON, Format.NONE);
+ invalidFormat = ! format.isOneOf(Format.BYTE, Format.BINARY, Format.BINARY_SPACED, Format.DATE, Format.DATE_TIME, Format.PASSWORD, Format.UON, Format.NO_FORMAT);
break;
}
case ARRAY: {
@@ -335,7 +335,7 @@ public class HttpPartSchema {
notAllowed.appendIf(minLength != null, "minLength");
notAllowed.appendIf(maxProperties != null, "maxProperties");
notAllowed.appendIf(minProperties != null, "minProperties");
- invalidFormat = ! format.isOneOf(Format.NONE, Format.UON);
+ invalidFormat = ! format.isOneOf(Format.NO_FORMAT, Format.UON);
break;
}
case BOOLEAN: {
@@ -345,7 +345,7 @@ public class HttpPartSchema {
notAllowed.appendIf(exclusiveMaximum != null, "exclusiveMaximum");
notAllowed.appendIf(exclusiveMinimum != null, "exclusiveMinimum");
notAllowed.appendIf(uniqueItems != null, "uniqueItems");
- notAllowed.appendIf(collectionFormat != CollectionFormat.NONE, "collectionFormat");
+ notAllowed.appendIf(collectionFormat != CollectionFormat.NO_COLLECTION_FORMAT, "collectionFormat");
notAllowed.appendIf(pattern != null, "pattern");
notAllowed.appendIf(items != null, "items");
notAllowed.appendIf(maximum != null, "maximum");
@@ -357,7 +357,7 @@ public class HttpPartSchema {
notAllowed.appendIf(minItems != null, "minItems");
notAllowed.appendIf(minLength != null, "minLength");
notAllowed.appendIf(minProperties != null, "minProperties");
- invalidFormat = ! format.isOneOf(Format.NONE);
+ invalidFormat = ! format.isOneOf(Format.NO_FORMAT);
break;
}
case FILE: {
@@ -367,7 +367,7 @@ public class HttpPartSchema {
notAllowed.appendIf(properties != null, "properties");
notAllowed.appendIf(additionalProperties != null, "additionalProperties");
notAllowed.appendIf(uniqueItems != null, "uniqueItems");
- notAllowed.appendIf(collectionFormat != CollectionFormat.NONE, "collectionFormat");
+ notAllowed.appendIf(collectionFormat != CollectionFormat.NO_COLLECTION_FORMAT, "collectionFormat");
notAllowed.appendIf(pattern != null, "pattern");
notAllowed.appendIf(items != null, "items");
notAllowed.appendIf(maxItems != null, "maxItems");
@@ -376,14 +376,14 @@ public class HttpPartSchema {
notAllowed.appendIf(minItems != null, "minItems");
notAllowed.appendIf(minLength != null, "minLength");
notAllowed.appendIf(minProperties != null, "minProperties");
- invalidFormat = ! format.isOneOf(Format.NONE, Format.INT32, Format.INT64);
+ invalidFormat = ! format.isOneOf(Format.NO_FORMAT, Format.INT32, Format.INT64);
break;
}
case NUMBER: {
notAllowed.appendIf(properties != null, "properties");
notAllowed.appendIf(additionalProperties != null, "additionalProperties");
notAllowed.appendIf(uniqueItems != null, "uniqueItems");
- notAllowed.appendIf(collectionFormat != CollectionFormat.NONE, "collectionFormat");
+ notAllowed.appendIf(collectionFormat != CollectionFormat.NO_COLLECTION_FORMAT, "collectionFormat");
notAllowed.appendIf(pattern != null, "pattern");
notAllowed.appendIf(items != null, "items");
notAllowed.appendIf(maxItems != null, "maxItems");
@@ -392,14 +392,14 @@ public class HttpPartSchema {
notAllowed.appendIf(minItems != null, "minItems");
notAllowed.appendIf(minLength != null, "minLength");
notAllowed.appendIf(minProperties != null, "minProperties");
- invalidFormat = ! format.isOneOf(Format.NONE, Format.FLOAT, Format.DOUBLE);
+ invalidFormat = ! format.isOneOf(Format.NO_FORMAT, Format.FLOAT, Format.DOUBLE);
break;
}
case OBJECT: {
notAllowed.appendIf(exclusiveMaximum != null, "exclusiveMaximum");
notAllowed.appendIf(exclusiveMinimum != null, "exclusiveMinimum");
notAllowed.appendIf(uniqueItems != null, "uniqueItems");
- notAllowed.appendIf(collectionFormat != CollectionFormat.NONE, "collectionFormat");
+ notAllowed.appendIf(collectionFormat != CollectionFormat.NO_COLLECTION_FORMAT, "collectionFormat");
notAllowed.appendIf(pattern != null, "pattern");
notAllowed.appendIf(items != null, "items");
notAllowed.appendIf(maximum != null, "maximum");
@@ -409,7 +409,7 @@ public class HttpPartSchema {
notAllowed.appendIf(maxLength != null, "maxLength");
notAllowed.appendIf(minItems != null, "minItems");
notAllowed.appendIf(minLength != null, "minLength");
- invalidFormat = ! format.isOneOf(Format.NONE, Format.UON);
+ invalidFormat = ! format.isOneOf(Format.NO_FORMAT, Format.UON);
break;
}
default:
@@ -446,7 +446,7 @@ public class HttpPartSchema {
errors.add("minProperties cannot be less than zero.");
if (maxProperties != null && maxProperties < 0)
errors.add("maxProperties cannot be less than zero.");
- if (type == ARRAY && items != null && items.getType() == OBJECT && (format != UON && format != Format.NONE))
+ if (type == ARRAY && items != null && items.getType() == OBJECT && (format != UON && format != Format.NO_FORMAT))
errors.add("Cannot define an array of objects unless array format is 'uon'.");
if (! errors.isEmpty())
@@ -491,7 +491,7 @@ public class HttpPartSchema {
/**
* Not specified.
*/
- NONE;
+ NO_COLLECTION_FORMAT;
static CollectionFormat fromString(String value) {
@@ -547,7 +547,7 @@ public class HttpPartSchema {
/**
* Not specified.
*/
- NONE;
+ NO_TYPE;
static Type fromString(String value) {
return valueOf(value.toUpperCase());
@@ -622,7 +622,7 @@ public class HttpPartSchema {
/**
* Not specified.
*/
- NONE;
+ NO_FORMAT;
static Format fromString(String value) {
value = value.toUpperCase().replace('-','_');
@@ -751,7 +751,7 @@ public class HttpPartSchema {
* @see HttpPartSchemaBuilder#format(String)
*/
public Type getType(ClassMeta<?> cm) {
- if (type != Type.NONE)
+ if (type != Type.NO_TYPE)
return type;
if (cm.isMapOrBean())
return Type.OBJECT;
@@ -981,22 +981,22 @@ public class HttpPartSchema {
*
* @param in The input.
* @return The same object passed in.
- * @throws SchemaValidationParseException if the specified pre-parsed input does not validate against this schema.
+ * @throws SchemaValidationException if the specified pre-parsed input does not validate against this schema.
*/
- public String validateInput(String in) throws SchemaValidationParseException {
+ public String validateInput(String in) throws SchemaValidationException {
if (! isValidRequired(in))
- throw new SchemaValidationParseException("No value specified.");
+ throw new SchemaValidationException("No value specified.");
if (in != null) {
if (! isValidAllowEmpty(in))
- throw new SchemaValidationParseException("Empty value not allowed.");
+ throw new SchemaValidationException("Empty value not allowed.");
if (! isValidPattern(in))
- throw new SchemaValidationParseException("Value does not match expected pattern. Must match pattern: {0}", pattern.pattern());
+ throw new SchemaValidationException("Value does not match expected pattern. Must match pattern: {0}", pattern.pattern());
if (! isValidEnum(in))
- throw new SchemaValidationParseException("Value does not match one of the expected values. Must be one of the following: {0}", _enum);
+ throw new SchemaValidationException("Value does not match one of the expected values. Must be one of the following: {0}", _enum);
if (! isValidMaxLength(in))
- throw new SchemaValidationParseException("Maximum length of value exceeded.");
+ throw new SchemaValidationException("Maximum length of value exceeded.");
if (! isValidMinLength(in))
- throw new SchemaValidationParseException("Minimum length of value not met.");
+ throw new SchemaValidationException("Minimum length of value not met.");
}
return in;
}
@@ -1007,13 +1007,13 @@ public class HttpPartSchema {
* @param o The parsed output.
* @param bc The bean context used to detect POJO types.
* @return The same object passed in.
- * @throws SchemaValidationParseException if the specified parsed output does not validate against this schema.
+ * @throws SchemaValidationException if the specified parsed output does not validate against this schema.
*/
@SuppressWarnings("rawtypes")
- public Object validateOutput(Object o, BeanContext bc) throws SchemaValidationParseException {
+ public Object validateOutput(Object o, BeanContext bc) throws SchemaValidationException {
if (o == null) {
if (! isValidRequired(o))
- throw new SchemaValidationParseException("Required value not provided.");
+ throw new SchemaValidationException("Required value not provided.");
return o;
}
ClassMeta<?> cm = bc.getClassMetaForObject(o);
@@ -1021,11 +1021,11 @@ public class HttpPartSchema {
case ARRAY: {
if (cm.isArray()) {
if (! isValidMinItems(o))
- throw new SchemaValidationParseException("Minimum number of items not met.");
+ throw new SchemaValidationException("Minimum number of items not met.");
if (! isValidMaxItems(o))
- throw new SchemaValidationParseException("Maximum number of items exceeded.");
+ throw new SchemaValidationException("Maximum number of items exceeded.");
if (! isValidUniqueItems(o))
- throw new SchemaValidationParseException("Duplicate items not allowed.");
+ throw new SchemaValidationException("Duplicate items not allowed.");
HttpPartSchema items = getItems();
if (items != null)
for (int i = 0; i < Array.getLength(o); i++)
@@ -1033,11 +1033,11 @@ public class HttpPartSchema {
} else if (cm.isCollection()) {
Collection<?> c = (Collection<?>)o;
if (! isValidMinItems(c))
- throw new SchemaValidationParseException("Minimum number of items not met.");
+ throw new SchemaValidationException("Minimum number of items not met.");
if (! isValidMaxItems(c))
- throw new SchemaValidationParseException("Maximum number of items exceeded.");
+ throw new SchemaValidationException("Maximum number of items exceeded.");
if (! isValidUniqueItems(c))
- throw new SchemaValidationParseException("Duplicate items not allowed.");
+ throw new SchemaValidationException("Duplicate items not allowed.");
HttpPartSchema items = getItems();
if (items != null)
for (Object o2 : c)
@@ -1049,11 +1049,11 @@ public class HttpPartSchema {
if (cm.isNumber()) {
Number n = (Number)o;
if (! isValidMinimum(n))
- throw new SchemaValidationParseException("Minimum value not met.");
+ throw new SchemaValidationException("Minimum value not met.");
if (! isValidMaximum(n))
- throw new SchemaValidationParseException("Maximum value exceeded.");
+ throw new SchemaValidationException("Maximum value exceeded.");
if (! isValidMultipleOf(n))
- throw new SchemaValidationParseException("Multiple-of not met.");
+ throw new SchemaValidationException("Multiple-of not met.");
}
break;
}
@@ -1061,11 +1061,11 @@ public class HttpPartSchema {
if (cm.isNumber()) {
Number n = (Number)o;
if (! isValidMinimum(n))
- throw new SchemaValidationParseException("Minimum value not met.");
+ throw new SchemaValidationException("Minimum value not met.");
if (! isValidMaximum(n))
- throw new SchemaValidationParseException("Maximum value exceeded.");
+ throw new SchemaValidationException("Maximum value exceeded.");
if (! isValidMultipleOf(n))
- throw new SchemaValidationParseException("Multiple-of not met.");
+ throw new SchemaValidationException("Multiple-of not met.");
}
break;
}
@@ -1073,9 +1073,9 @@ public class HttpPartSchema {
if (cm.isMapOrBean()) {
Map<?,?> m = cm.isMap() ? (Map<?,?>)o : bc.createSession().toBeanMap(o);
if (! isValidMinProperties(m))
- throw new SchemaValidationParseException("Minimum number of properties not met.");
+ throw new SchemaValidationException("Minimum number of properties not met.");
if (! isValidMaxProperties(m))
- throw new SchemaValidationParseException("Maximum number of properties exceeded.");
+ throw new SchemaValidationException("Maximum number of properties exceeded.");
for (Map.Entry e : m.entrySet()) {
String key = e.getKey().toString();
HttpPartSchema s2 = getProperty(key);
@@ -1090,7 +1090,7 @@ public class HttpPartSchema {
case BOOLEAN:
case FILE:
case STRING:
- case NONE:
+ case NO_TYPE:
break;
}
return o;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchemaBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchemaBuilder.java
index e48c2e3..d3479cc 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchemaBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchemaBuilder.java
@@ -35,9 +35,9 @@ public class HttpPartSchemaBuilder {
Set<Integer> codes;
Set<String> _enum;
Boolean allowEmptyValue, exclusiveMaximum, exclusiveMinimum, required, uniqueItems, skipIfEmpty;
- CollectionFormat collectionFormat = CollectionFormat.NONE;
- Type type = Type.NONE;
- Format format = Format.NONE;
+ CollectionFormat collectionFormat = CollectionFormat.NO_COLLECTION_FORMAT;
+ Type type = Type.NO_TYPE;
+ Format format = Format.NO_FORMAT;
Pattern pattern;
Number maximum, minimum, multipleOf;
Long maxLength, minLength, maxItems, minItems, maxProperties, minProperties;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSerializer.java
index 7aa1d19..e8c732b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSerializer.java
@@ -71,7 +71,7 @@ public interface HttpPartSerializer {
* @param value The value being serialized.
* @return The serialized value.
* @throws SerializeException If a problem occurred while trying to parse the input.
- * @throws SchemaValidationSerializeException If the input or resulting HTTP part object fails schema validation.
+ * @throws SchemaValidationException If the output fails schema validation.
*/
- public String serialize(HttpPartType type, HttpPartSchema schema, Object value) throws SerializeException, SchemaValidationSerializeException;
+ public String serialize(HttpPartType type, HttpPartSchema schema, Object value) throws SerializeException, SchemaValidationException;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/OpenApiPartParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/OpenApiPartParser.java
index a5e94f6..14c07c6 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/OpenApiPartParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/OpenApiPartParser.java
@@ -13,6 +13,9 @@
package org.apache.juneau.httppart;
import static org.apache.juneau.internal.StringUtils.*;
+import static org.apache.juneau.httppart.HttpPartSchema.Type.*;
+import static org.apache.juneau.httppart.HttpPartSchema.Format.*;
+import static org.apache.juneau.httppart.HttpPartSchema.CollectionFormat.*;
import java.io.*;
import java.util.*;
@@ -221,9 +224,9 @@ public class OpenApiPartParser extends UonPartParser {
* @param type The category of value being parsed.
* @return The parsed value.
* @throws ParseException If a problem occurred while trying to parse the input.
- * @throws SchemaValidationParseException If the input or resulting HTTP part object fails schema validation.
+ * @throws SchemaValidationException If the input or resulting HTTP part object fails schema validation.
*/
- public <T> T parse(HttpPartSchema schema, String in, Class<T> type) throws ParseException, SchemaValidationParseException {
+ public <T> T parse(HttpPartSchema schema, String in, Class<T> type) throws ParseException, SchemaValidationException {
return parse(null, schema, in, getClassMeta(type));
}
@@ -239,15 +242,15 @@ public class OpenApiPartParser extends UonPartParser {
* @param args The type arguments of the map or collection.
* @return The parsed value.
* @throws ParseException If a problem occurred while trying to parse the input.
- * @throws SchemaValidationParseException If the input or resulting HTTP part object fails schema validation.
+ * @throws SchemaValidationException If the input or resulting HTTP part object fails schema validation.
*/
@SuppressWarnings("unchecked")
- public <T> T parse(HttpPartSchema schema, String in, java.lang.reflect.Type type, java.lang.reflect.Type...args) throws ParseException, SchemaValidationParseException {
+ public <T> T parse(HttpPartSchema schema, String in, java.lang.reflect.Type type, java.lang.reflect.Type...args) throws ParseException, SchemaValidationException {
return (T)parse(null, schema, in, getClassMeta(type, args));
}
@Override /* HttpPartParser */
- public <T> T parse(HttpPartType partType, HttpPartSchema schema, String in, ClassMeta<T> type) throws ParseException, SchemaValidationParseException {
+ public <T> T parse(HttpPartType partType, HttpPartSchema schema, String in, ClassMeta<T> type) throws ParseException, SchemaValidationException {
schema = ObjectUtils.firstNonNull(schema, this.schema, DEFAULT_SCHEMA);
T t = parseInner(partType, schema, in, type);
if (t == null && type.isPrimitive())
@@ -257,161 +260,144 @@ public class OpenApiPartParser extends UonPartParser {
}
@SuppressWarnings({ "unchecked" })
- private<T> T parseInner(HttpPartType partType, HttpPartSchema schema, String in, ClassMeta<T> type) throws SchemaValidationParseException, ParseException {
+ private<T> T parseInner(HttpPartType partType, HttpPartSchema schema, String in, ClassMeta<T> type) throws SchemaValidationException, ParseException {
schema.validateInput(in);
if (in == null) {
if (schema.getDefault() == null)
return null;
in = schema.getDefault();
} else {
- switch (schema.getType(type)) {
- case STRING: {
- if (type.isObject()) {
- switch (schema.getFormat()) {
- case BYTE:
- return (T)StringUtils.base64Decode(in);
- case DATE:
- case DATE_TIME:
- return (T)StringUtils.parseIsoCalendar(in);
- case BINARY:
- return (T)StringUtils.fromHex(in);
- case BINARY_SPACED:
- return (T)StringUtils.fromSpacedHex(in);
- case UON:
- return super.parse(partType, schema, in, type);
- default:
- return (T)in;
- }
- }
- switch (schema.getFormat()) {
- case BYTE:
- return toType(StringUtils.base64Decode(in), type);
- case DATE:
- case DATE_TIME:
- return toType(StringUtils.parseIsoCalendar(in), type);
- case BINARY:
- return toType(StringUtils.fromHex(in), type);
- case BINARY_SPACED:
- return toType(StringUtils.fromSpacedHex(in), type);
- case UON:
- return super.parse(partType, schema, in, type);
- default:
- return toType(in, type);
- }
+ HttpPartSchema.Type t = schema.getType(type);
+ HttpPartSchema.Format f = schema.getFormat();
+
+ if (t == STRING) {
+ if (type.isObject()) {
+ if (f == BYTE)
+ return (T)StringUtils.base64Decode(in);
+ if (f == DATE || f == DATE_TIME)
+ return (T)StringUtils.parseIsoCalendar(in);
+ if (f == BINARY)
+ return (T)StringUtils.fromHex(in);
+ if (f == BINARY_SPACED)
+ return (T)StringUtils.fromSpacedHex(in);
+ if (f == HttpPartSchema.Format.UON)
+ return super.parse(partType, schema, in, type);
+ return (T)in;
}
- case ARRAY: {
- if (type.isObject())
- type = (ClassMeta<T>)CM_ObjectList;
-
- ClassMeta<?> eType = type.isObject() ? string() : type.getElementType();
- if (eType == null)
- eType = schema.getParsedType().getElementType();
-
- String[] ss = new String[0];
- switch (schema.getCollectionFormat()) {
- case MULTI:
- ss = new String[]{in};
- break;
- case CSV:
- ss = split(in, ',');
- break;
- case PIPES:
- ss = split(in, '|');
- break;
- case SSV:
- ss = splitQuoted(in);
- break;
- case TSV:
- ss = split(in, '\t');
- break;
- case UON:
- return super.parse(partType, null, in, type);
- case NONE:
- if (firstNonWhitespaceChar(in) == '@' && lastNonWhitespaceChar(in) == ')')
- return super.parse(partType, null, in, type);
- ss = split(in, ',');
- }
- Object[] o = null;
- if (schema.getItems() != null) {
- o = new Object[ss.length];
- for (int i = 0; i < ss.length; i++)
- o[i] = parse(partType, schema.getItems(), ss[i], eType);
- } else {
- o = ss;
- }
- if (type.getTransform(schema.getParsedType().getInnerClass()) != null)
- return toType(toType(o, schema.getParsedType()), type);
- return toType(o, type);
+ if (f == BYTE)
+ return toType(StringUtils.base64Decode(in), type);
+ if (f == DATE || f == DATE_TIME)
+ return toType(StringUtils.parseIsoCalendar(in), type);
+ if (f == BINARY)
+ return toType(StringUtils.fromHex(in), type);
+ if (f == BINARY_SPACED)
+ return toType(StringUtils.fromSpacedHex(in), type);
+ if (f == HttpPartSchema.Format.UON)
+ return super.parse(partType, schema, in, type);
+ return toType(in, type);
+
+ } else if (t == ARRAY) {
+ if (type.isObject())
+ type = (ClassMeta<T>)CM_ObjectList;
+
+ ClassMeta<?> eType = type.isObject() ? string() : type.getElementType();
+ if (eType == null)
+ eType = schema.getParsedType().getElementType();
+
+ HttpPartSchema.CollectionFormat cf = schema.getCollectionFormat();
+ String[] ss = new String[0];
+
+ if (cf == MULTI)
+ ss = new String[]{in};
+ else if (cf == CSV)
+ ss = split(in, ',');
+ else if (cf == PIPES)
+ ss = split(in, '|');
+ else if (cf == SSV)
+ ss = splitQuoted(in);
+ else if (cf == TSV)
+ ss = split(in, '\t');
+ else if (cf == HttpPartSchema.CollectionFormat.UON)
+ return super.parse(partType, null, in, type);
+ else if (cf == NO_COLLECTION_FORMAT) {
+ if (firstNonWhitespaceChar(in) == '@' && lastNonWhitespaceChar(in) == ')')
+ return super.parse(partType, null, in, type);
+ ss = split(in, ',');
}
- case BOOLEAN: {
- if (type.isObject())
- type = (ClassMeta<T>)CM_Boolean;
- if (type.isBoolean())
- return super.parse(partType, schema, in, type);
- return toType(super.parse(partType, schema, in, CM_Boolean), type);
+
+ Object[] o = null;
+ if (schema.getItems() != null) {
+ o = new Object[ss.length];
+ for (int i = 0; i < ss.length; i++)
+ o[i] = parse(partType, schema.getItems(), ss[i], eType);
+ } else {
+ o = ss;
}
- case INTEGER: {
- if (type.isObject()) {
- switch (schema.getFormat()) {
- case INT64:
- type = (ClassMeta<T>)CM_Long;
- break;
- default:
- type = (ClassMeta<T>)CM_Integer;
+ if (type.getTransform(schema.getParsedType().getInnerClass()) != null)
+ return toType(toType(o, schema.getParsedType()), type);
+ return toType(o, type);
- }
- }
- if (type.isNumber())
- return super.parse(partType, schema, in, type);
- return toType(super.parse(partType, schema, in, CM_Integer), type);
+ } else if (t == BOOLEAN) {
+ if (type.isObject())
+ type = (ClassMeta<T>)CM_Boolean;
+ if (type.isBoolean())
+ return super.parse(partType, schema, in, type);
+ return toType(super.parse(partType, schema, in, CM_Boolean), type);
+
+ } else if (t == INTEGER) {
+ if (type.isObject()) {
+ if (f == INT64)
+ type = (ClassMeta<T>)CM_Long;
+ else
+ type = (ClassMeta<T>)CM_Integer;
}
- case NUMBER: {
- if (type.isObject()) {
- switch (schema.getFormat()) {
- case DOUBLE:
- type = (ClassMeta<T>)CM_Double;
- break;
- default:
- type = (ClassMeta<T>)CM_Float;
- }
- }
- if (type.isNumber())
- return super.parse(partType, schema, in, type);
- return toType(super.parse(partType, schema, in, CM_Integer), type);
+ if (type.isNumber())
+ return super.parse(partType, schema, in, type);
+ return toType(super.parse(partType, schema, in, CM_Integer), type);
+
+ } else if (t == NUMBER) {
+ if (type.isObject()) {
+ if (f == DOUBLE)
+ type = (ClassMeta<T>)CM_Double;
+ else
+ type = (ClassMeta<T>)CM_Float;
}
- case OBJECT: {
- if (type.isObject())
- type = (ClassMeta<T>)CM_ObjectMap;
- if (schema.hasProperties() && type.isMapOrBean()) {
- try {
- if (type.isBean()) {
- BeanMap<T> m = BC.createBeanSession().newBeanMap(type.getInnerClass());
- for (Map.Entry<String,Object> e : parse(partType, DEFAULT_SCHEMA, in, CM_ObjectMap).entrySet()) {
- String key = e.getKey();
- BeanPropertyMeta bpm = m.getPropertyMeta(key);
- m.put(key, parse(partType, schema.getProperty(key), asString(e.getValue()), bpm == null ? object() : bpm.getClassMeta()));
- }
- return m.getBean();
- }
- Map<String,Object> m = (Map<String,Object>)type.newInstance();
+ if (type.isNumber())
+ return super.parse(partType, schema, in, type);
+ return toType(super.parse(partType, schema, in, CM_Integer), type);
+
+ } else if (t == OBJECT) {
+ if (type.isObject())
+ type = (ClassMeta<T>)CM_ObjectMap;
+ if (schema.hasProperties() && type.isMapOrBean()) {
+ try {
+ if (type.isBean()) {
+ BeanMap<T> m = BC.createBeanSession().newBeanMap(type.getInnerClass());
for (Map.Entry<String,Object> e : parse(partType, DEFAULT_SCHEMA, in, CM_ObjectMap).entrySet()) {
String key = e.getKey();
- m.put(key, parse(partType, schema.getProperty(key), asString(e.getValue()), object()));
+ BeanPropertyMeta bpm = m.getPropertyMeta(key);
+ m.put(key, parse(partType, schema.getProperty(key), asString(e.getValue()), bpm == null ? object() : bpm.getClassMeta()));
}
- return (T)m;
- } catch (Exception e1) {
- throw new ParseException(e1, "Could not instantiate type ''{0}''.", type);
+ return m.getBean();
}
+ Map<String,Object> m = (Map<String,Object>)type.newInstance();
+ for (Map.Entry<String,Object> e : parse(partType, DEFAULT_SCHEMA, in, CM_ObjectMap).entrySet()) {
+ String key = e.getKey();
+ m.put(key, parse(partType, schema.getProperty(key), asString(e.getValue()), object()));
+ }
+ return (T)m;
+ } catch (Exception e1) {
+ throw new ParseException(e1, "Could not instantiate type ''{0}''.", type);
}
- return super.parse(partType, schema, in, type);
- }
- case FILE: {
- throw new ParseException("File part not supported.");
- }
- case NONE: {
- // This should never be returned by HttpPartSchema.getType(ClassMeta).
- throw new ParseException("Invalid type.");
}
+ return super.parse(partType, schema, in, type);
+
+ } else if (t == FILE) {
+ throw new ParseException("File part not supported.");
+
+ } else if (t == NO_TYPE) {
+ // This should never be returned by HttpPartSchema.getType(ClassMeta).
+ throw new ParseException("Invalid type.");
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/OpenApiPartSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/OpenApiPartSerializer.java
index d78b87f..1eda116 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/OpenApiPartSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/OpenApiPartSerializer.java
@@ -14,6 +14,7 @@ package org.apache.juneau.httppart;
import org.apache.juneau.*;
import org.apache.juneau.internal.*;
+import org.apache.juneau.serializer.*;
/**
* Serializes POJOs to values suitable for transmission as HTTP headers, query/form-data parameters, and path variables.
@@ -104,8 +105,167 @@ public class OpenApiPartSerializer extends UonPartSerializer {
//--------------------------------------------------------------------------------
@Override /* PartSerializer */
- public String serialize(HttpPartType type, HttpPartSchema schema, Object value) {
+ public String serialize(HttpPartType partType, HttpPartSchema schema, Object value) throws SerializeException, SchemaValidationException {
schema = ObjectUtils.firstNonNull(schema, this.schema, HttpPartSchema.DEFAULT);
- return super.serialize(type, schema, value);
+// ClassMeta<?> type = getClassMetaForObject(value);
+// String out;
+//
+// switch (schema.getType()) {
+// case STRING: {
+// if (type.isObject()) {
+// switch (schema.getFormat()) {
+// case BYTE:
+// return (T)StringUtils.base64Decode(in);
+// case DATE:
+// case DATE_TIME:
+// return (T)StringUtils.parseIsoCalendar(in);
+// case BINARY:
+// return (T)StringUtils.fromHex(in);
+// case BINARY_SPACED:
+// return (T)StringUtils.fromSpacedHex(in);
+// case UON:
+// return super.parse(partType, schema, in, type);
+// default:
+// return (T)in;
+// }
+// }
+// switch (schema.getFormat()) {
+// case BYTE:
+// return toType(StringUtils.base64Decode(in), type);
+// case DATE:
+// case DATE_TIME:
+// return toType(StringUtils.parseIsoCalendar(in), type);
+// case BINARY:
+// return toType(StringUtils.fromHex(in), type);
+// case BINARY_SPACED:
+// return toType(StringUtils.fromSpacedHex(in), type);
+// case UON:
+// return super.parse(partType, schema, in, type);
+// default:
+// return toType(in, type);
+// }
+// }
+// case ARRAY: {
+// if (type.isObject())
+// type = (ClassMeta<T>)CM_ObjectList;
+//
+// ClassMeta<?> eType = type.isObject() ? string() : type.getElementType();
+// if (eType == null)
+// eType = schema.getParsedType().getElementType();
+//
+// String[] ss = new String[0];
+// switch (schema.getCollectionFormat()) {
+// case MULTI:
+// ss = new String[]{in};
+// break;
+// case CSV:
+// ss = split(in, ',');
+// break;
+// case PIPES:
+// ss = split(in, '|');
+// break;
+// case SSV:
+// ss = splitQuoted(in);
+// break;
+// case TSV:
+// ss = split(in, '\t');
+// break;
+// case UON:
+// return super.parse(partType, null, in, type);
+// case NONE:
+// if (firstNonWhitespaceChar(in) == '@' && lastNonWhitespaceChar(in) == ')')
+// return super.parse(partType, null, in, type);
+// ss = split(in, ',');
+// }
+// Object[] o = null;
+// if (schema.getItems() != null) {
+// o = new Object[ss.length];
+// for (int i = 0; i < ss.length; i++)
+// o[i] = parse(partType, schema.getItems(), ss[i], eType);
+// } else {
+// o = ss;
+// }
+// if (type.getTransform(schema.getParsedType().getInnerClass()) != null)
+// return toType(toType(o, schema.getParsedType()), type);
+// return toType(o, type);
+// }
+// case BOOLEAN: {
+// if (type.isObject())
+// type = (ClassMeta<T>)CM_Boolean;
+// if (type.isBoolean())
+// return super.parse(partType, schema, in, type);
+// return toType(super.parse(partType, schema, in, CM_Boolean), type);
+// }
+// case INTEGER: {
+// if (type.isObject()) {
+// switch (schema.getFormat()) {
+// case INT64:
+// type = (ClassMeta<T>)CM_Long;
+// break;
+// default:
+// type = (ClassMeta<T>)CM_Integer;
+//
+// }
+// }
+// if (type.isNumber())
+// return super.parse(partType, schema, in, type);
+// return toType(super.parse(partType, schema, in, CM_Integer), type);
+// }
+// case NUMBER: {
+// if (type.isObject()) {
+// switch (schema.getFormat()) {
+// case DOUBLE:
+// type = (ClassMeta<T>)CM_Double;
+// break;
+// default:
+// type = (ClassMeta<T>)CM_Float;
+// }
+// }
+// if (type.isNumber())
+// return super.parse(partType, schema, in, type);
+// return toType(super.parse(partType, schema, in, CM_Integer), type);
+// }
+// case OBJECT: {
+// if (type.isObject())
+// type = (ClassMeta<T>)CM_ObjectMap;
+// if (schema.hasProperties() && type.isMapOrBean()) {
+// try {
+// if (type.isBean()) {
+// BeanMap<T> m = BC.createBeanSession().newBeanMap(type.getInnerClass());
+// for (Map.Entry<String,Object> e : parse(partType, DEFAULT_SCHEMA, in, CM_ObjectMap).entrySet()) {
+// String key = e.getKey();
+// BeanPropertyMeta bpm = m.getPropertyMeta(key);
+// m.put(key, parse(partType, schema.getProperty(key), asString(e.getValue()), bpm == null ? object() : bpm.getClassMeta()));
+// }
+// return m.getBean();
+// }
+// Map<String,Object> m = (Map<String,Object>)type.newInstance();
+// for (Map.Entry<String,Object> e : parse(partType, DEFAULT_SCHEMA, in, CM_ObjectMap).entrySet()) {
+// String key = e.getKey();
+// m.put(key, parse(partType, schema.getProperty(key), asString(e.getValue()), object()));
+// }
+// return (T)m;
+// } catch (Exception e1) {
+// throw new ParseException(e1, "Could not instantiate type ''{0}''.", type);
+// }
+// }
+// return super.parse(partType, schema, in, type);
+// }
+// case FILE: {
+// throw new ParseException("File part not supported.");
+// }
+// case NONE: {
+// // This should never be returned by HttpPartSchema.getType(ClassMeta).
+// throw new ParseException("Invalid type.");
+// }
+// }
+// }
+
+
+
+
+ String out = super.serialize(partType, schema, value);
+ schema.validateInput(out);
+ return out;
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/SchemaValidationParseException.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/SchemaValidationException.java
similarity index 93%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/SchemaValidationParseException.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/SchemaValidationException.java
index 4ee9244..036d4c9 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/SchemaValidationParseException.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/SchemaValidationException.java
@@ -19,7 +19,7 @@ import org.apache.juneau.parser.ParseException;
/**
* Exception thrown when an HTTP part fails schema validation during parsing.
*/
-public class SchemaValidationParseException extends ParseException {
+public class SchemaValidationException extends ParseException {
private static final long serialVersionUID = 1L;
/**
@@ -28,7 +28,7 @@ public class SchemaValidationParseException extends ParseException {
* @param message The {@link MessageFormat}-style message.
* @param args Optional {@link MessageFormat}-style arguments.
*/
- public SchemaValidationParseException(String message, Object...args) {
+ public SchemaValidationException(String message, Object...args) {
super(message, args);
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/SchemaValidationSerializeException.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/SchemaValidationSerializeException.java
deleted file mode 100644
index fa9d326..0000000
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/SchemaValidationSerializeException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-// ***************************************************************************************************************************
-// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
-// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
-// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
-// * *
-// * http://www.apache.org/licenses/LICENSE-2.0 *
-// * *
-// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
-// * specific language governing permissions and limitations under the License. *
-// ***************************************************************************************************************************
-package org.apache.juneau.httppart;
-
-import java.text.*;
-
-import org.apache.juneau.serializer.SerializeException;
-
-/**
- * Exception thrown when an HTTP part fails schema validation during serialization.
- */
-public class SchemaValidationSerializeException extends SerializeException {
- private static final long serialVersionUID = 1L;
-
- /**
- * Constructor.
- *
- * @param message The {@link MessageFormat}-style message.
- * @param args Optional {@link MessageFormat}-style arguments.
- */
- public SchemaValidationSerializeException(String message, Object...args) {
- super(message, args);
- }
-}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/UonPartParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/UonPartParser.java
index 6a32280..0c3f4a2 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/UonPartParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/UonPartParser.java
@@ -81,14 +81,14 @@ public class UonPartParser extends UonParser implements HttpPartParser {
* @param type The category of value being parsed.
* @return The parsed value.
* @throws ParseException If a problem occurred while trying to parse the input.
- * @throws SchemaValidationParseException If the input or resulting HTTP part object fails schema validation.
+ * @throws SchemaValidationException If the input or resulting HTTP part object fails schema validation.
*/
- public <T> T parse(HttpPartType partType, String in, ClassMeta<T> type) throws ParseException, SchemaValidationParseException {
+ public <T> T parse(HttpPartType partType, String in, ClassMeta<T> type) throws ParseException, SchemaValidationException {
return parse(partType, null, in, type);
}
@Override /* HttpPartParser */
- public <T> T parse(HttpPartType partType, HttpPartSchema schema, String in, ClassMeta<T> type) throws ParseException, SchemaValidationParseException {
+ public <T> T parse(HttpPartType partType, HttpPartSchema schema, String in, ClassMeta<T> type) throws ParseException, SchemaValidationException {
if (in == null)
return null;
if (type.isString() && in.length() > 0) {
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/UonPartSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/UonPartSerializer.java
index 458d1b6..043c4d4 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/UonPartSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/UonPartSerializer.java
@@ -16,6 +16,7 @@ import java.io.*;
import org.apache.juneau.*;
import org.apache.juneau.internal.*;
+import org.apache.juneau.serializer.*;
import org.apache.juneau.uon.*;
/**
@@ -81,13 +82,15 @@ public class UonPartSerializer extends UonSerializer implements HttpPartSerializ
* @param type The category of value being serialized.
* @param value The value being serialized.
* @return The serialized value.
+ * @throws SerializeException If a problem occurred while trying to parse the input.
+ * @throws SchemaValidationException If the output fails schema validation.
*/
- public String serialize(HttpPartType type, Object value) {
+ public String serialize(HttpPartType type, Object value) throws SerializeException, SchemaValidationException {
return serialize(type, null, value);
}
@Override /* PartSerializer */
- public String serialize(HttpPartType type, HttpPartSchema schema, Object value) {
+ public String serialize(HttpPartType type, HttpPartSchema schema, Object value) throws SerializeException, SchemaValidationException {
try {
// Shortcut for simple types.
ClassMeta<?> cm = getClassMetaForObject(value);
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
index 4101193..b1c3efb 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/RestCall.java
@@ -211,7 +211,7 @@ public final class RestCall extends BeanSession implements Closeable {
if (value != null && ! (ObjectUtils.isEmpty(value) && skipIfEmpty))
try {
uriBuilder.addParameter(name, serializer.serialize(HttpPartType.QUERY, schema, value));
- } catch (SerializeException e) {
+ } catch (SerializeException | SchemaValidationException e) {
throw new RestCallException(e);
}
} else if (value instanceof NameValuePairs) {
@@ -446,7 +446,7 @@ public final class RestCall extends BeanSession implements Closeable {
throw new RestCallException("Path variable {"+name+"} was not found in path.");
try {
uriBuilder.setPath(path.replace(var, serializer.serialize(HttpPartType.PATH, schema, value)));
- } catch (SerializeException e) {
+ } catch (SerializeException | SchemaValidationException e) {
throw new RestCallException(e);
}
} else if (value instanceof NameValuePairs) {
@@ -588,7 +588,7 @@ public final class RestCall extends BeanSession implements Closeable {
if (value != null && ! (ObjectUtils.isEmpty(value) && skipIfEmpty))
try {
request.setHeader(name, serializer.serialize(HttpPartType.HEADER, schema, value));
- } catch (SerializeException e) {
+ } catch (SerializeException | SchemaValidationException e) {
throw new RestCallException(e);
}
} else if (value instanceof NameValuePairs) {
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/SerializedNameValuePair.java b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/SerializedNameValuePair.java
index 42d8e84..d23c572 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/SerializedNameValuePair.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/SerializedNameValuePair.java
@@ -64,7 +64,7 @@ public final class SerializedNameValuePair implements NameValuePair {
public String getValue() {
try {
return serializer.serialize(HttpPartType.FORMDATA, schema, value);
- } catch (SerializeException e) {
+ } catch (SerializeException | SchemaValidationException e) {
throw new RuntimeException(e);
}
}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestBody.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestBody.java
index 8195709..a3f2611 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestBody.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestBody.java
@@ -431,7 +431,7 @@ public class RequestBody {
return parse(partParser, schema, cm);
} catch (UnsupportedMediaType e) {
throw e;
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
throw new BadRequest("Validation failed on request body. " + e.getLocalizedMessage());
} catch (ParseException e) {
throw new BadRequest(e, "Could not convert request body content to class type ''{0}''.", cm);
@@ -443,7 +443,7 @@ public class RequestBody {
}
/* Workhorse method */
- private <T> T parse(HttpPartParser partParser, HttpPartSchema schema, ClassMeta<T> cm) throws SchemaValidationParseException, ParseException, UnsupportedMediaType, IOException {
+ private <T> T parse(HttpPartParser partParser, HttpPartSchema schema, ClassMeta<T> cm) throws SchemaValidationException, ParseException, UnsupportedMediaType, IOException {
if (cm.isReader())
return (T)getReader();
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestFormData.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestFormData.java
index c4a5f0a..52397b2 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestFormData.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestFormData.java
@@ -534,7 +534,7 @@ public class RequestFormData extends LinkedHashMap<String,String[]> {
try {
T t = parse(parser, schema, getString(name), cm);
return (t == null ? def : t);
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
throw new BadRequest(e, "Validation failed on form-data parameter ''{0}''. ", name);
} catch (ParseException e) {
throw new BadRequest(e, "Could not parse form-data parameter ''{0}''.", name) ;
@@ -563,7 +563,7 @@ public class RequestFormData extends LinkedHashMap<String,String[]> {
c.add(parse(parser, schema.getItems(), p[i], cm.getElementType()));
return (T)c;
}
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
throw new BadRequest(e, "Validation failed on form-data parameter ''{0}''. ", name);
} catch (ParseException e) {
throw new BadRequest(e, "Could not parse form-data parameter ''{0}''.", name) ;
@@ -573,7 +573,7 @@ public class RequestFormData extends LinkedHashMap<String,String[]> {
throw new InternalServerError("Invalid call to getParameters(String, ClassMeta). Class type must be a Collection or array.");
}
- private <T> T parse(HttpPartParser parser, HttpPartSchema schema, String val, ClassMeta<T> c) throws SchemaValidationParseException, ParseException {
+ private <T> T parse(HttpPartParser parser, HttpPartSchema schema, String val, ClassMeta<T> c) throws SchemaValidationException, ParseException {
if (parser == null)
parser = this.parser;
return parser.parse(HttpPartType.FORMDATA, schema, val, c);
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestHeaders.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestHeaders.java
index 62840b3..dc34a84 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestHeaders.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestHeaders.java
@@ -395,7 +395,7 @@ public class RequestHeaders extends TreeMap<String,String[]> {
try {
T t = parse(parser, schema, getString(name), cm);
return (t == null ? def : t);
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
throw new BadRequest(e, "Validation failed on header ''{0}''. ", name);
} catch (ParseException e) {
throw new BadRequest(e, "Could not parse header ''{0}''.", name) ;
@@ -405,7 +405,7 @@ public class RequestHeaders extends TreeMap<String,String[]> {
}
/* Workhorse method */
- private <T> T parse(HttpPartParser parser, HttpPartSchema schema, String val, ClassMeta<T> cm) throws SchemaValidationParseException, ParseException {
+ private <T> T parse(HttpPartParser parser, HttpPartSchema schema, String val, ClassMeta<T> cm) throws SchemaValidationException, ParseException {
if (parser == null)
parser = this.parser;
return parser.parse(HttpPartType.HEADER, schema, val, cm);
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestPathMatch.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestPathMatch.java
index e34d591..0e859d4 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestPathMatch.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestPathMatch.java
@@ -256,7 +256,7 @@ public class RequestPathMatch extends TreeMap<String,String> {
try {
T t = parse(parser, schema, get(name), cm);
return (t == null ? def : t);
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
throw new BadRequest(e, "Validation failed on path parameter ''{0}''. ", name);
} catch (ParseException e) {
throw new BadRequest(e, "Could not parse path parameter ''{0}''.", name) ;
@@ -266,7 +266,7 @@ public class RequestPathMatch extends TreeMap<String,String> {
}
/* Workhorse method */
- private <T> T parse(HttpPartParser parser, HttpPartSchema schema, String val, ClassMeta<T> cm) throws SchemaValidationParseException, ParseException {
+ private <T> T parse(HttpPartParser parser, HttpPartSchema schema, String val, ClassMeta<T> cm) throws SchemaValidationException, ParseException {
if (parser == null)
parser = this.parser;
return parser.parse(HttpPartType.PATH, schema, val, cm);
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestQuery.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestQuery.java
index 78938c3..7722602 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestQuery.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RequestQuery.java
@@ -592,7 +592,7 @@ public final class RequestQuery extends LinkedHashMap<String,String[]> {
try {
T t = parse(parser, schema, getString(name), cm);
return (t == null ? def : t);
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
throw new BadRequest(e, "Validation failed on query parameter ''{0}''. ", name);
} catch (ParseException e) {
throw new BadRequest(e, "Could not parse query parameter ''{0}''.", name) ;
@@ -621,7 +621,7 @@ public final class RequestQuery extends LinkedHashMap<String,String[]> {
c.add(parse(parser, schema.getItems(), p[i], cm.getElementType()));
return (T)c;
}
- } catch (SchemaValidationParseException e) {
+ } catch (SchemaValidationException e) {
throw new BadRequest(e, "Validation failed on query parameter ''{0}''. ", name);
} catch (ParseException e) {
throw new BadRequest(e, "Could not parse query parameter ''{0}''.", name) ;
@@ -631,7 +631,7 @@ public final class RequestQuery extends LinkedHashMap<String,String[]> {
throw new InternalServerError("Invalid call to getParameters(String, ClassMeta). Class type must be a Collection or array.");
}
- private <T> T parse(HttpPartParser parser, HttpPartSchema schema, String val, ClassMeta<T> c) throws SchemaValidationParseException, ParseException {
+ private <T> T parse(HttpPartParser parser, HttpPartSchema schema, String val, ClassMeta<T> c) throws SchemaValidationException, ParseException {
if (parser == null)
parser = this.parser;
return parser.parse(HttpPartType.QUERY, schema, val, c);
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestParamDefaults.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestParamDefaults.java
index 3376c38..bb10b9c 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestParamDefaults.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestParamDefaults.java
@@ -629,7 +629,7 @@ class RestParamDefaults {
public void onSet(Object newValue) {
try {
res.setHeader(name, partSerializer.serialize(HttpPartType.HEADER, schema, newValue));
- } catch (SerializeException e) {
+ } catch (SerializeException | SchemaValidationException e) {
throw new RuntimeException(e);
}
}