use of org.activityinfo.ui.client.MockEventBus in project activityinfo by bedatadriven.
the class SchemaCacheTest method testSchemaCache.
@Test
public void testSchemaCache() {
CacheManager proxyMgr = new CacheManager(new MockEventBus());
new SchemaCache(proxyMgr);
SchemaDTO schema = DTOs.pear();
proxyMgr.notifyListenersOfSuccess(new GetSchema(), schema);
CacheResult<SchemaDTO> proxyResult = proxyMgr.execute(new GetSchema());
Assert.assertTrue("could execute locally", proxyResult.isCouldExecute());
Assert.assertEquals("PEAR", proxyResult.getResult().getDatabaseById(1).getName());
}
use of org.activityinfo.ui.client.MockEventBus in project activityinfo by bedatadriven.
the class OutOfSyncMonitorTest method setUp.
@Before
public void setUp() {
eventBus = new MockEventBus();
notifier = createNiceMock(OutOfSyncMonitor.View.class);
replay(notifier);
}
use of org.activityinfo.ui.client.MockEventBus in project activityinfo by bedatadriven.
the class AdminEntityCacheTest method testRootLevelCache.
@Test
public void testRootLevelCache() {
CacheManager proxyMgr = new CacheManager(new MockEventBus());
new AdminEntityCache(proxyMgr);
proxyMgr.notifyListenersOfSuccess(new GetAdminEntities(1), DTOs.getProvinces());
CacheResult<ListResult<AdminEntityDTO>> proxyResult = proxyMgr.execute(new GetAdminEntities(1));
Assert.assertTrue(proxyResult.isCouldExecute());
Assert.assertEquals(2, proxyResult.getResult().getData().size());
}
Aggregations