Validator extends AbstractGltfValidator { public ValidatorResult validate() { validateAsset(); ValidatorContext context = new ValidatorContext("glTF"); ValidatorResult validatorResult = new ValidatorResult(); validatorResult.add(validateScenes(context)); validatorResult.add(validateNodes(context)); validatorResult.add(validateMeshes(context)); validatorResult.add(validateAccessors(context)); validatorResult.add(validateBufferViews(context)); validatorResult.add(validateMaterials(context)); validatorResult.add(validateTechniques(context)); validatorResult.add(validatePrograms(context)); validatorResult.add(validateShaders(context)); validatorResult.add(validateTextures(context)); return validatorResult; } Validator(GlTF gltf); boolean isValid(); ValidatorResult validate();  }
@Test public void testEmptyGltfPasses() { GlTF gltf = new GlTF(); Validator validator = new Validator(gltf); ValidatorResult validatorResult = validator.validate(); assertFalse(validatorResult.hasErrors()); }
@Test public void testInvalidNodeId() { GlTF gltf = new GlTF(); Scene scene = new Scene(); scene.addNodes("INVALID_ID"); gltf.addScenes("scene0", scene); Validator validator = new Validator(gltf); ValidatorResult validatorResult = validator.validate(); assertEquals(1, validatorResult.getErrors().size()); }