NoCyclesInConditionGroupInheritanceValidator implements
		ITestSuiteValidator { @Override public void validate(XMLTestSuiteDocument suite) throws SpecificationException { Map<String, XMLConditionGroup> conditionGroups = extractConditionGroups(suite.getTestSuite()); findCyclesInConditionGroups(conditionGroups); }  @Override void validate(XMLTestSuiteDocument suite);  }
@Test public void testNoCycles() throws Exception { XMLConditionGroup cg = cgs.addNewConditionGroup(); cg.setName("CG1"); XMLConditionGroup cg2 = cgs.addNewConditionGroup(); cg2.setName("CG2"); cg2.setInheritFrom("CG1"); v.validate(doc); }
@Test(expected=SpecificationException.class) public void testSelfReference() throws SpecificationException { XMLConditionGroup cg = cgs.addNewConditionGroup(); cg.setName("CG1"); cg.setInheritFrom("CG1"); v.validate(doc); }
@Test(expected=SpecificationException.class) public void testCyclicReference() throws SpecificationException { XMLConditionGroup cg1 = cgs.addNewConditionGroup(); cg1.setName("CG1"); cg1.setInheritFrom("CG2"); XMLConditionGroup cg2 = cgs.addNewConditionGroup(); cg2.setName("CG2"); cg2.setInheritFrom("CG1"); v.validate(doc); }