/** 初期化します。 */ public void initialize() { DisposableUtil.add( new Disposable() { public void dispose() { destroy(); } }); this.initialized = true; }
public void testDispose() throws Exception { final Standard standard = new Standard(); setDbms(standard); assertEquals(0, standard.autoSelectFromClauseCache.size()); final BeanMetaData bmd = createBeanMetaData(Employee.class); { final String sql = standard.getAutoSelectSql(bmd); assertNotNull(sql); } assertEquals(1, standard.autoSelectFromClauseCache.size()); DisposableUtil.dispose(); assertEquals(0, standard.autoSelectFromClauseCache.size()); { final String sql = standard.getAutoSelectSql(bmd); assertNotNull(sql); } assertEquals(1, standard.autoSelectFromClauseCache.size()); DisposableUtil.dispose(); assertEquals(0, standard.autoSelectFromClauseCache.size()); }