Merge from V3.4 to HEAD

r: 23818 Merge from V3.3-BUG-FIX to V3.4
    r: 23817 Further fix to InviteServiceTest failing tests.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@23819 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Neil McErlean
2010-11-19 18:36:31 +00:00
parent 6b9b686cf5
commit acac6ddc44
2 changed files with 10 additions and 11 deletions

View File

@@ -23,7 +23,6 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.repo.action.executer.MailActionExecuter;
import org.alfresco.repo.content.MimetypeMap; import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.invitation.WorkflowModelNominatedInvitation; import org.alfresco.repo.invitation.WorkflowModelNominatedInvitation;
import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationComponent;
@@ -51,14 +50,14 @@ import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.transaction.TransactionService; import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.GUID; import org.alfresco.util.GUID;
import org.alfresco.util.PropertyMap; import org.alfresco.util.PropertyMap;
import org.apache.commons.lang.RandomStringUtils;
import org.json.JSONObject;
import org.springframework.core.io.ClassPathResource;
import org.springframework.extensions.surf.util.URLEncoder; import org.springframework.extensions.surf.util.URLEncoder;
import org.springframework.extensions.webscripts.Status; import org.springframework.extensions.webscripts.Status;
import org.springframework.extensions.webscripts.TestWebScriptServer.GetRequest; import org.springframework.extensions.webscripts.TestWebScriptServer.GetRequest;
import org.springframework.extensions.webscripts.TestWebScriptServer.PutRequest; import org.springframework.extensions.webscripts.TestWebScriptServer.PutRequest;
import org.springframework.extensions.webscripts.TestWebScriptServer.Response; import org.springframework.extensions.webscripts.TestWebScriptServer.Response;
import org.apache.commons.lang.RandomStringUtils;
import org.json.JSONObject;
import org.springframework.core.io.ClassPathResource;
/** /**
* Unit Test to test Invite Web Script API * Unit Test to test Invite Web Script API
@@ -132,10 +131,11 @@ public class InviteServiceTest extends BaseWebScriptTest
this.transactionService = (TransactionService) getServer().getApplicationContext() this.transactionService = (TransactionService) getServer().getApplicationContext()
.getBean("TransactionService"); .getBean("TransactionService");
// TODO MER 20/11/2009 Bodge - turn off email sending to prevent errors during unit testing // We're using a MailActionExecuter defined in outboundSMTP-test-context.xml which
// (or sending out email by accident from tests) // sets the testMode property to true via spring injection. This will prevent emails
MailActionExecuter mail = (MailActionExecuter) getServer().getApplicationContext().getBean("mail"); // from being sent from within this test case.
mail.setTestMode(true); // This MailExecutorAction bean is named "test-mail" but is in all other respects equivalent to the
// 'real' executer bean. It is automatically included during OutboundSMTP subsystem startup.
// redeploy invite process definition in case it has been modified // redeploy invite process definition in case it has been modified
WorkflowDefinition inviteWfDefinition = this.workflowService.getDefinitionByName( WorkflowDefinition inviteWfDefinition = this.workflowService.getDefinitionByName(

View File

@@ -27,7 +27,6 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.repo.action.executer.MailActionExecuter;
import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationComponent;
import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.site.SiteModel; import org.alfresco.repo.site.SiteModel;
@@ -44,14 +43,14 @@ import org.alfresco.service.cmr.site.SiteVisibility;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.alfresco.util.GUID; import org.alfresco.util.GUID;
import org.alfresco.util.PropertyMap; import org.alfresco.util.PropertyMap;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.extensions.webscripts.Status; import org.springframework.extensions.webscripts.Status;
import org.springframework.extensions.webscripts.TestWebScriptServer.DeleteRequest; import org.springframework.extensions.webscripts.TestWebScriptServer.DeleteRequest;
import org.springframework.extensions.webscripts.TestWebScriptServer.GetRequest; import org.springframework.extensions.webscripts.TestWebScriptServer.GetRequest;
import org.springframework.extensions.webscripts.TestWebScriptServer.PostRequest; import org.springframework.extensions.webscripts.TestWebScriptServer.PostRequest;
import org.springframework.extensions.webscripts.TestWebScriptServer.PutRequest; import org.springframework.extensions.webscripts.TestWebScriptServer.PutRequest;
import org.springframework.extensions.webscripts.TestWebScriptServer.Response; import org.springframework.extensions.webscripts.TestWebScriptServer.Response;
import org.json.JSONArray;
import org.json.JSONObject;
/** /**
* Unit test to test site Web Script API of the Site Object. * Unit test to test site Web Script API of the Site Object.