@Test
public void testTargetInstaller() throws Exception {

	Graphs graphs = new Graphs();
	graphs.getRootComponents().add( new Component( "VM" ).installerName( "target" ));
	File appDir = this.folder.newFolder();
	Collection<ModelError> errors = RuntimeModelValidator.validate( graphs, appDir );
	Assert.assertEquals( 1, errors.size());
	Assert.assertEquals( ErrorCode.PROJ_NO_RESOURCE_DIRECTORY, errors.iterator().next().getErrorCode());
	File componentDir = new File( appDir, Constants.PROJECT_DIR_GRAPH + "/VM" );
	Assert.assertTrue( componentDir.mkdirs());
	// No target.properties => no error
	errors = RuntimeModelValidator.validate( graphs, appDir );
	Assert.assertEquals( 0, errors.size());
	// A target.properties is present => no error
	File targetPropertiesFile = new File( componentDir, Constants.TARGET_PROPERTIES_FILE_NAME );
	Assert.assertTrue( targetPropertiesFile.createNewFile());
	errors = RuntimeModelValidator.validate( graphs, appDir );
	Assert.assertEquals( 3, errors.size());
	Iterator<ModelError> it = errors.iterator();
	Assert.assertEquals( ErrorCode.REC_TARGET_NO_ID, it.next().getErrorCode());
	Assert.assertEquals( ErrorCode.REC_TARGET_NO_HANDLER, it.next().getErrorCode());
	Assert.assertEquals( ErrorCode.REC_TARGET_NO_NAME, it.next().getErrorCode());
	// Add the required properties
	Utils.writeStringInto( "id: tid\nhandler: test\nname: n", targetPropertiesFile );
	errors = RuntimeModelValidator.validate( graphs, appDir );
	Assert.assertEquals( 0, errors.size());
}