From beb3bfca4da6f6dcaef0c74b49b16358560703b4 Mon Sep 17 00:00:00 2001 From: Roy Wetherall Date: Wed, 15 Feb 2006 22:00:13 +0000 Subject: [PATCH] - Fixes to unit tests git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2397 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../repo/action/executer/AddFeaturesActionExecuterTest.java | 4 ++++ .../repo/action/executer/ContentMetadataExtracterTest.java | 4 ++++ .../action/executer/SetPropertyValueActionExecuterTest.java | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/source/java/org/alfresco/repo/action/executer/AddFeaturesActionExecuterTest.java b/source/java/org/alfresco/repo/action/executer/AddFeaturesActionExecuterTest.java index 5c2b01ef59..7e508183cd 100644 --- a/source/java/org/alfresco/repo/action/executer/AddFeaturesActionExecuterTest.java +++ b/source/java/org/alfresco/repo/action/executer/AddFeaturesActionExecuterTest.java @@ -18,6 +18,7 @@ package org.alfresco.repo.action.executer; import org.alfresco.model.ContentModel; import org.alfresco.repo.action.ActionImpl; +import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.StoreRef; @@ -70,6 +71,9 @@ public class AddFeaturesActionExecuterTest extends BaseSpringTest { this.nodeService = (NodeService)this.applicationContext.getBean("nodeService"); + AuthenticationComponent authenticationComponent = (AuthenticationComponent)applicationContext.getBean("authenticationComponent"); + authenticationComponent.setCurrentUser(authenticationComponent.getSystemUserName()); + // Create the store and get the root node this.testStoreRef = this.nodeService.createStore( StoreRef.PROTOCOL_WORKSPACE, "Test_" diff --git a/source/java/org/alfresco/repo/action/executer/ContentMetadataExtracterTest.java b/source/java/org/alfresco/repo/action/executer/ContentMetadataExtracterTest.java index f56c9cb27b..cd5eff2364 100644 --- a/source/java/org/alfresco/repo/action/executer/ContentMetadataExtracterTest.java +++ b/source/java/org/alfresco/repo/action/executer/ContentMetadataExtracterTest.java @@ -24,6 +24,7 @@ import org.alfresco.repo.action.ActionImpl; import org.alfresco.repo.content.MimetypeMap; import org.alfresco.repo.content.metadata.MetadataExtracterRegistry; import org.alfresco.repo.content.transform.AbstractContentTransformerTest; +import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.service.cmr.repository.ContentService; import org.alfresco.service.cmr.repository.ContentWriter; import org.alfresco.service.cmr.repository.NodeRef; @@ -63,6 +64,9 @@ public class ContentMetadataExtracterTest extends BaseSpringTest this.contentService = (ContentService) this.applicationContext.getBean("contentService"); this.metadataExtracterRegistry = (MetadataExtracterRegistry) this.applicationContext .getBean("metadataExtracterRegistry"); + + AuthenticationComponent authenticationComponent = (AuthenticationComponent)applicationContext.getBean("authenticationComponent"); + authenticationComponent.setCurrentUser(authenticationComponent.getSystemUserName()); // Create the store and get the root node this.testStoreRef = this.nodeService.createStore( diff --git a/source/java/org/alfresco/repo/action/executer/SetPropertyValueActionExecuterTest.java b/source/java/org/alfresco/repo/action/executer/SetPropertyValueActionExecuterTest.java index 4335790827..a3aae3c245 100644 --- a/source/java/org/alfresco/repo/action/executer/SetPropertyValueActionExecuterTest.java +++ b/source/java/org/alfresco/repo/action/executer/SetPropertyValueActionExecuterTest.java @@ -18,6 +18,7 @@ package org.alfresco.repo.action.executer; import org.alfresco.model.ContentModel; import org.alfresco.repo.action.ActionImpl; +import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.StoreRef; @@ -47,6 +48,9 @@ public class SetPropertyValueActionExecuterTest extends BaseSpringTest { this.nodeService = (NodeService)this.applicationContext.getBean("nodeService"); + AuthenticationComponent authenticationComponent = (AuthenticationComponent)applicationContext.getBean("authenticationComponent"); + authenticationComponent.setCurrentUser(authenticationComponent.getSystemUserName()); + // Create the store and get the root node this.testStoreRef = this.nodeService.createStore( StoreRef.PROTOCOL_WORKSPACE, "Test_"