Examples of Module()


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

            {
                module.objects( ManyConstructorObject.class );
            }
        };

        ManyConstructorObject object = assembler.module().newObject( ManyConstructorObject.class );
        Assert.assertThat( "ref is not null", object.anyObject, notNullValue() );

        object = assembler.module()
            .newObject( ManyConstructorObject.class, new AnyObject() );
View Full Code Here

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

        };

        ManyConstructorObject object = assembler.module().newObject( ManyConstructorObject.class );
        Assert.assertThat( "ref is not null", object.anyObject, notNullValue() );

        object = assembler.module()
            .newObject( ManyConstructorObject.class, new AnyObject() );

        Assert.assertThat( "ref is not null", object.anyObject, notNullValue() );
    }
View Full Code Here

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

            {
                module.objects( OuterClass.class );
            }
        };

        Assert.assertThat( "inner class has been injected", assembler.module().newObject( OuterClass.class ).name(), equalTo("Module 1") );
    }

    public static final class AnyObject
    {
    }
View Full Code Here

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

            {
                module.services( TestServiceComposite1.class );
            }
        };

        ServiceReference<TestServiceComposite1> serviceRef = assembler.module().findService( TestServiceComposite1.class );

        assertThat( "service is available", serviceRef.isAvailable(), equalTo( true ) );
    }

    @Test
View Full Code Here

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

                new EntityTestAssembler().assemble( module );
            }
        };

        ServiceReference<TestServiceComposite2> serviceRef = assembler.module().findService( TestServiceComposite2.class );

        assertThat( "service is unavailable", serviceRef.isAvailable(), equalTo( false ) );

        serviceRef.get().configuration().enabled().set( true );
        serviceRef.get().save();
View Full Code Here

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

                new EntityTestAssembler().assemble( module );
            }
        };

        TestObject object = assembler.module().newObject( TestObject.class );

        assertThat( "service is unavailable", object.getService(), CoreMatchers.<Object>nullValue() );

        ServiceReference<TestServiceComposite2> serviceRef = assembler.module().findService( TestServiceComposite2.class );
        serviceRef.get().configuration().enabled().set( true );
View Full Code Here

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

        TestObject object = assembler.module().newObject( TestObject.class );

        assertThat( "service is unavailable", object.getService(), CoreMatchers.<Object>nullValue() );

        ServiceReference<TestServiceComposite2> serviceRef = assembler.module().findService( TestServiceComposite2.class );
        serviceRef.get().configuration().enabled().set( true );
        serviceRef.get().save();

        object = assembler.module().newObject( TestObject.class );
        assertThat( "service is available", object.getService(), CoreMatchers.<Object>notNullValue() );
View Full Code Here

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

        ServiceReference<TestServiceComposite2> serviceRef = assembler.module().findService( TestServiceComposite2.class );
        serviceRef.get().configuration().enabled().set( true );
        serviceRef.get().save();

        object = assembler.module().newObject( TestObject.class );
        assertThat( "service is available", object.getService(), CoreMatchers.<Object>notNullValue() );
    }

    // This service has to be asked for availability
    @Mixins(TestMixin1.class)
View Full Code Here

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

            }
        };

        assertTrue( isActive );

        assembly.module().injectTo( this );

        assertTrue( isActive );

        service.get();
View Full Code Here

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

                module.forMixin( TestEntity.class ).declareDefaults().foo().set( "Bar" );
                module.forMixin( TestValue.class ).declareDefaults().bar().set( "Xyz" );
            }
        };

        UnitOfWork uow = assembler.module().newUnitOfWork();

        try
        {
            EntityBuilder<TestEntity> entityBuilder = uow.newEntityBuilder( TestEntity.class, "123" );
            entityBuilder.instance().value().set( assembler.module().newValue( TestValue.class ) );
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.