@Test(groups = { "integration", "live" }) public void testPut() throws InterruptedException, IOException { String containerName = getContainerName(); try { Map<String, InputStream> map = createMap(view, containerName); InputStream old = map.put("one", fiveInputs.get("one")); getOneReturnsAppleAndOldValueIsNull(map, old); InputStream apple = map.put("one", fiveInputs.get("two")); getOneReturnsBearAndOldValueIsApple(map, apple); } finally { returnContainer(containerName); } }
@Test(groups = { "integration", "live" }) public void testPutBytes() throws InterruptedException, IOException { String containerName = getContainerName(); try { Map<String, InputStream> map = createMap(view, containerName); InputStream old = ((InputStreamMap) map).putBytes("one", fiveBytes.get("one")); getOneReturnsAppleAndOldValueIsNull(map, old); InputStream apple = ((InputStreamMap) map).putBytes("one", fiveBytes.get("two")); getOneReturnsBearAndOldValueIsApple(map, apple); } finally { returnContainer(containerName); } }
@Test(groups = { "integration", "live" }) public void testPutString() throws InterruptedException, IOException { String containerName = getContainerName(); try { Map<String, InputStream> map = createMap(view, containerName); InputStream old = ((InputStreamMap) map).putString("one", fiveStrings.get("one")); getOneReturnsAppleAndOldValueIsNull(map, old); InputStream apple = ((InputStreamMap) map).putString("one", fiveStrings.get("two")); getOneReturnsBearAndOldValueIsApple(map, apple); } finally { returnContainer(containerName); } }
@Test(groups = { "integration", "live" }) public void testPutFile() throws IOException, InterruptedException { String containerName = getContainerName(); try { Map<String, InputStream> map = createMap(view, containerName); InputStream old = ((InputStreamMap) map).putFile("one", fiveFiles.get("one")); getOneReturnsAppleAndOldValueIsNull(map, old); InputStream apple = ((InputStreamMap) map).putFile("one", fiveFiles.get("two")); getOneReturnsBearAndOldValueIsApple(map, apple); } finally { returnContainer(containerName); } }