@Test
public void testCycleInComponentInheritance() {

	Component c1 = new Component( "c1" ).installerName( Constants.TARGET_INSTALLER );
	Component c2 = new Component( "c2" ).installerName( Constants.TARGET_INSTALLER );
	Component c3 = new Component( "c3" ).installerName( Constants.TARGET_INSTALLER );
	Component c4 = new Component( "c4" ).installerName( Constants.TARGET_INSTALLER );
	c1.extendComponent( c2 );
	c2.extendComponent( c3 );
	c3.extendComponent( c4 );
	Assert.assertEquals( 0, RuntimeModelValidator.validate( c1 ).size());
	Assert.assertEquals( 0, RuntimeModelValidator.validate( c2 ).size());
	Assert.assertEquals( 0, RuntimeModelValidator.validate( c3 ).size());
	Assert.assertEquals( 0, RuntimeModelValidator.validate( c4 ).size());
	c4.extendComponent( c1 );
	Iterator<ModelError> iterator = RuntimeModelValidator.validate( c1 ).iterator();
	Assert.assertEquals( ErrorCode.RM_CYCLE_IN_COMPONENTS_INHERITANCE, iterator.next().getErrorCode());
	Assert.assertFalse( iterator.hasNext());
	iterator = RuntimeModelValidator.validate( c1 ).iterator();
	Assert.assertEquals( ErrorCode.RM_CYCLE_IN_COMPONENTS_INHERITANCE, iterator.next().getErrorCode());
	Assert.assertFalse( iterator.hasNext());
	iterator = RuntimeModelValidator.validate( c2 ).iterator();
	Assert.assertEquals( ErrorCode.RM_CYCLE_IN_COMPONENTS_INHERITANCE, iterator.next().getErrorCode());
	Assert.assertFalse( iterator.hasNext());
	iterator = RuntimeModelValidator.validate( c4 ).iterator();
	Assert.assertEquals( ErrorCode.RM_CYCLE_IN_COMPONENTS_INHERITANCE, iterator.next().getErrorCode());
	Assert.assertFalse( iterator.hasNext());
	c1.extendComponent( c1 );
	iterator = RuntimeModelValidator.validate( c1 ).iterator();
	Assert.assertEquals( ErrorCode.RM_CYCLE_IN_COMPONENTS_INHERITANCE, iterator.next().getErrorCode());
	Assert.assertFalse( iterator.hasNext());
}