public void testChecksum()
throws Exception
{
String mdPath = "/md-merge/checksum/maven-metadata.xml";
StorageItem item = getRootRouter().retrieveItem(new ResourceStoreRequest("/groups/test" + mdPath, false));
assertTrue(StorageFileItem.class.isAssignableFrom(item.getClass()));
File mdFile = createTempFile("metadata", "tmp");
try {
saveItemToFile(((StorageFileItem) item), mdFile);
StorageItem md5Item =
getRootRouter().retrieveItem(new ResourceStoreRequest("/groups/test" + mdPath + ".md5", false));
StorageItem sha1Item =
getRootRouter().retrieveItem(new ResourceStoreRequest("/groups/test" + mdPath + ".sha1", false));
String md5Hash = contentAsString(md5Item);
String sha1Hash = contentAsString(sha1Item);
Md5Digester md5Digester = new Md5Digester();