/sigmah/src/test/java/org/sigmah/client/dispatch/remote/cache/AdminEntityCacheTest.java
Java | 33 lines | 19 code | 10 blank | 4 comment | 0 complexity | 71d213ce88a6cfe85e3fb20e74ce7432 MD5 | raw file
1/* 2 * All Sigmah code is released under the GNU General Public License v3 3 * See COPYRIGHT.txt and LICENSE.txt. 4 */ 5 6package org.sigmah.client.dispatch.remote.cache; 7 8import org.junit.Assert; 9import org.junit.Test; 10import org.sigmah.client.dispatch.remote.ProxyManager; 11import org.sigmah.client.mock.DummyData; 12import org.sigmah.shared.command.GetAdminEntities; 13import org.sigmah.shared.command.result.ListResult; 14import org.sigmah.shared.dto.AdminEntityDTO; 15 16public class AdminEntityCacheTest { 17 18 19 @Test 20 public void testRootLevelCache() { 21 22 ProxyManager proxyMgr = new ProxyManager(); 23 24 new AdminEntityCache(proxyMgr); 25 26 proxyMgr.notifyListenersOfSuccess(new GetAdminEntities(1), DummyData.getProvinces()); 27 28 ProxyResult<ListResult<AdminEntityDTO>> proxyResult = proxyMgr.execute(new GetAdminEntities(1)); 29 30 Assert.assertTrue(proxyResult.couldExecute); 31 Assert.assertEquals(2, proxyResult.result.getData().size()); 32 } 33}