@Test
public void testFindAllExportedVariables_withFacet() {

	Component comp = new Component( "comp" );
	comp.addExportedVariable( new ExportedVariable( "test", "ok" ));
	Facet f = new Facet( "facet" );
	f.addExportedVariable( new ExportedVariable( "property", "value" ));
	comp.associateFacet( f );
	Map<String,String> exports = ComponentHelpers.findAllExportedVariables( comp );
	Assert.assertEquals( 3, exports.size());
	Assert.assertEquals( "ok", exports.get( "comp.test" ));
	Assert.assertEquals( "value", exports.get( "facet.property" ));
	Assert.assertEquals( "value", exports.get( "comp.property" ));
	// Override a facet property
	comp.addExportedVariable( new ExportedVariable( "facet.property", "something different" ));
	exports = ComponentHelpers.findAllExportedVariables( comp );
	Assert.assertEquals( 3, exports.size());
	Assert.assertEquals( "ok", exports.get( "comp.test" ));
	Assert.assertEquals( "something different", exports.get( "facet.property" ));
	Assert.assertEquals( "something different", exports.get( "comp.property" ));
	// Global override
	comp.exportedVariables.remove( "facet.property" );
	comp.addExportedVariable( new ExportedVariable( "property", "great" ));
	exports = ComponentHelpers.findAllExportedVariables( comp );
	Assert.assertEquals( 3, exports.size());
	Assert.assertEquals( "ok", exports.get( "comp.test" ));
	Assert.assertEquals( "great", exports.get( "facet.property" ));
	Assert.assertEquals( "great", exports.get( "comp.property" ));
	// Local override
	comp.exportedVariables.remove( "property" );
	comp.addExportedVariable( new ExportedVariable( "comp.property", "ha! ha!" ));
	exports = ComponentHelpers.findAllExportedVariables( comp );
	Assert.assertEquals( 3, exports.size());
	Assert.assertEquals( "ok", exports.get( "comp.test" ));
	Assert.assertEquals( "value", exports.get( "facet.property" ));
	Assert.assertEquals( "ha! ha!", exports.get( "comp.property" ));
	// Verify we find the same thing with the abstract method
	Map<String,String> abstractExports = ComponentHelpers.findAllExportedVariables((AbstractType) comp);
	Assert.assertEquals( abstractExports.size(), exports.size());
	abstractExports = ComponentHelpers.findAllExportedVariables((AbstractType) f);
	Assert.assertEquals( 1, abstractExports.size());
}