List of usage examples for java.util.concurrent ConcurrentHashMap replace
public V replace(K key, V value)
From source file:org.apache.vxquery.indexing.MetaFileUtilTest.java
/** * Test the update metadata file process. *//*ww w .j a va 2 s .c om*/ @Test public void step5_testUpdateMetadata() throws IOException, ClassNotFoundException, NoSuchAlgorithmException, JAXBException { ConcurrentHashMap<String, XmlMetadata> fromFileMap = metaFileUtil.getMetadata(); XmlMetadata modified = fromFileMap.get(TestConstants.XML_FILE); File xml = new File(TestConstants.XML_FILE); modified.setMd5(metaFileUtil.generateMD5(xml)); fromFileMap.replace(TestConstants.XML_FILE, modified); metaFileUtil.updateMetadataMap(fromFileMap, TestConstants.INDEX_DIR); Assert.assertNotNull(metaFileUtil.getMetadata()); }