@Test
public void generateMappingsTest() {

	Resource r1 = new Resource("type1");
	Resource r2 = new Resource("type2");
	ResourceTypes<Resource> types = new ResourceTypes<Resource>();
	types.put("r1", r1);
	types.put("r2", r2);
	Link l1 = new Link("linkType1");
	LinkTypes<Link> linkTypes = new LinkTypes<Link>();
	linkTypes.put("l1", l1);
	Task t1 = new Task("t1");
	Task t2 = new Task("t2");
	Mappings<Task, Resource> typeMappings = new Mappings<Task, Resource>();
	Mapping<Task, Resource> m1 = new Mapping<Task, Resource>("m1", t1, r1);
	Mapping<Task, Resource> m2 = new Mapping<Task, Resource>("m2", t1, r2);
	Mapping<Task, Resource> m3 = new Mapping<Task, Resource>("m3", t2, r1);
	m3.setAttribute("M1", 0);
	typeMappings.add(m1);
	typeMappings.add(m2);
	typeMappings.add(m3);
	SpecificationTransformerTypeBased<SpecificationTypeBased, Specification> transformer = new SpecificationTransformerTypeBased<SpecificationTypeBased, Specification>();
	Architecture<Resource, Link> arch = transformer.generateArchitecture(types, linkTypes);
	Mappings<Task, Resource> mappings = transformer.generateMappings(typeMappings, arch);
	Assert.assertNotNull(mappings);
	Assert.assertEquals(mappings.size(), 3);
	Assert.assertEquals(mappings.get(t1).size(), 2);
	Assert.assertEquals(mappings.get(t2).size(), 1);
	Assert.assertEquals(mappings.get(t2).iterator().next().getAttribute("M1"), 0);
}