use of com.google.gwt.dev.javac.typemodel.TypeOracleStub in project mvp4g by mvp4g.
the class ChildModuleElementTest method testParentEventBus.
@Test
public void testParentEventBus() {
ChildModuleElement childModuleElement = new ChildModuleElement();
assertNull(childModuleElement.getParentEventBus());
JClassType parentEventBus = new TypeOracleStub().addClass(EventBusOk.class);
childModuleElement.setParentEventBus(parentEventBus);
assertSame(parentEventBus, childModuleElement.getParentEventBus());
}
use of com.google.gwt.dev.javac.typemodel.TypeOracleStub in project mvp4g by mvp4g.
the class Mvp4gConfigurationFileReaderTest method testWriteSiblingEvent.
private void testWriteSiblingEvent(boolean passive) {
String passiveStr = Boolean.toString(passive);
configuration.setLoadChildConfig(new ChildModulesElement());
TypeOracleStub oracle = (TypeOracleStub) configuration.getOracle();
String moduleType = oracle.addClass(Modules.ModuleWithParent01.class).getQualifiedSourceName();
EventElement event1 = new EventElement();
event1.setType("event1");
event1.setPassive(passiveStr);
event1.setSiblingsToLoad(new String[] { moduleType });
EventElement event2 = new EventElement();
event2.setType("event2");
event2.setEventObjectClass(new String[] { "java.lang.String" });
event2.setSiblingsToLoad(new String[] { moduleType });
event2.setPassive(passiveStr);
EventElement event3 = new EventElement();
event3.setType("event3");
event3.setEventObjectClass(new String[] { "java.lang.String", "java.lang.Object" });
event3.setSiblingsToLoad(new String[] { moduleType });
event3.setPassive(passiveStr);
configuration.getEvents().add(event1);
configuration.getEvents().add(event2);
configuration.getEvents().add(event3);
configuration.getOthersEventBusClassMap().put(moduleType, oracle.addClass(EventBusOk.class));
assertOutput(getExpectedEventSiblingLoad(passive), false);
writer.writeConf();
assertOutput(getExpectedEventSiblingLoad(passive), true);
}
use of com.google.gwt.dev.javac.typemodel.TypeOracleStub in project mvp4g by mvp4g.
the class Mvp4gConfigurationFileReaderTest method testWriteMultipleImpl.
@Test
public void testWriteMultipleImpl() {
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");
configuration.getChildModules().add(childModule);
SplitterElement splitter = new SplitterElement();
splitter.setName("splitter");
splitter.setClassName("Splitter");
configuration.getSplitters().add(splitter);
configuration.setSuffix("suffix");
assertOutput(getExpectedMultipleImpl(), false);
writer.writeConf();
assertOutput(getExpectedMultipleImpl(), true);
}
use of com.google.gwt.dev.javac.typemodel.TypeOracleStub in project mvp4g by mvp4g.
the class Mvp4gConfigurationFileReaderTest method testWriteChildModuleMethods.
@Test
public void testWriteChildModuleMethods() {
TypeOracleStub oracle = (TypeOracleStub) configuration.getOracle();
configuration.setModule(oracle.addClass(Modules.Module01.class));
configuration.setParentEventBus(oracle.addClass(EventBusWithLookup.class));
configuration.setHistoryName("child");
assertOutput(getExpectedChildMethod(), false);
writer.writeConf();
assertOutput(getExpectedChildMethod(), true);
}
use of com.google.gwt.dev.javac.typemodel.TypeOracleStub in project mvp4g by mvp4g.
the class Mvp4gConfigurationFileReaderTest method testWriteChildModuleMethodsNoHistory.
@Test
public void testWriteChildModuleMethodsNoHistory() {
TypeOracleStub oracle = (TypeOracleStub) configuration.getOracle();
configuration.setModule(oracle.addClass(Modules.Module01.class));
configuration.setParentEventBus(oracle.addClass(EventBusWithLookup.class));
assertOutput(getExpectedChildMethodNoHistory(), false);
writer.writeConf();
assertOutput(getExpectedChildMethodNoHistory(), true);
}
Aggregations