mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Fixed two tests that now need to authenticate. Added 'statstore, storename'
command to avm.jsp doohickey. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3775 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -29,11 +29,13 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.avm.util.BulkLoader;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||
import org.alfresco.service.cmr.avm.AVMService;
|
||||
import org.alfresco.service.cmr.avm.AVMStoreDescriptor;
|
||||
import org.alfresco.service.cmr.avm.VersionDescriptor;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.context.support.FileSystemXmlApplicationContext;
|
||||
|
||||
@@ -50,11 +52,6 @@ public class AVMInterpreter
|
||||
*/
|
||||
private AVMService fService;
|
||||
|
||||
/**
|
||||
* The Node service.
|
||||
*/
|
||||
private NodeService fNodeService;
|
||||
|
||||
/**
|
||||
* The reader for interaction.
|
||||
*/
|
||||
@@ -104,11 +101,6 @@ public class AVMInterpreter
|
||||
fLoader = loader;
|
||||
}
|
||||
|
||||
public void setNodeService(NodeService service)
|
||||
{
|
||||
fNodeService = service;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Read-Eval-Print loop.
|
||||
*/
|
||||
@@ -429,6 +421,21 @@ public class AVMInterpreter
|
||||
AVMNodeDescriptor ca = fService.getCommonAncestor(left, right);
|
||||
out.println(ca);
|
||||
}
|
||||
else if (command[0].equals("statstore"))
|
||||
{
|
||||
if (command.length != 2)
|
||||
{
|
||||
return "Syntax Error.";
|
||||
}
|
||||
AVMStoreDescriptor desc = fService.getAVMStore(command[1]);
|
||||
out.println(desc);
|
||||
Map<QName, PropertyValue> props =
|
||||
fService.getStoreProperties(command[1]);
|
||||
for (QName name : props.keySet())
|
||||
{
|
||||
out.println(name + ": " + props.get(name));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Syntax Error.";
|
||||
|
@@ -33,6 +33,7 @@ import java.util.TreeMap;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.avm.util.BulkLoader;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationComponent;
|
||||
import org.alfresco.repo.transaction.TransactionUtil;
|
||||
import org.alfresco.service.cmr.avm.AVMException;
|
||||
import org.alfresco.service.cmr.avm.AVMExistsException;
|
||||
@@ -2276,6 +2277,8 @@ public class AVMServiceTest extends AVMServiceTestBase
|
||||
{
|
||||
setupBasicTree();
|
||||
PermissionService perm = (PermissionService)fContext.getBean("PermissionService");
|
||||
AuthenticationComponent ac = (AuthenticationComponent)fContext.getBean("authenticationComponent");
|
||||
ac.authenticate("admin", "admin".toCharArray());
|
||||
perm.setPermission(AVMNodeConverter.ToNodeRef(-1, "main:/a/b/c/foo"),
|
||||
PermissionService.ADMINISTRATOR_AUTHORITY,
|
||||
PermissionService.ALL_PERMISSIONS,
|
||||
@@ -2306,6 +2309,8 @@ public class AVMServiceTest extends AVMServiceTestBase
|
||||
{
|
||||
setupBasicTree();
|
||||
FileFolderService ffs = (FileFolderService)fContext.getBean("FileFolderService");
|
||||
AuthenticationComponent ac = (AuthenticationComponent)fContext.getBean("authenticationComponent");
|
||||
ac.authenticate("admin", "admin".toCharArray());
|
||||
assertTrue(ffs.create(AVMNodeConverter.ToNodeRef(-1, "main:/a/b/c"),
|
||||
"banana", ContentModel.TYPE_AVM_PLAIN_CONTENT) != null);
|
||||
assertTrue(ffs.create(AVMNodeConverter.ToNodeRef(-1, "main:/a/b/c"),
|
||||
|
Reference in New Issue
Block a user