/sigmah/src/test/java/org/sigmah/client/dispatch/remote/cache/AdminEntityCacheTest.java

http://sigma-h.googlecode.com/ · 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. package org.sigmah.client.dispatch.remote.cache;
  6. import org.junit.Assert;
  7. import org.junit.Test;
  8. import org.sigmah.client.dispatch.remote.ProxyManager;
  9. import org.sigmah.client.mock.DummyData;
  10. import org.sigmah.shared.command.GetAdminEntities;
  11. import org.sigmah.shared.command.result.ListResult;
  12. import org.sigmah.shared.dto.AdminEntityDTO;
  13. public class AdminEntityCacheTest {
  14. @Test
  15. public void testRootLevelCache() {
  16. ProxyManager proxyMgr = new ProxyManager();
  17. new AdminEntityCache(proxyMgr);
  18. proxyMgr.notifyListenersOfSuccess(new GetAdminEntities(1), DummyData.getProvinces());
  19. ProxyResult<ListResult<AdminEntityDTO>> proxyResult = proxyMgr.execute(new GetAdminEntities(1));
  20. Assert.assertTrue(proxyResult.couldExecute);
  21. Assert.assertEquals(2, proxyResult.result.getData().size());
  22. }
  23. }