Added a raw download servlet at URL http://.../alfresco/dr?contentUrl=...?ticket=...

Added ContentService.getRawReader to get content directly using a content URL.  To access this, you need to be admin.
Fixed EHCacheAdapter to handle non-Serializable values.
Added tests for above and for AbstractRoutingContentStore.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5841 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-06-04 14:44:29 +00:00
parent c2b6a11cd7
commit 6ff0696bf9
14 changed files with 371 additions and 22 deletions

View File

@@ -55,6 +55,7 @@ public class CacheTest extends TestCase
private SimpleCache<String, Serializable> standaloneCache;
private SimpleCache<String, Serializable> backingCache;
private SimpleCache<String, Serializable> transactionalCache;
private SimpleCache<String, Object> objectCache;
@SuppressWarnings("unchecked")
@Override
@@ -64,6 +65,7 @@ public class CacheTest extends TestCase
standaloneCache = (SimpleCache<String, Serializable>) ctx.getBean("ehCache1");
backingCache = (SimpleCache<String, Serializable>) ctx.getBean("backingCache");
transactionalCache = (SimpleCache<String, Serializable>) ctx.getBean("transactionalCache");
objectCache = (SimpleCache<String, Object>) ctx.getBean("objectCache");
}
@Override
@@ -86,6 +88,14 @@ public class CacheTest extends TestCase
assertNotNull(backingCache);
assertNotNull(standaloneCache);
assertNotNull(transactionalCache);
assertNotNull(objectCache);
}
public void testObjectCache() throws Exception
{
objectCache.put("A", this);
Object obj = objectCache.get("A");
assertTrue("Object not cached properly", this == obj);
}
public void testEhcacheAdaptors() throws Exception

View File

@@ -87,7 +87,7 @@ public class EhCacheAdapter<K extends Serializable, V extends Object>
Element element = cache.get(key);
if (element != null)
{
return (V) element.getValue();
return (V) element.getObjectValue();
}
else
{
@@ -97,7 +97,8 @@ public class EhCacheAdapter<K extends Serializable, V extends Object>
catch (CacheException e)
{
throw new AlfrescoRuntimeException("Failed to get from EhCache: \n" +
" key: " + key);
" key: " + key,
e);
}
}