Package com.clarkparsia.pellint.lintpattern

Examples of com.clarkparsia.pellint.lintpattern.LintPatternLoader


    }
  }

  private void runLintForOWL() throws OWLOntologyCreationException, OWLOntologyChangeException,
      UnknownOWLOntologyException, OWLOntologyStorageException, FileNotFoundException {
    LintPatternLoader patternLoader = new LintPatternLoader( loadProperties() );
    List<AxiomLintPattern> axiomLintPatterns = patternLoader.getAxiomLintPatterns();
    List<OntologyLintPattern> ontologyLintPatterns = patternLoader.getOntologyLintPatterns();
    logLoadedPatterns( axiomLintPatterns, ontologyLintPatterns );

    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
   
    OWLOntology rootOntology = null;
View Full Code Here


    }
  }

  private void runLintForOWL() throws OWLOntologyCreationException, OWLOntologyChangeException,
      UnknownOWLOntologyException, OWLOntologyStorageException, FileNotFoundException {
    LintPatternLoader patternLoader = new LintPatternLoader( loadProperties() );
    List<AxiomLintPattern> axiomLintPatterns = patternLoader.getAxiomLintPatterns();
    List<OntologyLintPattern> ontologyLintPatterns = patternLoader.getOntologyLintPatterns();
    logLoadedPatterns( axiomLintPatterns, ontologyLintPatterns );

    OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
   
    OWLOntology rootOntology = null;
View Full Code Here

   
    Properties prop = new Properties();
    prop.setProperty(MOCK_AXIOM_LINT_PATTERN_NAME, "ON");
    prop.setProperty(MOCK_AXIOM_LINT_PATTERN_NAME + "." + INT_PARAM, String.valueOf(EXPECTED_INT_PARAM));
    prop.setProperty(MOCK_AXIOM_LINT_PATTERN_NAME + "." + STRING_PARAM, EXPECTED_STRING_PARAM);
    LintPatternLoader loader = new LintPatternLoader(prop);
   
    assertEquals(1, loader.getAxiomLintPatterns().size());
    assertEquals(0, loader.getOntologyLintPatterns().size());
   
    MockAxiomLintPattern pattern = (MockAxiomLintPattern) loader.getAxiomLintPatterns().get(0);
    assertEquals(EXPECTED_INT_PARAM, pattern.getIntParam());
    assertEquals(EXPECTED_STRING_PARAM, pattern.getStringParam());
  }
View Full Code Here

   
    Properties prop = new Properties();
    prop.setProperty(MOCK_ONTOLOGY_LINT_PATTERN_NAME, "ON");
    prop.setProperty(MOCK_ONTOLOGY_LINT_PATTERN_NAME + "." + INT_PARAM, String.valueOf(EXPECTED_INT_PARAM));
    prop.setProperty(MOCK_ONTOLOGY_LINT_PATTERN_NAME + "." + STRING_PARAM, EXPECTED_STRING_PARAM);
    LintPatternLoader loader = new LintPatternLoader(prop);
   
    assertEquals(1, loader.getOntologyLintPatterns().size());
    assertEquals(0, loader.getAxiomLintPatterns().size());
   
    MockOntologyLintPattern pattern = (MockOntologyLintPattern) loader.getOntologyLintPatterns().get(0);
    assertEquals(EXPECTED_INT_PARAM, pattern.getIntParam());
    assertEquals(EXPECTED_STRING_PARAM, pattern.getStringParam());
  }
View Full Code Here

  @Test
  public void testOff() {
    Properties prop = new Properties();
    prop.setProperty(MOCK_AXIOM_LINT_PATTERN_NAME, "OFF");
    prop.setProperty(MOCK_ONTOLOGY_LINT_PATTERN_NAME, "XXX");
    LintPatternLoader loader = new LintPatternLoader(prop);
   
    assertEquals(LintPatternLoader.DEFAULT_AXIOM_LINT_PATTERNS, loader.getAxiomLintPatterns());
    assertEquals(LintPatternLoader.DEFAULT_ONTOLOGY_LINT_PATTERNS, loader.getOntologyLintPatterns());
  }
View Full Code Here

  @Test
  public void testPatternNotFound() {
    Properties prop = new Properties();
    prop.setProperty("com.foo", "on");
    prop.setProperty("com.foo", "off");
    LintPatternLoader loader = new LintPatternLoader(prop);
   
    assertEquals(LintPatternLoader.DEFAULT_AXIOM_LINT_PATTERNS, loader.getAxiomLintPatterns());
    assertEquals(LintPatternLoader.DEFAULT_ONTOLOGY_LINT_PATTERNS, loader.getOntologyLintPatterns());
  }
View Full Code Here

    Properties prop = new Properties();
    prop.setProperty(MOCK_AXIOM_LINT_PATTERN_NAME, "ON");
    prop.setProperty(MOCK_AXIOM_LINT_PATTERN_NAME + "." + "foo", "10");
    prop.setProperty(MOCK_ONTOLOGY_LINT_PATTERN_NAME, "ON");
    prop.setProperty(MOCK_ONTOLOGY_LINT_PATTERN_NAME + "." + "foo", "X");
    LintPatternLoader loader = new LintPatternLoader(prop);
   
    assertEquals(1, loader.getAxiomLintPatterns().size());
    assertEquals(1, loader.getOntologyLintPatterns().size());
   
    MockAxiomLintPattern axiomPattern = (MockAxiomLintPattern) loader.getAxiomLintPatterns().get(0);
    assertEquals(0, axiomPattern.getIntParam());
    assertNull(axiomPattern.getStringParam());
   
    MockOntologyLintPattern ontologyPattern = (MockOntologyLintPattern) loader.getOntologyLintPatterns().get(0);
    assertEquals(0, ontologyPattern.getIntParam());
    assertNull(ontologyPattern.getStringParam());
  }
View Full Code Here

  @Test
  public void testParamWrongType1() {
    Properties prop = new Properties();
    prop.setProperty(MOCK_AXIOM_LINT_PATTERN_NAME, "ON");
    prop.setProperty(MOCK_AXIOM_LINT_PATTERN_NAME + "." + INT_PARAM, "XXX");
    LintPatternLoader loader = new LintPatternLoader(prop);
   
    MockAxiomLintPattern axiomPattern = (MockAxiomLintPattern) loader.getAxiomLintPatterns().get(0);
    assertEquals(0, axiomPattern.getIntParam());
  }
View Full Code Here

  @Test
  public void testParamWrongType2() {
    Properties prop = new Properties();
    prop.setProperty(MOCK_AXIOM_LINT_PATTERN_NAME, "ON");
    prop.setProperty(MOCK_AXIOM_LINT_PATTERN_NAME + "." + INT_PARAM, "5.5");
    LintPatternLoader loader = new LintPatternLoader(prop);
   
    MockAxiomLintPattern axiomPattern = (MockAxiomLintPattern) loader.getAxiomLintPatterns().get(0);
    assertEquals(0, axiomPattern.getIntParam());
  }
View Full Code Here

TOP

Related Classes of com.clarkparsia.pellint.lintpattern.LintPatternLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.