@Test( expected = AmbiguousTypeException.class )
public void testMultipleMixinsInLayerWillFailDiffModule()
throws Exception
{
Energy4Java boot = new Energy4Java();
Assembler[][][] assemblers = new Assembler[][][]
{
{ // Layer
{ // Module 1
new Assembler()
{
public void assemble( ModuleAssembly module )
throws AssemblyException
{
module.setName( "Module A" );
module.objects( ObjectA.class );
}
}
},
{ // Module 2
new Assembler()
{
public void assemble( ModuleAssembly module )
throws AssemblyException
{
module.setName( "Module B" );
module.transients( B1Composite.class ).visibleIn( Visibility.layer );
}
}
},
{ // Module 3
new Assembler()
{
public void assemble( ModuleAssembly module )
throws AssemblyException
{
module.setName( "Module C" );
module.transients( B2Composite.class ).visibleIn( Visibility.layer );
}
}
}
}
};
Application app = boot.newApplication( new ApplicationAssemblerAdapter( assemblers )
{
} );
app.activate();
ObjectA object = app.findModule( "Layer 1", "Module A" ).newObject( ObjectA.class );
assertEquals( "ok", object.test1() );