@Test public void getSailWithCustomConfigSetsConfigurationCorrectly() { ShaclSailConfig config = new ShaclSailConfig(); config.setCacheSelectNodes(!config.isCacheSelectNodes()); config.setGlobalLogValidationExecution(!config.isGlobalLogValidationExecution()); config.setIgnoreNoShapesLoadedException(!config.isIgnoreNoShapesLoadedException()); config.setLogValidationPlans(!config.isLogValidationPlans()); config.setLogValidationViolations(!config.isLogValidationViolations()); config.setParallelValidation(!config.isParallelValidation()); config.setUndefinedTargetValidatesAllSubjects(!config.isUndefinedTargetValidatesAllSubjects()); config.setValidationEnabled(!config.isValidationEnabled()); config.setPerformanceLogging(!config.isPerformanceLogging()); config.setSerializableValidation(!config.isSerializableValidation()); config.setRdfsSubClassReasoning(!config.isRdfsSubClassReasoning()); ShaclSail sail = (ShaclSail) subject.getSail(config); assertMatchesConfig(sail, config); }
@Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } ShaclSail sail = new ShaclSail(); if (config instanceof ShaclSailConfig) { ShaclSailConfig shaclSailConfig = (ShaclSailConfig) config; if (shaclSailConfig.isValidationEnabled()) { sail.enableValidation(); } else { sail.disableValidation(); } sail.setCacheSelectNodes(shaclSailConfig.isCacheSelectNodes()); sail.setUndefinedTargetValidatesAllSubjects(shaclSailConfig.isUndefinedTargetValidatesAllSubjects()); sail.setIgnoreNoShapesLoadedException(shaclSailConfig.isIgnoreNoShapesLoadedException()); sail.setLogValidationPlans(shaclSailConfig.isLogValidationPlans()); sail.setLogValidationViolations(shaclSailConfig.isLogValidationViolations()); sail.setParallelValidation(shaclSailConfig.isParallelValidation()); sail.setGlobalLogValidationExecution(shaclSailConfig.isGlobalLogValidationExecution()); sail.setPerformanceLogging(shaclSailConfig.isPerformanceLogging()); sail.setSerializableValidation(shaclSailConfig.isSerializableValidation()); sail.setRdfsSubClassReasoning(shaclSailConfig.isRdfsSubClassReasoning()); } return sail; }
ShaclSailFactory implements SailFactory { @Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } ShaclSail sail = new ShaclSail(); if (config instanceof ShaclSailConfig) { ShaclSailConfig shaclSailConfig = (ShaclSailConfig) config; if (shaclSailConfig.isValidationEnabled()) { sail.enableValidation(); } else { sail.disableValidation(); } sail.setCacheSelectNodes(shaclSailConfig.isCacheSelectNodes()); sail.setUndefinedTargetValidatesAllSubjects(shaclSailConfig.isUndefinedTargetValidatesAllSubjects()); sail.setIgnoreNoShapesLoadedException(shaclSailConfig.isIgnoreNoShapesLoadedException()); sail.setLogValidationPlans(shaclSailConfig.isLogValidationPlans()); sail.setLogValidationViolations(shaclSailConfig.isLogValidationViolations()); sail.setParallelValidation(shaclSailConfig.isParallelValidation()); sail.setGlobalLogValidationExecution(shaclSailConfig.isGlobalLogValidationExecution()); sail.setPerformanceLogging(shaclSailConfig.isPerformanceLogging()); sail.setSerializableValidation(shaclSailConfig.isSerializableValidation()); sail.setRdfsSubClassReasoning(shaclSailConfig.isRdfsSubClassReasoning()); } return sail; } }
ShaclSailFactory implements SailFactory { @Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } ShaclSail sail = new ShaclSail(); if (config instanceof ShaclSailConfig) { ShaclSailConfig shaclSailConfig = (ShaclSailConfig) config; if (shaclSailConfig.isValidationEnabled()) { sail.enableValidation(); } else { sail.disableValidation(); } sail.setCacheSelectNodes(shaclSailConfig.isCacheSelectNodes()); sail.setUndefinedTargetValidatesAllSubjects(shaclSailConfig.isUndefinedTargetValidatesAllSubjects()); sail.setIgnoreNoShapesLoadedException(shaclSailConfig.isIgnoreNoShapesLoadedException()); sail.setLogValidationPlans(shaclSailConfig.isLogValidationPlans()); sail.setLogValidationViolations(shaclSailConfig.isLogValidationViolations()); sail.setParallelValidation(shaclSailConfig.isParallelValidation()); sail.setGlobalLogValidationExecution(shaclSailConfig.isGlobalLogValidationExecution()); sail.setPerformanceLogging(shaclSailConfig.isPerformanceLogging()); sail.setSerializableValidation(shaclSailConfig.isSerializableValidation()); sail.setRdfsSubClassReasoning(shaclSailConfig.isRdfsSubClassReasoning()); } return sail; }  }
ShaclSailFactory implements SailFactory { @Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } ShaclSail sail = new ShaclSail(); if (config instanceof ShaclSailConfig) { ShaclSailConfig shaclSailConfig = (ShaclSailConfig) config; if (shaclSailConfig.isValidationEnabled()) { sail.enableValidation(); } else { sail.disableValidation(); } sail.setCacheSelectNodes(shaclSailConfig.isCacheSelectNodes()); sail.setUndefinedTargetValidatesAllSubjects(shaclSailConfig.isUndefinedTargetValidatesAllSubjects()); sail.setIgnoreNoShapesLoadedException(shaclSailConfig.isIgnoreNoShapesLoadedException()); sail.setLogValidationPlans(shaclSailConfig.isLogValidationPlans()); sail.setLogValidationViolations(shaclSailConfig.isLogValidationViolations()); sail.setParallelValidation(shaclSailConfig.isParallelValidation()); sail.setGlobalLogValidationExecution(shaclSailConfig.isGlobalLogValidationExecution()); sail.setPerformanceLogging(shaclSailConfig.isPerformanceLogging()); sail.setSerializableValidation(shaclSailConfig.isSerializableValidation()); sail.setRdfsSubClassReasoning(shaclSailConfig.isRdfsSubClassReasoning()); } return sail; }  @Override String getSailType(); @Override SailImplConfig getConfig(); @Override Sail getSail(SailImplConfig config); }
ShaclSailFactory implements SailFactory { @Override public Sail getSail(SailImplConfig config) throws SailConfigException { if (!SAIL_TYPE.equals(config.getType())) { throw new SailConfigException("Invalid Sail type: " + config.getType()); } ShaclSail sail = new ShaclSail(); if (config instanceof ShaclSailConfig) { ShaclSailConfig shaclSailConfig = (ShaclSailConfig) config; if (shaclSailConfig.isValidationEnabled()) { sail.enableValidation(); } else { sail.disableValidation(); } sail.setCacheSelectNodes(shaclSailConfig.isCacheSelectNodes()); sail.setUndefinedTargetValidatesAllSubjects(shaclSailConfig.isUndefinedTargetValidatesAllSubjects()); sail.setIgnoreNoShapesLoadedException(shaclSailConfig.isIgnoreNoShapesLoadedException()); sail.setLogValidationPlans(shaclSailConfig.isLogValidationPlans()); sail.setLogValidationViolations(shaclSailConfig.isLogValidationViolations()); sail.setParallelValidation(shaclSailConfig.isParallelValidation()); sail.setGlobalLogValidationExecution(shaclSailConfig.isGlobalLogValidationExecution()); sail.setPerformanceLogging(shaclSailConfig.isPerformanceLogging()); sail.setSerializableValidation(shaclSailConfig.isSerializableValidation()); sail.setRdfsSubClassReasoning(shaclSailConfig.isRdfsSubClassReasoning()); } return sail; }  @Override String getSailType(); @Override SailImplConfig getConfig(); @Override Sail getSail(SailImplConfig config); static final String SAIL_TYPE; }