/** Tests {@link IBatisCacheController#getObject(CacheModel, Object)}. */ public void testRemoveObject() { assertEquals(0, controller.size()); controller.putObject(cacheModel, KEY, OBJECT); assertEquals(1, controller.size()); final Object actual = controller.removeObject(cacheModel, KEY); assertEquals(0, controller.size()); assertEquals(OBJECT, actual); }
/** * Sets up the fixture, for example, open a network connection. This method is called before a * test is executed. */ protected void setUp() throws Exception { super.setUp(); cacheModel = new CacheModel(); ibatisCacheFactory = new TestIbatisCacheFactory(); controller = new IBatisCacheController(ibatisCacheFactory); controller.configure(makeConfigurationProperties()); controller.flush(cacheModel); assertEquals(0, controller.size()); }
/** Tests {@link IBatisCacheController#getObject(CacheModel, Object)}. */ public void testPutObject() { final int initialSize = controller.size(); controller.putObject(cacheModel, KEY, OBJECT); assertEquals(initialSize + 1, controller.size()); }
/** Tests {@link IBatisCacheController#getObject(CacheModel, Object)}. */ public void testGetObject() { controller.putObject(cacheModel, KEY, OBJECT); assertEquals(OBJECT, controller.getObject(cacheModel, KEY)); }
/** Tests {@link IBatisCacheController#flush(CacheModel)}. */ public void testFlush() { controller.putObject(cacheModel, KEY, OBJECT); controller.flush(cacheModel); assertEquals(0, controller.size()); }
public void testToString() { assertNotNull(controller.toString()); }