final PatternRuleLoader prg = new PatternRuleLoader();
final String name = "/xx/grammar.xml";
final List<PatternRule> rules = prg.getRules(JLanguageTool.getDataBroker().getFromRulesDirAsStream(name), name);
assertTrue(rules.size() >= 30);
final Rule demoRule1 = getRuleById("DEMO_RULE", rules);
assertEquals("http://fake-server.org/foo-bar-error-explained", demoRule1.getUrl().toString());
assertEquals("[This is <marker>fuu bah</marker>.]", demoRule1.getCorrectExamples().toString());
final List<IncorrectExample> incorrectExamples = demoRule1.getIncorrectExamples();
assertEquals(1, incorrectExamples.size());
assertEquals("This is <marker>foo bar</marker>.", incorrectExamples.get(0).getExample());
final Rule demoRule2 = getRuleById("API_OUTPUT_TEST_RULE", rules);
assertNull(demoRule2.getUrl());
assertEquals("uncategorized", demoRule1.getLocQualityIssueType());
assertEquals("tag inheritance failed", "addition", getRuleById("TEST_GO", rules).getLocQualityIssueType());
assertEquals("tag inheritance overwrite failed", "uncategorized", getRuleById("TEST_PHRASES1", rules).getLocQualityIssueType());
assertEquals("tag inheritance overwrite failed", "characters", getRuleById("test_include", rules).getLocQualityIssueType());