@Test
public void testCopy() throws Exception {

  StoragePath from = new StoragePath(ORG_ID, MP_ID, VERSION_2, MP_ELEM_ID);
  StoragePath to = new StoragePath(ORG_ID, MP_ID, VERSION_1, MP_ELEM_ID);
  assertTrue(repo.copy(from, to));
  File srcFile = new File(PathSupport.concat(new String[] { tmpRoot.toString(), ORG_ID, MP_ID, VERSION_2.toString(),
          MP_ELEM_ID + XML_EXTENSTION }));
  File copyFile = new File(PathSupport.concat(new String[] { tmpRoot.toString(), ORG_ID, MP_ID, VERSION_1.toString(),
          MP_ELEM_ID + XML_EXTENSTION }));
  assertTrue(srcFile.exists());
  assertTrue(copyFile.exists());
  FileInputStream srcIn = null;
  FileInputStream copyIn = null;
  try {
    srcIn = new FileInputStream(srcFile);
    copyIn = new FileInputStream(copyFile);
    byte[] bytesOriginal = IOUtils.toByteArray(srcIn);
    byte[] bytesCopy = IOUtils.toByteArray(copyIn);
    Assert.assertEquals(bytesCopy.length, bytesOriginal.length);
  } finally {
    IOUtils.closeQuietly(srcIn);
    IOUtils.closeQuietly(copyIn);
  }
}