/** Write to a file */ public static void write(Location location, StoreParams params) { write(location.getPath(Names.TDB_CONFIG_FILE) ,params) ; }
if ( ! location.isMem() ) { String filename = location.getPath(Names.TDB_CONFIG_FILE) ; StoreParamsCodec.write(filename, pApp) ;
@Test public void params_choose_new_persist_3() { // new database, location defined, application modified. Location loc = Location.create(DIR) ; FileOps.clearAll(loc.getDirectoryPath()); StoreParamsCodec.write(loc, pLoc); // Clear. StoreParams p = StoreParamsFactory.decideStoreParams(loc, true, pApp, pLoc, pDft) ; // Check location still has a pLoc. String fn = loc.getPath(Names.TDB_CONFIG_FILE) ; assertTrue(FileOps.exists(fn)) ; StoreParams pLoc2 = StoreParamsCodec.read(loc) ; assertFalse(StoreParams.sameValues(pLoc, p)) ; assertEquals(0, p.getBlockSize().intValue()) ; // Location assertEquals(12, p.getNodeMissCacheSize().intValue()) ; // Application }
@Test public void params_choose_new_persist_3() { // new database, location defined, application modified. Location loc = Location.create(DIR) ; FileOps.clearAll(loc.getDirectoryPath()); StoreParamsCodec.write(loc, pLoc); // Clear. StoreParams p = StoreParamsFactory.decideStoreParams(loc, true, pApp, pLoc, pDft) ; // Check location still has a pLoc. String fn = loc.getPath(Names.TDB_CONFIG_FILE) ; assertTrue(FileOps.exists(fn)) ; StoreParams pLoc2 = StoreParamsCodec.read(loc) ; assertFalse(StoreParams.sameValues(pLoc, p)) ; assertEquals(0, p.getBlockSize().intValue()) ; // Location assertEquals(12, p.getNodeMissCacheSize().intValue()) ; // Application }
@Test public void params_choose_new_persist_2() { // new database, location defined. Location loc = Location.create(DIR) ; FileOps.clearAll(loc.getDirectoryPath()); StoreParamsCodec.write(loc, pLoc); // Clear. StoreParams p = StoreParamsFactory.decideStoreParams(loc, true, null, pLoc, pDft) ; // Check location still has a pLoc. String fn = loc.getPath(Names.TDB_CONFIG_FILE) ; assertTrue(FileOps.exists(fn)) ; StoreParams pLoc2 = StoreParamsCodec.read(loc) ; assertTrue(StoreParams.sameValues(pLoc, p)) ; }
@Test public void params_choose_new_persist_2() { // new database, location defined. Location loc = Location.create(DIR) ; FileOps.clearAll(loc.getDirectoryPath()); StoreParamsCodec.write(loc, pLoc); // Clear. StoreParams p = StoreParamsFactory.decideStoreParams(loc, true, null, pLoc, pDft) ; // Check location still has a pLoc. String fn = loc.getPath(Names.TDB_CONFIG_FILE) ; assertTrue(FileOps.exists(fn)) ; StoreParams pLoc2 = StoreParamsCodec.read(loc) ; assertTrue(StoreParams.sameValues(pLoc, p)) ; }