helper.assertCompile();
//
File ser = helper.getSourceOutput().getPath("juzu", "metamodel.ser");
MetaModelState unserialize = Tools.unserialize(MetaModelState.class, ser);
ModuleMetaModel mm = (ModuleMetaModel)unserialize.metaModel;
List<MetaModelEvent> events = mm.getQueue().clear();
assertEquals(1, events.size());
assertEquals(MetaModelEvent.AFTER_ADD, events.get(0).getType());
assertTrue(events.get(0).getObject() instanceof ApplicationMetaModel);
Tools.serialize(unserialize, ser);
//
a.getMembers().add(decl);
file.assertSave();
helper.assertCompile();
//
mm = (ModuleMetaModel)Tools.unserialize(MetaModelState.class, ser).metaModel;
//
JSON expected = json()
.set("applications", json().
list("values", json().
list("controllers", json().
set("handle", "ElementHandle.Class[fqn=metamodel.controller.A]").
list("methods", json().
set("handle", "ElementHandle.Method[fqn=metamodel.controller.A,name=index,parameterTypes[]]").
set("id", null).
set("name", "index").
list("parameters").
set("phase", "VIEW")
)
).
set("handle", "ElementHandle.Package[qn=metamodel.controller]").
list("templates")
)
);
assertEquals(expected, mm.toJSON());
//
events = mm.getQueue().clear();
assertEquals(3, events.size());
assertEquals(MetaModelEvent.AFTER_ADD, events.get(0).getType());
assertInstanceOf(ControllerMetaModel.class, events.get(0).getObject());
assertEquals(MetaModelEvent.AFTER_ADD, events.get(1).getType());
assertInstanceOf(HandlerMetaModel.class, events.get(1).getObject());