Fix CheckoutCheckIn tests - failed due to un-authenticated creation of test data. This used to work as rule triggers are no longer executed as the system user.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2357 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2006-02-13 13:51:04 +00:00
parent 056a3dc9d8
commit 4972870392

View File

@@ -22,6 +22,7 @@ import java.util.Map;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.security.authentication.AuthenticationComponent;
import org.alfresco.repo.transaction.TransactionUtil;
import org.alfresco.repo.version.VersionModel;
import org.alfresco.service.cmr.coci.CheckOutCheckInService;
@@ -107,7 +108,10 @@ public class CheckOutCheckInServiceImplTest extends BaseSpringTest
this.lockService = (LockService)this.applicationContext.getBean("lockService");
this.transactionService = (TransactionService)this.applicationContext.getBean("transactionComponent");
this.permissionService = (PermissionService)this.applicationContext.getBean("permissionService");
authenticationService.clearCurrentSecurityContext();
// Authenticate as system to create initial test data set
AuthenticationComponent authenticationComponent = (AuthenticationComponent)this.applicationContext.getBean("authenticationComponent");
authenticationComponent.setSystemUserAsCurrentUser();
// Create the store and get the root node reference
this.storeRef = this.nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis());
@@ -142,7 +146,6 @@ public class CheckOutCheckInServiceImplTest extends BaseSpringTest
permissionService.setPermission(this.rootNodeRef, this.userName.toLowerCase(), PermissionService.ALL_PERMISSIONS, true);
permissionService.setPermission(this.nodeRef, this.userName.toLowerCase(), PermissionService.ALL_PERMISSIONS, true);
}
/**