Merged V3.2 to HEAD:

16713: ETHREEOH-2379 deployment missing crypto libraries.
    16722: ETHREEOH-2798 - java.lang.NullPointerException while deleting a folder node with emptyTranslation
    16752: ETHREEOH-2946 - Release a test server from inside an Approve/Reject task
    16796: ETHREEOH-1841 - MBean error when running in a WebSphere cluster
    16920: ETHREEOH-2796 - Word 97 To Text transformation fails
    16955: Merge V3.1 to V3.2
        14275: Invitation change for ETHREEOH-1456, Missed change from check in 14222.
        14222: ETHREEOH-1456 - accepting a rejected invitation.
    16963: ETHREEOH-3029 - Strange defaltOnLoadListsner in hibernate-context.xml

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@16966 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2009-10-15 14:03:12 +00:00
parent 94fb4a09ae
commit 65f4462094
2 changed files with 24 additions and 1 deletions

View File

@@ -134,6 +134,9 @@ public class InviteResponse extends DeclarativeWebScript
String inviteId = req.getServiceMatch().getTemplateVars().get("inviteId"); String inviteId = req.getServiceMatch().getTemplateVars().get("inviteId");
String inviteTicket = req.getServiceMatch().getTemplateVars().get("inviteTicket"); String inviteTicket = req.getServiceMatch().getTemplateVars().get("inviteTicket");
// Check that the task is still open.
//if(inviteStart)
// process response // process response
String action = req.getServiceMatch().getTemplateVars().get("action"); String action = req.getServiceMatch().getTemplateVars().get("action");
if (action.equals("accept")) if (action.equals("accept"))
@@ -149,6 +152,10 @@ public class InviteResponse extends DeclarativeWebScript
{ {
throw new WebScriptException(Status.STATUS_FORBIDDEN, fe.toString()); throw new WebScriptException(Status.STATUS_FORBIDDEN, fe.toString());
} }
catch (InvitationExceptionUserError fe)
{
throw new WebScriptException(Status.STATUS_CONFLICT, fe.toString());
}
} }
else if (action.equals("reject")) else if (action.equals("reject"))
{ {
@@ -162,7 +169,11 @@ public class InviteResponse extends DeclarativeWebScript
catch (InvitationExceptionForbidden fe) catch (InvitationExceptionForbidden fe)
{ {
throw new WebScriptException(Status.STATUS_FORBIDDEN, fe.toString()); throw new WebScriptException(Status.STATUS_FORBIDDEN, fe.toString());
} }
catch (InvitationExceptionUserError fe)
{
throw new WebScriptException(Status.STATUS_CONFLICT, fe.toString());
}
} }
else else
{ {

View File

@@ -582,6 +582,13 @@ public class InviteServiceTest extends BaseWebScriptTest
// Invitee accepts invitation to a Site from Inviter // Invitee accepts invitation to a Site from Inviter
String acceptInviteUrl = URL_INVITE + "/" + inviteId + "/" + inviteTicket + "/accept"; String acceptInviteUrl = URL_INVITE + "/" + inviteId + "/" + inviteTicket + "/accept";
sendRequest(new PutRequest(acceptInviteUrl, (byte[])null, null), Status.STATUS_OK); sendRequest(new PutRequest(acceptInviteUrl, (byte[])null, null), Status.STATUS_OK);
// Invitee attempts to accept the invitation again
sendRequest(new PutRequest(acceptInviteUrl, (byte[])null, null), Status.STATUS_CONFLICT);
// Invitee attempts to reject an invitation that has already been accepted.
rejectInvite(inviteId, inviteTicket, Status.STATUS_CONFLICT);
// //
// test that invitation represented by invite ID (of invitation started // test that invitation represented by invite ID (of invitation started
@@ -610,6 +617,9 @@ public class InviteServiceTest extends BaseWebScriptTest
String inviteTicket = result.getString("inviteTicket"); String inviteTicket = result.getString("inviteTicket");
rejectInvite(inviteId, inviteTicket, Status.STATUS_OK); rejectInvite(inviteId, inviteTicket, Status.STATUS_OK);
// Negative test
rejectInvite(inviteId, inviteTicket, Status.STATUS_CONFLICT);
// //
// test that invite represented by invite ID (of invitation started // test that invite represented by invite ID (of invitation started
@@ -624,6 +634,8 @@ public class InviteServiceTest extends BaseWebScriptTest
// there should no longer be any invites identified by invite ID pending // there should no longer be any invites identified by invite ID pending
// assertEquals(0, getInvitesResult.getJSONArray("invites").length()); // assertEquals(0, getInvitesResult.getJSONArray("invites").length());
} }
public void testGetInvitesByInviteId() throws Exception public void testGetInvitesByInviteId() throws Exception