@Test
public void testBuildTailoredImport_withWildcard() {

	String instancePath = "/whatever/this/is/a-test";
	Component comp = new Component( "comp" );
	comp.addImportedVariable( new ImportedVariable( "comp1.*", false, false ));
	comp.addImportedVariable( new ImportedVariable( "comp2.option", true, false ));
	Instance inst = new Instance( "inst" ).component( comp );
	// Null map
	Import imp = ImportHelpers.buildTailoredImport( inst, instancePath, "comp", null );
	Assert.assertEquals( instancePath, imp.getInstancePath());
	Assert.assertEquals( 0, imp.getExportedVars().size());
	// Empty map
	imp = ImportHelpers.buildTailoredImport( inst, instancePath, "comp", new HashMap<String,String> ());
	Assert.assertEquals( 0, imp.getExportedVars().size());
	// Map with various variable
	Map<String,String> map = new HashMap<String,String> ();
	map.put( "comp1.ip", "127.0.0.1" );
	map.put( "comp2.option", "ciao!" );
	map.put( "not.a.valid.variable", "yeah" );
	map.put( null, "null" );
	map.put( "", "hop" );
	imp = ImportHelpers.buildTailoredImport( inst, instancePath, "comp", map );
	Assert.assertEquals( instancePath, imp.getInstancePath());
	Assert.assertEquals( 2, imp.getExportedVars().size());
	Assert.assertEquals( "comp", imp.getComponentName());
	Assert.assertEquals( "127.0.0.1", imp.getExportedVars().get( "comp1.ip" ));
	Assert.assertEquals( "ciao!", imp.getExportedVars().get( "comp2.option" ));
}