use of com.yahoo.rdl.Validator in project athenz by yahoo.
the class ZTSCoreTest method testPathElement.
@Test
public void testPathElement() {
String[] goodPathElements = { "i-132432432143", "a-zA-Z0-9-._~=+@$,:", "a-23434$asdfdf-343", "abc:test-asdfdsf,234333", "abc~test" };
Schema schema = ZTSSchema.instance();
Validator validator = new Validator(schema);
for (String s : goodPathElements) {
Result result = validator.validate(s, "PathElement");
assertTrue(result.valid, s);
}
String[] badPathElements = { "abc/test/atest", "abc%asdfadsfd", "Non_ascii:��", "asdf;test", "great!test", "query&element", "query?element" };
for (String s : badPathElements) {
Result result = validator.validate(s, "PathElement");
assertFalse(result.valid, s);
}
}
use of com.yahoo.rdl.Validator in project athenz by yahoo.
the class ZTSImpl method loadSchemaValidator.
void loadSchemaValidator() {
schema = ZTSSchema.instance();
validator = new Validator(schema);
}