@Test
public void testInstance_noVariableValue() {

	// Create a valid instance and a valid component
	Instance inst = new Instance( "my instance" );
	Iterator<ModelError> iterator = RuntimeModelValidator.validate( inst ).iterator();
	Assert.assertEquals( ErrorCode.RM_EMPTY_INSTANCE_COMPONENT, iterator.next().getErrorCode());
	Assert.assertFalse( iterator.hasNext());
	Component comp = new Component( "comp" ).installerName( "target" );
	comp.addExportedVariable( new ExportedVariable( "ip", "" ));
	comp.addExportedVariable( new ExportedVariable( "p1", "value1" ));
	comp.addExportedVariable( new ExportedVariable( "p2", "" ));
	Assert.assertEquals( 0, RuntimeModelValidator.validate( comp ).size());
	// Associate them together => variable without value
	inst.setComponent( comp );
	iterator = RuntimeModelValidator.validate( inst ).iterator();
	Assert.assertEquals( ErrorCode.RM_MISSING_VARIABLE_VALUE, iterator.next().getErrorCode());
	Assert.assertFalse( iterator.hasNext());
	// Fix it and make sure validation succeeds
	inst.overriddenExports.put( "inst.value1", "whatever" );
	inst.overriddenExports.put( "comp.p2", "a default value" );
	iterator = RuntimeModelValidator.validate( inst ).iterator();
	Assert.assertEquals( ErrorCode.RM_MAGIC_INSTANCE_VARIABLE, iterator.next().getErrorCode());
	Assert.assertFalse( iterator.hasNext());
	// Define a new instance variable without value => error
	inst.overriddenExports.put( "something else", "" );
	iterator = RuntimeModelValidator.validate( inst ).iterator();
	Assert.assertEquals( ErrorCode.RM_MAGIC_INSTANCE_VARIABLE, iterator.next().getErrorCode());
	Assert.assertEquals( ErrorCode.RM_MAGIC_INSTANCE_VARIABLE, iterator.next().getErrorCode());
	Assert.assertEquals( ErrorCode.RM_MISSING_VARIABLE_VALUE, iterator.next().getErrorCode());
	Assert.assertFalse( iterator.hasNext());
}