public void testLayersCanBeCreatedInOrderDifferentFromTheirDependency()
throws AssemblyException
{
Energy4Java qi4j = new Energy4Java();
Application app = qi4j.newApplication( new ApplicationAssembler()
{
public ApplicationAssembly assemble( ApplicationAssemblyFactory applicationFactory )
throws AssemblyException
{
ApplicationAssembly assembly = applicationFactory.newApplicationAssembly();
LayerAssembly domainLayer = assembly.layer( null );
domainLayer.setName( "Domain" );
LayerAssembly infrastructureLayer = assembly.layer( null );
infrastructureLayer.setName( "Infrastructure" );
domainLayer.uses( infrastructureLayer );
return assembly;
}
} );
ApplicationDescriptor model = app.descriptor();
model.accept( new HierarchicalVisitor<Object, Object, RuntimeException>()
{
@Override
public boolean visitEnter( Object visited ) throws RuntimeException
{