Examples of module()


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

            }
        };

        ArrayList<Data> datas = new ArrayList<Data>();

        Iterable<ServiceReference<DataAccess>> iterable = assembly.module().findServices( DataAccess.class );
        for( ServiceReference<DataAccess> service : iterable )
        {
            assertTrue( "Service should not be Active before accessed", !service.isActive() );
            Data data = service.get().data();
            if( SuccessDataService.class.isInstance( service.get() ) )
View Full Code Here

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

            {
                module.addServices( FailingDataService.class );
            }
        };

        ServiceReference<DataAccess> service = assembly.module().findService( DataAccess.class );
        assertTrue( "Service should not be Active before accessed", !service.isActive() );
        assertTrue( service.get().data().activated );
        assertTrue( "Service should be Active after access.", service.isActive() );

        try
View Full Code Here

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

                module.addServices( FailingDataService.class );
                module.addServices( FailingDataService.class );
            }
        };

        Iterable<ServiceReference<DataAccess>> iterable = assembly.module().findServices( DataAccess.class );
        for( ServiceReference<DataAccess> service : iterable )
        {
            assertTrue( "Service should not be Active before accessed", !service.isActive() );
            assertTrue( service.get().data().activated );
            assertTrue( "Service should be Active after access.", service.isActive() );
View Full Code Here

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

            public void assemble( ModuleAssembly module )
                throws AssemblyException
            {
            }
        };
        assembler.module().newTransientBuilder( AnyComposite.class );
    }

    /**
     * Tests that an transient builder cannot be created for a 'null' type.
     *
 
View Full Code Here

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

            public void assemble( ModuleAssembly module )
                throws AssemblyException
            {
            }
        };
        assembler.module().newTransientBuilder( null );
    }

    /**
     * Tests that a transient composite instance cannot be created for a 'null' type.
     *
 
View Full Code Here

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

            public void assemble( ModuleAssembly module )
                throws AssemblyException
            {
            }
        };
        assembler.module().newTransient( null );
    }

    /**
     * Tests that an object builder can be created for an registered object.
     */
 
View Full Code Here

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

                throws AssemblyException
            {
                module.transients( AnyComposite.class );
            }
        };
        assembler.module().newTransientBuilder( AnyComposite.class );
    }

    /**
     * Tests that an object can be created for an registered object class.
     */
 
View Full Code Here

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

                throws AssemblyException
            {
                module.transients( AnyComposite.class );
            }
        };
        assembler.module().newTransientBuilder( AnyComposite.class );
    }

    @Test(expected = ConstraintViolationException.class )
    public void testClassAsTransient()
    {
View Full Code Here

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

            {
                module.transients( AnyTransient.class );
            }
        };

        AnyTransient anyTransient = assembler.module().newTransient( AnyTransient.class );
        assertThat( anyTransient.hello( "me" ), new IsEqual<String>("Hello ME from Module 1") );

        assertThat( anyTransient.hello( "World" ), new IsEqual<String>( "Hello WORLD from ME"  ) );
        anyTransient.hello( "Universe" );
    }
View Full Code Here

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

                module.services( TestServiceComposite1.class,
                                 TestServiceComposite2.class );
            }
        };

        ObjectFactory obf = assembler.module();
        ServiceConsumer consumer = obf.newObject( ServiceConsumer.class, TestServiceComposite2.class.getSimpleName() );
        TestService service = consumer.getService();

        assertThat( "service is selected one", service.test(), equalTo( "mixin2" ) );
    }
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.