Package org.qi4j.api.structure

Examples of org.qi4j.api.structure.Application


    @Ignore( "Must fix the TODOs below." )
    public void testPlugins()
        throws Exception
    {
        Energy4Java runtime = new Energy4Java();
        Application app = runtime.newApplication( new MainApplicationAssembler() );
        app.activate();
    }
View Full Code Here


    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
            {
View Full Code Here

                  {
                      new AssemblerB()
                  }
                }
            };
        Application app = boot.newApplication( new ApplicationAssemblerAdapter( assemblers )
        {
        } );
        app.activate();
        ObjectA object = app.findModule( "Layer 1", "Module A" ).newObject( ObjectA.class );
        object.test();
    }
View Full Code Here

    @Test
    public void givenFixture1WhenGetNameThenConfiguredNameIsReturned()
        throws AssemblyException
    {
        Application app = givenFixture1();

        Module module = app.findModule( "Layer 1", "Module 1" ).newTransient( TestComposite1.class ).getModule();
        assertThat( "module name is correct", module.name(), equalTo( "Module 1" ) );
    }
View Full Code Here

    @Test
    public void givenFixture1WhenGetModuleForCompositeThenCorrectModuleIsReturned()
        throws AssemblyException
    {
        Application app = givenFixture1();

        Module module = app.findModule( "Layer 1", "Module 1" ).newTransient( TestComposite1.class ).getModule();
        assertThat( "module for composite is correct", module, equalTo( module ) );
    }
View Full Code Here

    @Test
    public void givenFixture1WhenFindFromAnotherModuleThenCompositeTypeIsReturned()
        throws ClassNotFoundException, AssemblyException
    {
        Application app = givenFixture1();

        Module module = app.findModule( "Layer 1", "Module 1" ).newTransient( TestComposite1.class ).getModule();
        module.classLoader().loadClass( TestComposite2.class.getName() );
    }
View Full Code Here

                     }
                  }
                }
            };

        Application app = boot.newApplication( new ApplicationAssemblerAdapter( assemblers )
        {
        } );
        app.activate();
        ObjectA object = app.findModule( "Layer 1", "Module A" ).newObject( ObjectA.class );
        assertEquals( "ok", object.test1() );
        assertEquals( "abc", object.test2() );
    }
View Full Code Here

                     }
                  }
                }
            };

        Application app = boot.newApplication( new ApplicationAssemblerAdapter( assemblers )
        {
        } );
        app.activate();
        ObjectA object = app.findModule( "Layer 1", "Module A" ).newObject( ObjectA.class );
        assertEquals( "ok", object.test1() );
        assertEquals( "abc", object.test2() );
    }
View Full Code Here

                      }
                  }
                }
            };

        Application app = boot.newApplication( new ApplicationAssemblerAdapter( assemblers )
        {
        } );
        app.activate();
        ObjectA object = app.findModule( "Layer 1", "Module A" ).newObject( ObjectA.class );
        assertEquals( "ok", object.test1() );
        assertEquals( "abc", object.test2() );
    }
View Full Code Here

                      }
                  }
                }
            };

        Application app = boot.newApplication( new ApplicationAssemblerAdapter( assemblers )
        {
        } );
        app.activate();
        ObjectA object = app.findModule( "Layer 1", "Module A" ).newObject( ObjectA.class );
        assertEquals( "ok", object.test1() );
        assertEquals( "abc", object.test2() );
    }
View Full Code Here

TOP

Related Classes of org.qi4j.api.structure.Application

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.