/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
- /*
- * All Sigmah code is released under the GNU General Public License v3
- * See COPYRIGHT.txt and LICENSE.txt.
- */
-
- package org.sigmah.client.dispatch.remote.cache;
-
- import org.junit.Assert;
- import org.junit.Test;
- import org.sigmah.client.dispatch.remote.ProxyManager;
- import org.sigmah.client.mock.DummyData;
- import org.sigmah.shared.command.GetAdminEntities;
- import org.sigmah.shared.command.result.ListResult;
- import org.sigmah.shared.dto.AdminEntityDTO;
-
- public class AdminEntityCacheTest {
-
-
- @Test
- public void testRootLevelCache() {
-
- ProxyManager proxyMgr = new ProxyManager();
-
- new AdminEntityCache(proxyMgr);
-
- proxyMgr.notifyListenersOfSuccess(new GetAdminEntities(1), DummyData.getProvinces());
-
- ProxyResult<ListResult<AdminEntityDTO>> proxyResult = proxyMgr.execute(new GetAdminEntities(1));
-
- Assert.assertTrue(proxyResult.couldExecute);
- Assert.assertEquals(2, proxyResult.result.getData().size());
- }
- }