@Test
public void testInvalidRandomPortWithValue() throws Exception {

	File f = TestUtils.findTestFile( "/configurations/invalid/component-with-invalid-random-port-value.graph" );
	FromGraphDefinition fromDef = new FromGraphDefinition( f.getParentFile());
	Graphs g = fromDef.buildGraphs( f );
	Assert.assertEquals( 0, fromDef.getErrors().size());
	Collection<ModelError> errors = RuntimeModelValidator.validate( g );
	Assert.assertEquals( 1, errors.size());
	ModelError error = errors.iterator().next();
	Assert.assertEquals( ErrorCode.RM_NO_VALUE_FOR_RANDOM, error.getErrorCode());
	Assert.assertEquals( new Component( "comp2" ), error.getModelObject());
	Assert.assertEquals( 1, error.getDetails().length );
	Assert.assertEquals( ErrorDetailsKind.VARIABLE, error.getDetails()[ 0 ].getErrorDetailsKind());
	Assert.assertTrue( error.getDetails()[ 0 ].getElementName().contains( "httpPort" ));
}