@Test
public void testSelfImports() throws Exception {

	File f = TestUtils.findTestFile( "/configurations/invalid/component-self-imports.graph" );
	FileDefinition def = ParsingModelIo.readConfigurationFile( f, true );
	Assert.assertEquals( 0, def.getParsingErrors().size());
	Collection<ParsingError> validationErrors = ParsingModelValidator.validate( def );
	Assert.assertEquals( 0, validationErrors.size());
	FromGraphDefinition fromDef = new FromGraphDefinition( f.getParentFile());
	Graphs graphs = fromDef.buildGraphs( f );
	Assert.assertEquals( 0, fromDef.getErrors().size());
	Iterator<ModelError> iterator = RuntimeModelValidator.validate( graphs ).iterator();
	Assert.assertEquals( ErrorCode.RM_COMPONENT_IMPORTS_EXPORTS, iterator.next().getErrorCode());
	Assert.assertEquals( ErrorCode.RM_COMPONENT_IMPORTS_EXPORTS, iterator.next().getErrorCode());
	Assert.assertFalse( iterator.hasNext());
}