mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Updated to use alfresco-data-model:6.1-SNAPSHOT that includes the removal of ContentStore.getUrls methods
- Fixed derived code to remove the implementations git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@131256 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -25,33 +25,30 @@
|
||||
*/
|
||||
package org.alfresco.repo.content;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.transaction.UserTransaction;
|
||||
|
||||
import org.alfresco.repo.content.ContentStore.ContentUrlHandler;
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.util.ApplicationContextHelper;
|
||||
import org.alfresco.util.BaseApplicationContextHelper;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TestName;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.channels.FileChannel;
|
||||
import java.nio.channels.ReadableByteChannel;
|
||||
|
||||
import javax.transaction.UserTransaction;
|
||||
|
||||
import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
import org.alfresco.util.ApplicationContextHelper;
|
||||
import org.alfresco.util.BaseApplicationContextHelper;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TestName;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
/**
|
||||
* Abstract base class that provides a set of tests for implementations
|
||||
@@ -132,49 +129,6 @@ public abstract class AbstractReadOnlyContentStoreTest
|
||||
return getStore().getReader(contentUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a valid URL from the store. The default implementation will attempt to get
|
||||
* all the available URLs from the store and pick the first one. Writable store tests
|
||||
* can create some content to be sure of its existence.
|
||||
*
|
||||
* @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();
|
||||
try
|
||||
{
|
||||
final Set<String> contentUrls = new HashSet<String>(5);
|
||||
ContentUrlHandler handler = new ContentUrlHandler()
|
||||
{
|
||||
public void handle(String contentUrl)
|
||||
{
|
||||
if (contentUrls.size() < 50)
|
||||
{
|
||||
contentUrls.add(contentUrl);
|
||||
}
|
||||
}
|
||||
};
|
||||
store.getUrls(handler);
|
||||
if (contentUrls.size() > 0)
|
||||
{
|
||||
return (String) contentUrls.toArray()[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
// We can't do anything with this
|
||||
return null;
|
||||
}
|
||||
}
|
||||
catch (UnsupportedOperationException e)
|
||||
{
|
||||
// The store doesn't support this
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetUp() throws Exception
|
||||
{
|
||||
@@ -209,7 +163,12 @@ public abstract class AbstractReadOnlyContentStoreTest
|
||||
{
|
||||
// Expected
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests to implement this method in order to provide some content to play with
|
||||
*/
|
||||
protected abstract String getExistingContentUrl();
|
||||
|
||||
/**
|
||||
* Checks that the error handling for <i>inappropriate</i> content URLs
|
||||
|
Reference in New Issue
Block a user