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

http://sigma-h.googlecode.com/ · Java · 33 lines · 19 code · 10 blank · 4 comment · 0 complexity · 2c3352e69569907be39e07352cff126a 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.GetSchema;
  11. import org.sigmah.shared.dto.SchemaDTO;
  12. public class SchemaCacheTest {
  13. @Test
  14. public void testSchemaCache() {
  15. ProxyManager proxyMgr = new ProxyManager();
  16. SchemaCache cache = new SchemaCache(proxyMgr);
  17. SchemaDTO schema = DummyData.PEAR();
  18. proxyMgr.notifyListenersOfSuccess(new GetSchema(), schema);
  19. ProxyResult<SchemaDTO> proxyResult = proxyMgr.execute(new GetSchema());
  20. Assert.assertTrue("could execute locally", proxyResult.couldExecute);
  21. Assert.assertEquals("PEAR", proxyResult.result.getDatabaseById(1).getName());
  22. }
  23. }