@Test
public void testFindAllFacets() {

	ApplicationTemplate app = ComplexApplicationFactory1.newApplication();
	Component root1 = ComponentHelpers.findComponent( app.getGraphs(), ComplexApplicationFactory1.ROOT_1 );
	Assert.assertNotNull( root1 );
	Collection<Facet> facets = ComponentHelpers.findAllFacets( root1 );
	Assert.assertEquals( 1, facets.size());
	Assert.assertTrue( facets.contains( new Facet( ComplexApplicationFactory1.FACET_VM )));
	Component mongoDb = ComponentHelpers.findComponent( app.getGraphs(), ComplexApplicationFactory1.MONGO_DB );
	Assert.assertNotNull( mongoDb );
	facets = ComponentHelpers.findAllFacets( mongoDb );
	Assert.assertEquals( 0, facets.size());
	Component glassfish = ComponentHelpers.findComponent( app.getGraphs(), ComplexApplicationFactory1.GLASSFISH );
	Assert.assertNotNull( glassfish );
	facets = ComponentHelpers.findAllFacets( glassfish );
	Assert.assertEquals( 3, facets.size());
	Assert.assertTrue( facets.contains( new Facet( ComplexApplicationFactory1.FACET_JEE )));
	Assert.assertTrue( facets.contains( new Facet( ComplexApplicationFactory1.FACET_WEB )));
	Assert.assertTrue( facets.contains( new Facet( ComplexApplicationFactory1.FACET_DEPLOYABLE )));
	Component tomcat = ComponentHelpers.findComponent( app.getGraphs(), ComplexApplicationFactory1.TOMCAT );
	Assert.assertNotNull( tomcat );
	facets = ComponentHelpers.findAllFacets( tomcat );
	Assert.assertEquals( 2, facets.size());
	Assert.assertTrue( facets.contains( new Facet( ComplexApplicationFactory1.FACET_WEB )));
	Assert.assertTrue( facets.contains( new Facet( ComplexApplicationFactory1.FACET_DEPLOYABLE )));
	Component tomcat8 = ComponentHelpers.findComponent( app.getGraphs(), ComplexApplicationFactory1.TOMCAT_8 );
	Assert.assertNotNull( tomcat8 );
	facets = ComponentHelpers.findAllFacets( tomcat8 );
	Assert.assertEquals( 2, facets.size());
	Assert.assertTrue( facets.contains( new Facet( ComplexApplicationFactory1.FACET_WEB )));
	Assert.assertTrue( facets.contains( new Facet( ComplexApplicationFactory1.FACET_DEPLOYABLE )));
}