mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -109,6 +109,7 @@ public abstract class AbstractReadOnlyContentStoreTest extends TestCase
|
||||
* @return
|
||||
* Return any valid URL for the store, or <tt>null</tt> if the store is empty.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
protected String getExistingContentUrl()
|
||||
{
|
||||
ContentStore store = getStore();
|
||||
|
@@ -50,6 +50,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
*
|
||||
* @author Derek Hulley
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public abstract class AbstractWritableContentStoreTest extends AbstractReadOnlyContentStoreTest
|
||||
{
|
||||
private static Log logger = LogFactory.getLog(AbstractWritableContentStoreTest.class);
|
||||
@@ -98,15 +99,6 @@ public abstract class AbstractWritableContentStoreTest extends AbstractReadOnlyC
|
||||
assertTrue("The store cannot be read-only", store.isWriteSupported());
|
||||
}
|
||||
|
||||
/**
|
||||
* Just check that the method doesn't blow up
|
||||
*/
|
||||
public void testSpaceUsed() throws Exception
|
||||
{
|
||||
ContentStore store = getStore();
|
||||
store.getSpaceUsed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Just checks that the method doesn't blow up
|
||||
*/
|
||||
|
@@ -212,6 +212,7 @@ public class RoutingContentStoreTest extends AbstractWritableContentStoreTest
|
||||
return fileStore.getReader(contentUrl);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void getUrls(Date createdAfter, Date createdBefore, ContentUrlHandler handler) throws ContentIOException
|
||||
{
|
||||
@@ -239,11 +240,5 @@ public class RoutingContentStoreTest extends AbstractWritableContentStoreTest
|
||||
{
|
||||
throw new UnsupportedContentUrlException(this, contentUrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getUrls(Date createdAfter, Date createdBefore, ContentUrlHandler handler) throws ContentIOException
|
||||
{
|
||||
throw new UnsupportedOperationException("getUrls not supported");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -42,7 +42,7 @@ import org.springframework.context.support.StaticApplicationContext;
|
||||
*
|
||||
* @author Derek Hulley
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@SuppressWarnings({"unused", "deprecation"})
|
||||
public class ContentStoreReplicatorTest extends TestCase
|
||||
{
|
||||
private static final String SOME_CONTENT = "The No. 1 Ladies' Detective Agency";
|
||||
|
Reference in New Issue
Block a user