@Test
public void testLoadApplication_AppWithExternalDependencies() throws Exception {

	File directory = TestUtils.findTestFile( "/applications/app-with-external-dependencies" );
	ApplicationLoadResult result = RuntimeModelIo.loadApplication( directory );
	Assert.assertNotNull( result );
	Assert.assertNotNull( result.applicationTemplate );
	Assert.assertEquals( 2, result.applicationTemplate.externalExports.size());
	Assert.assertEquals( "DEP.c", result.applicationTemplate.externalExports.get( "VM.config" ));
	Assert.assertEquals( "DEP.ip", result.applicationTemplate.externalExports.get( "App.ip" ));
	Assert.assertEquals( 2, result.loadErrors.size());
	for( RoboconfError error : result.loadErrors )
		Assert.assertEquals( ErrorCode.PROJ_NO_RESOURCE_DIRECTORY, error.getErrorCode());
	Assert.assertEquals( "app-with-dep", result.applicationTemplate.getName());
	Assert.assertNotNull( result.applicationTemplate.getGraphs());
	Graphs g = result.applicationTemplate.getGraphs();
	Assert.assertEquals( 1, g.getRootComponents().size());
	Component vmComponent = g.getRootComponents().iterator().next();
	Assert.assertEquals( "VM", vmComponent.getName());
	Assert.assertEquals( "target", vmComponent.getInstallerName());
	Assert.assertEquals( 0, vmComponent.getFacets().size());
	Collection<Component> children = ComponentHelpers.findAllChildren( vmComponent );
	Assert.assertEquals( 1, children.size());
	Component childComponent = children.iterator().next();
	Assert.assertEquals( "App", childComponent.getName());
	Assert.assertEquals( "logger", childComponent.getInstallerName());
	Assert.assertEquals( 0, childComponent.getChildren().size());
	Assert.assertEquals( 1, childComponent.exportedVariables.size());
	Assert.assertNull( childComponent.exportedVariables.get( "App.ip" ));
	Assert.assertEquals( 2, childComponent.importedVariables.size());
	Assert.assertTrue( childComponent.importedVariables.containsKey( "VM.config" ));
	Assert.assertFalse( childComponent.importedVariables.get( "VM.config" ).isOptional());
	Assert.assertFalse( childComponent.importedVariables.get( "VM.config" ).isExternal());
	Assert.assertTrue( childComponent.importedVariables.containsKey( "App1.test" ));
	Assert.assertFalse( childComponent.importedVariables.get( "App1.test" ).isOptional());
	Assert.assertTrue( childComponent.importedVariables.get( "App1.test" ).isExternal());
}