Package org.qi4j.api.structure

Examples of org.qi4j.api.structure.Application


                      }
                  }
                }
            };

        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 " ).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

            throws Exception
    {
        System.setProperty( "qi4j.compacttrace", "off" );

        Energy4Java is = new Energy4Java();
        Application app = is.newApplication( new ApplicationAssembler()
        {
            public ApplicationAssembly assemble( ApplicationAssemblyFactory applicationFactory )
                    throws AssemblyException
            {
                return applicationFactory.newApplicationAssembly( new Assembler[][][]{
                        {
                                {
                                        new Assembler()
                                        {
                                            public void assemble( ModuleAssembly module )
                                                    throws AssemblyException
                                            {
                                                module.objects( PrivateEntityUnitOfWorkTest.class );
                                            }
                                        }
                                }
                        },
                        {
                                {
                                        new Assembler()
                                        {
                                            public void assemble( ModuleAssembly module )
                                                    throws AssemblyException
                                            {
                                                module.entities( ProductEntity.class );
                                                module.entities( ProductCatalogEntity.class ).visibleIn( application );
                                                module.values( ProductInfo.class );
                                                new EntityTestAssembler().assemble( module );
                                            }
                                        }
                                }
                        }
                } );
            }
        } );
        app.activate();

        Module module = app.findModule( "Layer 1", "Module 1" );
        module.injectTo( this );

        UnitOfWork unitOfWork = uowf.newUnitOfWork();

        try
View Full Code Here

                { // Infrastructure Layer
                // :
                }
            };
            ApplicationDescriptor model = newApplication( assemblers );
            Application runtime = model.newInstance( qi4j.spi() );
            runtime.activate();
        }
View Full Code Here

        ApplicationBuilder builder = new ApplicationBuilder( "Build from API test." );
        builder.withLayer( "layer1" ).using( "layer2" ).using( "layer3" );
        builder.withLayer( "layer2" );
        builder.withLayer( "layer3" ).withModule( "test module" ).
            withAssemblers( filter( matches( ".*ServiceAssembler" ), findClasses( getClass() ) ) );
        Application application = builder.newApplication();
        Module module = application.findModule( "layer3", "test module" );
        TestService service = module.findService( TestService.class ).get();
        assertThat( service.sayHello(), equalTo( "Hello Qi4j!" ) );
    }
View Full Code Here

    @Test
    public void givenJsonWhenBuildingApplicationExpectSuccess()
        throws JSONException, ActivationException, AssemblyException
    {
        ApplicationBuilder builder = ApplicationBuilder.fromJson( APPLICATION );
        Application application = builder.newApplication();
        Module module = application.findModule( "layer3", "test module" );
        TestService service = module.findService( TestService.class ).get();
        assertThat( service.sayHello(), equalTo( "Hello Qi4j!" ) );
    }
View Full Code Here

    public void givenJsonInputStreamWhenBuildingApplicationExpectSuccess()
        throws IOException, JSONException, ActivationException, AssemblyException
    {
        InputStream input = new ByteArrayInputStream( APPLICATION.getBytes( "UTF-8" ) );
        ApplicationBuilder builder = ApplicationBuilder.fromJson( input );
        Application application = builder.newApplication();
        Module module = application.findModule( "layer3", "test module" );
        TestService service = module.findService( TestService.class ).get();
        assertThat( service.sayHello(), equalTo( "Hello Qi4j!" ) );
    }
View Full Code Here

                    {
                        createAssembler()
                    }
                }
            };
            Application application = qi4j.newApplication( new ApplicationAssemblerAdapter( assemblers )
            {
            } );
            application.activate();

            Module moduleInstance = application.findModule( "Layer 1", "config" );
            UnitOfWorkFactory uowf = moduleInstance;
            UnitOfWork uow = uowf.newUnitOfWork();
            try
            {
                SQLConfiguration config = uow.get( SQLConfiguration.class,
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.