use of com.google.gwt.dev.javac.typemodel.TypeOracleStub in project mvp4g by mvp4g.
the class Mvp4gConfigurationFileReaderTest method testWriteChildEvent.
@Test
public void testWriteChildEvent() {
configuration.setLoadChildConfig(new ChildModulesElement());
TypeOracleStub oracle = (TypeOracleStub) configuration.getOracle();
JClassType moduleType = oracle.addClass(Modules.ModuleWithParent01.class);
ChildModuleElement childModule = new ChildModuleElement();
childModule.setClassName(moduleType.getQualifiedSourceName());
childModule.setName("child");
childModule.setAutoDisplay("false");
childModule.setAsync("false");
configuration.getChildModules().add(childModule);
EventElement event1 = new EventElement();
event1.setType("event1");
event1.setForwardToModules(new String[] { "child" });
EventElement event2 = new EventElement();
event2.setType("event2");
event2.setEventObjectClass(new String[] { "java.lang.String" });
event2.setForwardToModules(new String[] { "child" });
EventElement event3 = new EventElement();
event3.setType("event3");
event3.setEventObjectClass(new String[] { "java.lang.String", "java.lang.Object" });
event3.setForwardToModules(new String[] { "child" });
configuration.getEvents().add(event1);
configuration.getEvents().add(event2);
configuration.getEvents().add(event3);
configuration.getOthersEventBusClassMap().put(Modules.ModuleWithParent01.class.getCanonicalName(), oracle.addClass(EventBusOk.class));
assertOutput(getExpectedEventChildModuleLoad(), false);
writer.writeConf();
assertOutput(getExpectedEventChildModuleLoad(), true);
}
use of com.google.gwt.dev.javac.typemodel.TypeOracleStub in project mvp4g by mvp4g.
the class Mvp4gConfigurationFileReaderTest method testWriteChildWithParentAsyncoAutoLoad.
@Test
public void testWriteChildWithParentAsyncoAutoLoad() {
TypeOracleStub oracle = (TypeOracleStub) configuration.getOracle();
JClassType moduleType = oracle.addClass(Modules.ModuleWithParent01.class);
ChildModuleElement childModule = new ChildModuleElement();
childModule.setClassName(moduleType.getQualifiedSourceName());
childModule.setName("childModule");
childModule.setEventToDisplayView("changeBody");
EventElement event = new EventElement();
event.setType("errorOnLoad");
event.setEventObjectClass(new String[] { Throwable.class.getCanonicalName() });
configuration.getEvents().add(event);
event = new EventElement();
event.setType("changeBody");
event.setEventObjectClass(new String[] { Widget.class.getCanonicalName() });
configuration.getEvents().add(event);
ChildModulesElement loadConfig = new ChildModulesElement();
loadConfig.setAfterEvent("afterLoad");
loadConfig.setBeforeEvent("beforeLoad");
loadConfig.setErrorEvent("errorOnLoad");
configuration.getChildModules().add(childModule);
configuration.setLoadChildConfig(loadConfig);
assertOutput(getExpectedChildModule(Modules.ModuleWithParent01.class.getCanonicalName()), false);
assertOutput(getExpectedAsyncChildModule(), false);
assertOutput(getExpectedAutoDisplayChildModule(), false);
writer.writeConf();
assertOutput(getExpectedChildModule(Modules.ModuleWithParent01.class.getCanonicalName()), true);
assertOutput(getExpectedAsyncChildModule(), true);
assertOutput(getExpectedAutoDisplayChildModule(), true);
}
use of com.google.gwt.dev.javac.typemodel.TypeOracleStub in project mvp4g by mvp4g.
the class Mvp4gConfigurationFileReaderTest method testWriteParentHistory.
@Test
public void testWriteParentHistory() {
TypeOracleStub oracle = (TypeOracleStub) configuration.getOracle();
JClassType moduleType = oracle.addClass(Modules.ModuleWithParent01.class);
ChildModuleElement childModule = new ChildModuleElement();
childModule.setClassName(moduleType.getQualifiedSourceName());
childModule.setName("child");
childModule.setHistoryName("child");
childModule.setAutoDisplay("false");
childModule.setAsync("false");
configuration.getChildModules().add(childModule);
EventElement event = new EventElement();
event.setType("test");
event.setForwardToModules(new String[] { "child" });
configuration.getEvents().add(event);
configuration.getOthersEventBusClassMap().put(Modules.ModuleWithParent01.class.getCanonicalName(), oracle.addClass(EventBusOk.class));
assertOutput(getExpectedHistoryParent(), false);
writer.writeConf();
assertOutput(getExpectedHistoryParent(), true);
}
use of com.google.gwt.dev.javac.typemodel.TypeOracleStub in project mvp4g by mvp4g.
the class Mvp4gConfigurationFileReaderTest method testWriteLoadChildModule.
@Test
public void testWriteLoadChildModule() {
TypeOracleStub oracle = (TypeOracleStub) configuration.getOracle();
Set<ChildModuleElement> children = configuration.getChildModules();
JClassType moduleType = oracle.addClass(Modules.ModuleWithParent01.class);
ChildModuleElement childModule = new ChildModuleElement();
childModule.setClassName(moduleType.getQualifiedSourceName());
childModule.setName("childModule1");
childModule.setAutoDisplay("false");
children.add(childModule);
moduleType = oracle.addClass(Modules.Module01.class);
childModule = new ChildModuleElement();
childModule.setClassName(moduleType.getQualifiedSourceName());
childModule.setName("childModule2");
childModule.setAutoDisplay("false");
children.add(childModule);
assertOutput(getExpectedLoadChildModule(), false);
writer.writeConf();
assertOutput(getExpectedLoadChildModule(), true);
}
use of com.google.gwt.dev.javac.typemodel.TypeOracleStub in project mvp4g by mvp4g.
the class Mvp4gConfigurationFileReaderTest method testWriteChildWithParentAsyncNoAutoLoad.
@Test
public void testWriteChildWithParentAsyncNoAutoLoad() {
TypeOracleStub oracle = (TypeOracleStub) configuration.getOracle();
JClassType moduleType = oracle.addClass(Modules.ModuleWithParent01.class);
ChildModuleElement childModule = new ChildModuleElement();
childModule.setClassName(moduleType.getQualifiedSourceName());
childModule.setName("childModule");
childModule.setAutoDisplay("false");
EventElement event = new EventElement();
event.setType("errorOnLoad");
event.setEventObjectClass(new String[] { Throwable.class.getCanonicalName() });
configuration.getEvents().add(event);
ChildModulesElement loadConfig = new ChildModulesElement();
loadConfig.setAfterEvent("afterLoad");
loadConfig.setBeforeEvent("beforeLoad");
loadConfig.setErrorEvent("errorOnLoad");
configuration.getChildModules().add(childModule);
configuration.setLoadChildConfig(loadConfig);
assertOutput(getExpectedChildModule(Modules.ModuleWithParent01.class.getCanonicalName()), false);
assertOutput(getExpectedAsyncChildModule(), false);
assertOutput(getExpectedAutoDisplayChildModule(), false);
writer.writeConf();
assertOutput(getExpectedChildModule(Modules.ModuleWithParent01.class.getCanonicalName()), true);
assertOutput(getExpectedAsyncChildModule(), true);
assertOutput(getExpectedAutoDisplayChildModule(), false);
}
Aggregations