Ejemplo n.º 1
0
 /*
  * @see junit.framework.TestCase#tearDown()
  */
 @After
 public void increCacheDataSetTearDown() throws Exception {
   dataEngine.shutdown();
   // clear persistent cache to void conflict with other test cases
   getDataSetCacheManager(dataEngine).clearCache(dataSource, dataSet);
   getDataSetCacheManager((DataEngineImpl) dataEngine).resetForTest();
 }
Ejemplo n.º 2
0
 @Test
 public void testUpdateIncreCache() {
   try {
     assertEquals(8, getQueryResultCount());
     getDataSetCacheManager((DataEngineImpl) dataEngine).resetForTest();
     // append new data to the original data set
     Random random = new Random();
     int count = random.nextInt(100) + 1;
     appendNewData(count);
     // populate the data set with the updated file
     prepareDataSet(getDataSourceInfo());
     assertEquals(count + 8, getQueryResultCount());
     assertTrue(getDataSetCacheManager(dataEngine).doesSaveToCache());
     assertTrue(getDataSetCacheManager(dataEngine).doesLoadFromCache());
   } catch (Exception e) {
     fail(e.getMessage());
   }
 }