@Test
public void testFacet() {

	Facet facet = new Facet();
	Iterator<ModelError> iterator = RuntimeModelValidator.validate( facet ).iterator();
	Assert.assertEquals( ErrorCode.RM_EMPTY_FACET_NAME, iterator.next().getErrorCode());
	Assert.assertFalse( iterator.hasNext());
	facet.setName( "my # facet" );
	iterator = RuntimeModelValidator.validate( facet ).iterator();
	Assert.assertEquals( ErrorCode.RM_INVALID_FACET_NAME, iterator.next().getErrorCode());
	Assert.assertFalse( iterator.hasNext());
	facet.setName( "my.facet" );
	iterator = RuntimeModelValidator.validate( facet ).iterator();
	Assert.assertEquals( ErrorCode.RM_DOT_IS_NOT_ALLOWED, iterator.next().getErrorCode());
	Assert.assertFalse( iterator.hasNext());
	facet.setName( "facet" );
	iterator = RuntimeModelValidator.validate( facet ).iterator();
	Assert.assertFalse( iterator.hasNext());
	facet.addExportedVariable( new ExportedVariable( "", "value" ));
	iterator = RuntimeModelValidator.validate( facet ).iterator();
	Assert.assertEquals( ErrorCode.RM_EMPTY_VARIABLE_NAME, iterator.next().getErrorCode());
	Assert.assertFalse( iterator.hasNext());
	facet.exportedVariables.clear();
	facet.addExportedVariable( new ExportedVariable( "facet.inva!id", "value" ));
	iterator = RuntimeModelValidator.validate( facet ).iterator();
	Assert.assertEquals( ErrorCode.RM_INVALID_VARIABLE_NAME, iterator.next().getErrorCode());
	Assert.assertFalse( iterator.hasNext());
	facet.exportedVariables.clear();
	facet.addExportedVariable( new ExportedVariable( "toto", "" ));
	iterator = RuntimeModelValidator.validate( facet ).iterator();
	Assert.assertFalse( iterator.hasNext());
	facet.exportedVariables.clear();
	facet.addExportedVariable( new ExportedVariable( "toto.ip", "" ));
	iterator = RuntimeModelValidator.validate( facet ).iterator();
	Assert.assertFalse( iterator.hasNext());
	facet.exportedVariables.clear();
}