Package org.qi4j.bootstrap

Examples of org.qi4j.bootstrap.SingletonAssembler.module()


            .atLeastOnce();
        expect( sequence.sequence().get() ).andReturn( 0 )
            .atLeastOnce();
        replay( shippingService, cargo, voyage );
        ShippingServiceTestComposite underTest =
            assembler.module().newTransient( ShippingServiceTestComposite.class );
        underTest.useMock( shippingService ).forClass( ShippingService.class );
        assertThat( "Booking result", underTest.makeBooking( cargo, voyage ), is( equalTo( -1000 ) ) );
        verify( shippingService, cargo, voyage );
    }
View Full Code Here


        expect( shippingService.makeBooking( cargo, voyage ) ).andReturn( 100 );
        expect( generator.sequence() ).andReturn( sequence ).anyTimes();
        expect( sequence.get() ).andReturn( 1000 );
        replay( shippingService, cargo, voyage, generator, sequence );
        ShippingServiceTestComposite underTest =
            assembler.module().newTransient( ShippingServiceTestComposite.class );
        underTest.useMock( shippingService ).forClass( ShippingService.class );
        underTest.useMock( generator ).forClass( HasSequence.class );
        assertThat( "Booking result", underTest.makeBooking( cargo, voyage ), is( equalTo( 1000 ) ) );
        verify( shippingService, cargo, voyage, generator, sequence );
    }
View Full Code Here

            }
            t0 = t0 / loops;
        }
        long t1 = 0;
        {
            TransientBuilderFactory module = assembler.module();
            for( int i = 0; i < loops; i++ )
            {
                t1 = t1 + testCompositeCreationPerformance( module );
            }
            t1 = t1 / loops;
View Full Code Here

            }
            t1 = t1 / loops;
        }
        long t2 = 0;
        {
            ObjectFactory objectFactory = assembler.module();
            for( int i = 0; i < loops; i++ )
            {
                t2 = t2 + testObjectCreationPerformance( objectFactory );
            }
            t2 = t2 / loops;
View Full Code Here

            }
            t2 = t2 / loops;
        }
        long t3 = 0;
        {
            ValueBuilderFactory valueBuilderFactory = assembler.module();
            for( int i = 0; i < loops; i++ )
            {
                t3 = t3 + testValueCreationPerformance( valueBuilderFactory );
            }
            t3 = t3 / loops;
View Full Code Here

            t3 = t3 / loops;
        }

        long t4 = 0;
        {
            TransientBuilderFactory module = assembler.module();
            for( int i = 0; i < loops; i++ )
            {
                t4 = t4 + testCompositeCreationWithBuilderPerformance( module );
            }
            t4 = t4 / loops;
View Full Code Here

            }
            t4 = t4 / loops;
        }
        long t6 = 0;
        {
            ValueBuilderFactory valueBuilderFactory = assembler.module();
            for( int i = 0; i < loops; i++ )
            {
                t6 = t6 + testValueCreationWithBuilderPerformance( valueBuilderFactory );
            }
            t6 = t6 / loops;
View Full Code Here

                throws AssemblyException
            {
                module.objects( AnyObject.class );
            }
        };
        ObjectFactory objectFactory = assembler.module();
        for( int i = 0; i < 10; i++ )
        {
            testPerformance( objectFactory );
        }
    }
View Full Code Here

                throws AssemblyException
            {
                module.transients( HelloWorldComposite.class );
            }
        };
        TransientBuilderFactory builderFactory = assembly.module();
        TransientBuilder<HelloWorldComposite> builder = builderFactory.newTransientBuilder( HelloWorldComposite.class );
        builder.prototype().name().set( "Hello" );
        builder.prototype().phrase().set( "World" );
        helloWorld = builder.newInstance();
    }
View Full Code Here

                    MigrationTest.this.assemble( module );
                    module.layer().application().setVersion( "1.0" );
                }
            };

            UnitOfWork uow = v1.module().newUnitOfWork();
            TestEntity1_0 entity = uow.newEntity( TestEntity1_0.class );
            entity.foo().set( "Some value" );
            entity.fooManyAssoc().add( entity );
            entity.fooAssoc().set( entity );
            id = entity.identity().get();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.