Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)

77148: Merged PLATFORM1 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud)
      73957: ContentStore API cleanup
       - Removed previously-deprecated ContentStore.getWriter(ContentReader existingContentReader, String newContentUrl)
       - Removed previously-deprecated getSpaceUsed()
       - Removed previously-deprecated getTotalSize()
       - Deprecated optional and unused getUrls() and variants
       - Clean up of implementations to ignore relevant deprecations, etc


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@78004 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2014-07-23 15:57:20 +00:00
parent 7fff2b6627
commit f1310c6c8d
13 changed files with 49 additions and 230 deletions

View File

@@ -34,12 +34,10 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.io.IOException;
import java.util.Date;
import java.util.Locale;
import org.alfresco.repo.content.ContentContext;
import org.alfresco.repo.content.ContentStore;
import org.alfresco.repo.content.ContentStore.ContentUrlHandler;
import org.alfresco.repo.content.caching.quota.QuotaManagerStrategy;
import org.alfresco.repo.content.caching.quota.UnlimitedQuotaStrategy;
import org.alfresco.service.cmr.repository.ContentIOException;
@@ -398,22 +396,6 @@ public class CachingContentStoreTest
}
@Test
public void delegatedGetTotalSize()
{
when(backingStore.getTotalSize()).thenReturn(234L);
assertEquals(234L, cachingStore.getTotalSize());
}
@Test
public void delegatedGetSpaceUsed()
{
when(backingStore.getSpaceUsed()).thenReturn(453L);
assertEquals(453L, cachingStore.getSpaceUsed());
}
@Test
public void delegatedGetSpaceFree()
{
@@ -449,30 +431,6 @@ public class CachingContentStoreTest
}
@Test
public void delegatedGetUrls1()
{
ContentUrlHandler handler = createDummyUrlHandler();
cachingStore.getUrls(handler);
verify(backingStore).getUrls(handler);
}
@Test
public void delegatedGetUrls2()
{
ContentUrlHandler handler = createDummyUrlHandler();
Date after = new Date(123L);
Date before = new Date(456L);
cachingStore.getUrls(after, before, handler);
verify(backingStore).getUrls(after, before, handler);
}
@Test
public void delegatedDelete()
{
@@ -482,23 +440,4 @@ public class CachingContentStoreTest
when(backingStore.delete("url")).thenReturn(false);
assertFalse(cachingStore.delete("url"));
}
/**
* Create a stub handler - just so we can check it has been passed around correctly.
*
* @return ContentUrlHandler
*/
private ContentUrlHandler createDummyUrlHandler()
{
ContentUrlHandler handler = new ContentUrlHandler()
{
@Override
public void handle(String contentUrl)
{
}
};
return handler;
}
}