@Test public void testValidAvroSchema() throws Exception { ContentHandle content = resourceToContentHandle("avro-valid.json"); AvroContentValidator validator = new AvroContentValidator(); validator.validate(ValidityLevel.SYNTAX_ONLY, content); }
@Override public void validate(ValidityLevel level, ContentHandle artifactContent) throws InvalidContentException { if (level == ValidityLevel.SYNTAX_ONLY || level == ValidityLevel.FULL) { try { Schema.Parser parser = new Schema.Parser(); parser.parse(artifactContent.content()); } catch (Exception e) { throw new InvalidContentException("Syntax violation for Avro artifact.", e); } } }
AvroContentValidator implements ContentValidator { @Override public void validate(ValidityLevel level, ContentHandle artifactContent) throws InvalidContentException { if (level == ValidityLevel.SYNTAX_ONLY || level == ValidityLevel.FULL) { try { Schema.Parser parser = new Schema.Parser(); parser.parse(artifactContent.content()); } catch (Exception e) { throw new InvalidContentException("Syntax violation for Avro artifact.", e); } } } }
AvroContentValidator implements ContentValidator { @Override public void validate(ValidityLevel level, ContentHandle artifactContent) throws InvalidContentException { if (level == ValidityLevel.SYNTAX_ONLY || level == ValidityLevel.FULL) { try { Schema.Parser parser = new Schema.Parser(); parser.parse(artifactContent.content()); } catch (Exception e) { throw new InvalidContentException("Syntax violation for Avro artifact.", e); } } } AvroContentValidator(); }
AvroContentValidator implements ContentValidator { @Override public void validate(ValidityLevel level, ContentHandle artifactContent) throws InvalidContentException { if (level == ValidityLevel.SYNTAX_ONLY || level == ValidityLevel.FULL) { try { Schema.Parser parser = new Schema.Parser(); parser.parse(artifactContent.content()); } catch (Exception e) { throw new InvalidContentException("Syntax violation for Avro artifact.", e); } } } AvroContentValidator(); @Override void validate(ValidityLevel level, ContentHandle artifactContent); }
AvroContentValidator implements ContentValidator { @Override public void validate(ValidityLevel level, ContentHandle artifactContent) throws InvalidContentException { if (level == ValidityLevel.SYNTAX_ONLY || level == ValidityLevel.FULL) { try { Schema.Parser parser = new Schema.Parser(); parser.parse(artifactContent.content()); } catch (Exception e) { throw new InvalidContentException("Syntax violation for Avro artifact.", e); } } } AvroContentValidator(); @Override void validate(ValidityLevel level, ContentHandle artifactContent);  }