From 3f7d9ddd268cee75fbde46c8057e1e0ffd5c14ee Mon Sep 17 00:00:00 2001 From: Emil Ivov Date: Sun, 9 Aug 2009 21:25:35 +0000 Subject: [PATCH] Renames CallParticipant to CallPeer so that it would better reflect our new Call architecture that also includes conferencing and ConferenceMembers --- lib/accounts.properties.template | 2 +- .../callhistory/CallHistoryServiceImpl.java | 6 +- .../impl/gui/main/call/CallDialog.java | 2 +- .../impl/gui/main/call/CallManager.java | 10 +- .../impl/gui/main/call/CallPanel.java | 10 +- .../impl/gui/main/call/HoldButton.java | 2 +- .../impl/gui/main/call/MuteButton.java | 2 +- .../gui/main/call/ReceivedCallDialog.java | 2 +- .../gui/main/call/TransferCallButton.java | 2 +- .../transform/zrtp/SecurityEventManager.java | 2 +- .../protocol/SingleCallInProgressPolicy.java | 2 +- .../impl/protocol/jabber/CallJabberImpl.java | 12 +- .../OperationSetBasicTelephonyJabberImpl.java | 10 +- .../impl/protocol/mock/MockCall.java | 10 +- .../mock/MockOperationSetBasicTelephony.java | 6 +- .../protocol/sip/ActiveCallsRepository.java | 2 +- .../impl/protocol/sip/CallSipImpl.java | 12 +- .../OperationSetBasicTelephonySipImpl.java | 16 +- .../OperationSetVideoTelephonySipImpl.java | 2 +- .../communicator/plugin/mailbox/Mailbox.java | 8 +- .../communicator/service/protocol/Call.java | 6 +- .../protocol/OperationSetBasicTelephony.java | 4 +- .../callhistory/TestCallHistoryService.java | 10 +- .../metahistory/TestMetaHistoryService.java | 4 +- ...tOperationSetBasicTelephonyJabberImpl.java | 426 +++++++++--------- ...TestOperationSetBasicTelephonySipImpl.java | 44 +- 26 files changed, 307 insertions(+), 307 deletions(-) diff --git a/lib/accounts.properties.template b/lib/accounts.properties.template index c0f5e34e5..f0277a3d2 100644 --- a/lib/accounts.properties.template +++ b/lib/accounts.properties.template @@ -50,7 +50,7 @@ accounts.icq.CONTACT_LIST= #Indicates whether the servers that the sip accounts belong to, preserve caller #and callee info such as addresses or display names. some servers override these #(e.g. for NAT supprt) and the tests should not assert it in such cases -accounts.sip.PRESERVE_PARTICIPANT_INFO=false +accounts.sip.PRESERVE_PEER_INFO=false # The user id needed to log onto the server specified in the SERVER_ADDRESS # property. diff --git a/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java b/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java index ea8aecb6a..c3c7b170e 100644 --- a/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java +++ b/src/net/java/sip/communicator/impl/callhistory/CallHistoryServiceImpl.java @@ -854,9 +854,9 @@ private void handleParticipantAdded(CallPeer callParticipant) if(callRecord == null) return; - callParticipant.addCallParticipantListener(new CallPeerAdapter() + callParticipant.addCallPeerListener(new CallPeerAdapter() { - public void participantStateChanged(CallPeerChangeEvent evt) + public void peerStateChanged(CallPeerChangeEvent evt) { if(evt.getNewValue().equals(CallPeerState.DISCONNECTED)) return; @@ -980,7 +980,7 @@ private void handleNewCall(Call sourceCall, String direction) currentCallRecords.add(newRecord); // if has already perticipants Dispatch them - Iterator iter = sourceCall.getCallParticipants(); + Iterator iter = sourceCall.getCallPeers(); while (iter.hasNext()) { handleParticipantAdded(iter.next()); diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java b/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java index caeda0643..f4abbadef 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java @@ -203,7 +203,7 @@ private DialpadDialog getDialpadDialog() Call call = callPanel.getCall(); Iterator callParticipants = (call == null) ? new Vector().iterator() - : callPanel.getCall().getCallParticipants(); + : callPanel.getCall().getCallPeers(); return new DialpadDialog(callParticipants); } diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java index 67e455b87..50d231a8e 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/CallManager.java @@ -59,7 +59,7 @@ public void incomingCallReceived(CallEvent event) NotificationManager.INCOMING_CALL, "", "Incoming call received from: " - + sourceCall.getCallParticipants().next()); + + sourceCall.getCallPeers().next()); } /** @@ -295,7 +295,7 @@ public AnswerCallThread(Call call) public void run() { ProtocolProviderService pps = call.getProtocolProvider(); - Iterator participants = call.getCallParticipants(); + Iterator participants = call.getCallPeers(); while (participants.hasNext()) { @@ -306,7 +306,7 @@ public void run() try { - telephony.answerCallParticipant(participant); + telephony.answerCallPeer(participant); } catch (OperationFailedException e) { @@ -333,7 +333,7 @@ public HangupCallThread(Call call) public void run() { ProtocolProviderService pps = call.getProtocolProvider(); - Iterator participants = call.getCallParticipants(); + Iterator participants = call.getCallPeers(); while (participants.hasNext()) { @@ -344,7 +344,7 @@ public void run() try { - telephony.hangupCallParticipant(participant); + telephony.hangupCallPeer(participant); } catch (OperationFailedException e) { diff --git a/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java index 8b19464aa..858158e75 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/CallPanel.java @@ -64,14 +64,14 @@ public CallPanel(CallDialog callDialog, Call call, String callType) this.mainPanel.setBorder(BorderFactory .createEmptyBorder(5, 5, 5, 5)); - int contactsCount = call.getCallParticipantsCount(); + int contactsCount = call.getCallPeerCount(); mainPanel.setLayout(new GridLayout(0, (contactsCount < 2) ? 1 : 2)); if (contactsCount > 0) { CallPeer participant = - call.getCallParticipants().next(); + call.getCallPeers().next(); this.title = participant.getDisplayName(); } @@ -189,7 +189,7 @@ public void callStateChanged(CallChangeEvent evt) * Implements the CallParicipantChangeListener.participantStateChanged * method. */ - public void participantStateChanged(CallPeerChangeEvent evt) + public void peerStateChanged(CallPeerChangeEvent evt) { CallPeer sourceParticipant = evt.getSourceCallParticipant(); @@ -343,13 +343,13 @@ private void setCall(Call call, String callType) this.mainPanel.removeAll(); this.participantsPanels.clear(); - Iterator participants = call.getCallParticipants(); + Iterator participants = call.getCallPeers(); while (participants.hasNext()) { CallPeer participant = participants.next(); - participant.addCallParticipantListener(this); + participant.addCallPeerListener(this); participant.addCallParticipantSecurityListener(this); participant.addPropertyChangeListener(this); diff --git a/src/net/java/sip/communicator/impl/gui/main/call/HoldButton.java b/src/net/java/sip/communicator/impl/gui/main/call/HoldButton.java index 5a061f8cd..7e20f02f8 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/HoldButton.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/HoldButton.java @@ -123,7 +123,7 @@ public void actionPerformed(ActionEvent evt) .getOperationSet(OperationSetBasicTelephony.class); Iterator participants - = call.getCallParticipants(); + = call.getCallPeers(); while (participants.hasNext()) { diff --git a/src/net/java/sip/communicator/impl/gui/main/call/MuteButton.java b/src/net/java/sip/communicator/impl/gui/main/call/MuteButton.java index 1c3c6260f..9b0c10442 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/MuteButton.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/MuteButton.java @@ -113,7 +113,7 @@ public void actionPerformed(ActionEvent evt) if (call != null) { Iterator participants - = call.getCallParticipants(); + = call.getCallPeers(); while (participants.hasNext()) { diff --git a/src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java b/src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java index 99ebadce3..b14c8cc9a 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/ReceivedCallDialog.java @@ -122,7 +122,7 @@ private void initComponents() private void initCallLabel(JLabel callLabel) { Iterator participantsIter - = incomingCall.getCallParticipants(); + = incomingCall.getCallPeers(); boolean hasMoreParticipants = false; String text = ""; diff --git a/src/net/java/sip/communicator/impl/gui/main/call/TransferCallButton.java b/src/net/java/sip/communicator/impl/gui/main/call/TransferCallButton.java index 867a51951..31deb7c22 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/TransferCallButton.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/TransferCallButton.java @@ -178,7 +178,7 @@ private CallPeer findCallParticipant( Call call = callIter.next(); for (Iterator participantIter = - call.getCallParticipants(); participantIter.hasNext();) + call.getCallPeers(); participantIter.hasNext();) { CallPeer participant = participantIter.next(); diff --git a/src/net/java/sip/communicator/impl/media/transform/zrtp/SecurityEventManager.java b/src/net/java/sip/communicator/impl/media/transform/zrtp/SecurityEventManager.java index 544c80d60..1786f8137 100644 --- a/src/net/java/sip/communicator/impl/media/transform/zrtp/SecurityEventManager.java +++ b/src/net/java/sip/communicator/impl/media/transform/zrtp/SecurityEventManager.java @@ -91,7 +91,7 @@ public SecurityEventManager(CallSession callSession) // participants. In the future the call participant would be passed // as a parameter to the SecurityEventManager. Iterator callParticipants - = callSession.getCall().getCallParticipants(); + = callSession.getCall().getCallPeers(); while (callParticipants.hasNext()) { diff --git a/src/net/java/sip/communicator/impl/protocol/SingleCallInProgressPolicy.java b/src/net/java/sip/communicator/impl/protocol/SingleCallInProgressPolicy.java index 4e5a3c386..3b9efc36a 100644 --- a/src/net/java/sip/communicator/impl/protocol/SingleCallInProgressPolicy.java +++ b/src/net/java/sip/communicator/impl/protocol/SingleCallInProgressPolicy.java @@ -315,7 +315,7 @@ private void putOnHold(Call call) if (telephony != null) { for (Iterator participantIter = - call.getCallParticipants(); participantIter.hasNext();) + call.getCallPeers(); participantIter.hasNext();) { CallPeer participant = participantIter.next(); CallPeerState participantState = participant.getState(); diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/CallJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/CallJabberImpl.java index 3798337fe..2a98f82c9 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/CallJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/CallJabberImpl.java @@ -65,7 +65,7 @@ public void addCallPeer(CallPeerJabberImpl callParticipant) if(callParticipants.contains(callParticipant)) return; - callParticipant.addCallParticipantListener(this); + callParticipant.addCallPeerListener(this); this.callParticipants.add(callParticipant); fireCallParticipantEvent( @@ -86,7 +86,7 @@ public void removeCallParticipant(CallPeerJabberImpl callParticipant) this.callParticipants.remove(callParticipant); callParticipant.setCall(null); - callParticipant.removeCallParticipantListener(this); + callParticipant.removeCallPeerListener(this); fireCallParticipantEvent( callParticipant, CallPeerEvent.CALL_PEER_REMVOVED); @@ -99,7 +99,7 @@ public void removeCallParticipant(CallPeerJabberImpl callParticipant) * Returns an iterator over all call participants. * @return an Iterator over all participants currently involved in the call. */ - public Iterator getCallParticipants() + public Iterator getCallPeers() { return new LinkedList(callParticipants).iterator(); } @@ -109,7 +109,7 @@ public Iterator getCallParticipants() * @return an int indicating the number of participants currently * associated with this call. */ - public int getCallParticipantsCount() + public int getCallPeerCount() { return callParticipants.size(); } @@ -158,7 +158,7 @@ public void participantDisplayNameChanged(CallPeerChangeEvent evt) * @param evt The CallParticipantChangeEvent instance containing * the source event as well as its previous and its new status. */ - public void participantStateChanged(CallPeerChangeEvent evt) + public void peerStateChanged(CallPeerChangeEvent evt) { if(((CallPeerState)evt.getNewValue()) == CallPeerState.DISCONNECTED @@ -201,7 +201,7 @@ public boolean contains(JingleSession session) */ public CallPeerJabberImpl findCallParticipant(JingleSession session) { - Iterator callParticipants = this.getCallParticipants(); + Iterator callParticipants = this.getCallPeers(); if(logger.isTraceEnabled()) { diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java index aac43167d..43c642447 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java @@ -320,7 +320,7 @@ public void putOnHold(CallPeer participant) * // TODO: ask for suppression of OperationFailedException from the interface. * // what happens if hangup fails ? are we forced to continue to talk ? :o) */ - public void hangupCallParticipant(CallPeer participant) + public void hangupCallPeer(CallPeer participant) throws ClassCastException, OperationFailedException { CallPeerJabberImpl callParticipant @@ -348,7 +348,7 @@ public void hangupCallParticipant(CallPeer participant) * @param participant the call participant that we want to answer * @throws OperationFailedException if we fails to answer */ - public void answerCallParticipant(CallPeer participant) + public void answerCallPeer(CallPeer participant) throws OperationFailedException { CallPeerJabberImpl callParticipant @@ -382,7 +382,7 @@ public void shutdown() { CallJabberImpl call = (CallJabberImpl) activeCalls.next(); - Iterator callParticipants = call.getCallParticipants(); + Iterator callParticipants = call.getCallPeers(); //go through all call participants and say bye to every one. while (callParticipants.hasNext()) @@ -391,7 +391,7 @@ public void shutdown() = (CallPeer) callParticipants.next(); try { - this.hangupCallParticipant(participant); + this.hangupCallPeer(participant); } catch (Exception ex) { @@ -588,7 +588,7 @@ else if (newState instanceof OutgoingJingleSession.Active) } try { - hangupCallParticipant(callParticipant); + hangupCallPeer(callParticipant); } catch (Exception ex) { diff --git a/src/net/java/sip/communicator/impl/protocol/mock/MockCall.java b/src/net/java/sip/communicator/impl/protocol/mock/MockCall.java index c85971ace..1326b8e47 100644 --- a/src/net/java/sip/communicator/impl/protocol/mock/MockCall.java +++ b/src/net/java/sip/communicator/impl/protocol/mock/MockCall.java @@ -38,7 +38,7 @@ public MockCall(MockProvider sourceProvider) * @return an Iterator over all participants currently involved in the * call. */ - public Iterator getCallParticipants() + public Iterator getCallPeers() { return callParticipants.iterator(); } @@ -49,7 +49,7 @@ public Iterator getCallParticipants() * @return an int indicating the number of participants * currently associated with this call. */ - public int getCallParticipantsCount() + public int getCallPeerCount() { return callParticipants.size(); } @@ -66,7 +66,7 @@ public void addCallParticipant(MockCallParticipant callParticipant) if(callParticipants.contains(callParticipant)) return; - callParticipant.addCallParticipantListener(this); + callParticipant.addCallPeerListener(this); this.callParticipants.add(callParticipant); @@ -89,7 +89,7 @@ public void removeCallParticipant(MockCallParticipant callParticipant) return; this.callParticipants.remove(callParticipant); - callParticipant.removeCallParticipantListener(this); + callParticipant.removeCallPeerListener(this); fireCallParticipantEvent( callParticipant, CallPeerEvent.CALL_PEER_REMVOVED); @@ -98,7 +98,7 @@ public void removeCallParticipant(MockCallParticipant callParticipant) setCallState(CallState.CALL_ENDED); } - public void participantStateChanged(CallPeerChangeEvent evt) + public void peerStateChanged(CallPeerChangeEvent evt) { if ( ( (CallPeerState) evt.getNewValue()) == CallPeerState.DISCONNECTED diff --git a/src/net/java/sip/communicator/impl/protocol/mock/MockOperationSetBasicTelephony.java b/src/net/java/sip/communicator/impl/protocol/mock/MockOperationSetBasicTelephony.java index 6dea6bce5..b25a1fbb7 100644 --- a/src/net/java/sip/communicator/impl/protocol/mock/MockOperationSetBasicTelephony.java +++ b/src/net/java/sip/communicator/impl/protocol/mock/MockOperationSetBasicTelephony.java @@ -44,7 +44,7 @@ public MockOperationSetBasicTelephony(MockProvider protocolProvider) * @throws OperationFailedException with the corresponding code if we * encounter an error while performing this operation. */ - public void answerCallParticipant(CallPeer participant) throws + public void answerCallPeer(CallPeer participant) throws OperationFailedException { MockCallParticipant callParticipant @@ -128,7 +128,7 @@ public Iterator getActiveCalls() * @throws OperationFailedException with the corresponding code if we * encounter an error while performing this operation. */ - public void hangupCallParticipant(CallPeer participant) throws + public void hangupCallPeer(CallPeer participant) throws OperationFailedException { //do nothing if the call is already ended @@ -191,7 +191,7 @@ public Call placeCall(String toAddress) // must have one participant MockCallParticipant callPArt = - (MockCallParticipant)newCall.getCallParticipants().next(); + (MockCallParticipant)newCall.getCallPeers().next(); callPArt.setState(CallPeerState.ALERTING_REMOTE_SIDE, "no reason"); callPArt.setState(CallPeerState.CONNECTED, "no reason"); diff --git a/src/net/java/sip/communicator/impl/protocol/sip/ActiveCallsRepository.java b/src/net/java/sip/communicator/impl/protocol/sip/ActiveCallsRepository.java index db02e649d..0e0feeada 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/ActiveCallsRepository.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/ActiveCallsRepository.java @@ -194,7 +194,7 @@ public List findCallParticipants(String callID, if (!callID.equals(call.getCallID())) continue; - for (Iterator callParticipantIter = call.getCallParticipants(); + for (Iterator callParticipantIter = call.getCallPeers(); callParticipantIter.hasNext();) { CallPeerSipImpl callParticipant = diff --git a/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java index 71678657b..43fb0c33b 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/CallSipImpl.java @@ -62,7 +62,7 @@ public void addCallPeer(CallPeerSipImpl callParticipant) if (callParticipants.contains(callParticipant)) return; - callParticipant.addCallParticipantListener(this); + callParticipant.addCallPeerListener(this); this.callParticipants.add(callParticipant); fireCallParticipantEvent(callParticipant, @@ -82,7 +82,7 @@ public void removeCallParticipant(CallPeerSipImpl callParticipant) return; this.callParticipants.remove(callParticipant); - callParticipant.removeCallParticipantListener(this); + callParticipant.removeCallPeerListener(this); try { @@ -108,7 +108,7 @@ public void removeCallParticipant(CallPeerSipImpl callParticipant) * * @return an Iterator over all participants currently involved in the call. */ - public Iterator getCallParticipants() + public Iterator getCallPeers() { return new LinkedList(callParticipants).iterator(); } @@ -119,7 +119,7 @@ public Iterator getCallParticipants() * @return an int indicating the number of participants currently * associated with this call. */ - public int getCallParticipantsCount() + public int getCallPeerCount() { return callParticipants.size(); } @@ -171,7 +171,7 @@ public void participantDisplayNameChanged(CallPeerChangeEvent evt) * @param evt The CallParticipantChangeEvent instance containing * the source event as well as its previous and its new status. */ - public void participantStateChanged(CallPeerChangeEvent evt) + public void peerStateChanged(CallPeerChangeEvent evt) { CallPeerState newState = (CallPeerState) evt.getNewValue(); @@ -213,7 +213,7 @@ public boolean contains(Dialog dialog) */ public CallPeerSipImpl findCallParticipant(Dialog dialog) { - Iterator callParticipants = this.getCallParticipants(); + Iterator callParticipants = this.getCallPeers(); if (logger.isTraceEnabled()) { diff --git a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java index f1af80cc3..bb1365ae2 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetBasicTelephonySipImpl.java @@ -991,7 +991,7 @@ private void processInviteOK(ClientTransaction clientTransaction, { CallSipImpl activeCall = activeCallsIter.next(); Iterator callParticipantsIter = - activeCall.getCallParticipants(); + activeCall.getCallPeers(); while (callParticipantsIter.hasNext()) { CallPeerSipImpl cp = @@ -1164,7 +1164,7 @@ private void processInviteOK(ClientTransaction clientTransaction, //ack) so make sure we set the state accordingly or the hangup //method won't know how to end the call. callParticipant.setState(CallPeerState.CONNECTED); - hangupCallParticipant(callParticipant); + hangupCallPeer(callParticipant); } catch (Exception e) { @@ -1612,7 +1612,7 @@ private void processInvite(SipProvider sourceProvider, try { - answerCallParticipant(callParticipant); + answerCallPeer(callParticipant); sayBye = true; } catch (OperationFailedException ex) @@ -1629,7 +1629,7 @@ private void processInvite(SipProvider sourceProvider, { try { - hangupCallParticipant(callParticipantToReplace); + hangupCallPeer(callParticipantToReplace); } catch (OperationFailedException ex) { @@ -2612,7 +2612,7 @@ private Request createRequest(Dialog dialog, String method) * CallParticipantSipImpl. * @throws OperationFailedException if we fail to terminate the call. */ - public synchronized void hangupCallParticipant(CallPeer participant) + public synchronized void hangupCallPeer(CallPeer participant) throws ClassCastException, OperationFailedException { @@ -2907,7 +2907,7 @@ private void sayBusyHere(CallPeerSipImpl callParticipant) * @throws OperationFailedException if we fail to create or send the * response. */ - public synchronized void answerCallParticipant(CallPeer participant) + public synchronized void answerCallPeer(CallPeer participant) throws OperationFailedException { CallPeerSipImpl callParticipant = @@ -3136,7 +3136,7 @@ public synchronized void shutdown() CallSipImpl call = activeCalls.next(); Iterator callParticipants - = call.getCallParticipants(); + = call.getCallPeers(); // go through all call participants and say bye to every one. while (callParticipants.hasNext()) @@ -3144,7 +3144,7 @@ public synchronized void shutdown() CallPeer participant = callParticipants.next(); try { - this.hangupCallParticipant(participant); + this.hangupCallPeer(participant); } catch (Exception ex) { diff --git a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetVideoTelephonySipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetVideoTelephonySipImpl.java index b16f0e9da..da2f0051e 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/OperationSetVideoTelephonySipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/OperationSetVideoTelephonySipImpl.java @@ -180,7 +180,7 @@ public void setLocalVideoAllowed(Call call, boolean allowed) * Once the local state has been modified, re-invite all * CallParticipants to re-negotiate the modified media setup. */ - Iterator participants = call.getCallParticipants(); + Iterator participants = call.getCallPeers(); while (participants.hasNext()) { CallPeerSipImpl participant diff --git a/src/net/java/sip/communicator/plugin/mailbox/Mailbox.java b/src/net/java/sip/communicator/plugin/mailbox/Mailbox.java index 03ea85fce..6f196c175 100644 --- a/src/net/java/sip/communicator/plugin/mailbox/Mailbox.java +++ b/src/net/java/sip/communicator/plugin/mailbox/Mailbox.java @@ -577,7 +577,7 @@ private void answerCall(Call call) = (OperationSetBasicTelephony)call .getProtocolProvider().getOperationSet( OperationSetBasicTelephony.class); - Iterator participants = call.getCallParticipants(); + Iterator participants = call.getCallPeers(); while(participants.hasNext()) { @@ -586,7 +586,7 @@ private void answerCall(Call call) try { - telephony.answerCallParticipant(participant); + telephony.answerCallPeer(participant); } catch (OperationFailedException exc) { @@ -613,7 +613,7 @@ private void hangupCall(Call call) OperationSetBasicTelephony.class); logger.info("Max Message Length Reached, Mailbox is" +" disconnecting the call"); - Iterator callParticipants = call.getCallParticipants(); + Iterator callParticipants = call.getCallPeers(); while(callParticipants.hasNext()) { @@ -622,7 +622,7 @@ private void hangupCall(Call call) try { - telephony.hangupCallParticipant(participant); + telephony.hangupCallPeer(participant); } catch (OperationFailedException exc) { diff --git a/src/net/java/sip/communicator/service/protocol/Call.java b/src/net/java/sip/communicator/service/protocol/Call.java index 856488a65..0df5565e5 100644 --- a/src/net/java/sip/communicator/service/protocol/Call.java +++ b/src/net/java/sip/communicator/service/protocol/Call.java @@ -123,14 +123,14 @@ public int hashCode() * Returns an iterator over all call participants. * @return an Iterator over all participants currently involved in the call. */ - public abstract Iterator getCallParticipants(); + public abstract Iterator getCallPeers(); /** * Returns the number of participants currently associated with this call. * @return an int indicating the number of participants currently * associated with this call. */ - public abstract int getCallParticipantsCount(); + public abstract int getCallPeerCount(); /** * Adds a call change listener to this call so that it could receive events @@ -216,7 +216,7 @@ else if (eventID == CallPeerEvent.CALL_PEER_REMVOVED) public String toString() { return "Call: id=" + getCallID() + " participants=" - + getCallParticipantsCount(); + + getCallPeerCount(); } /** diff --git a/src/net/java/sip/communicator/service/protocol/OperationSetBasicTelephony.java b/src/net/java/sip/communicator/service/protocol/OperationSetBasicTelephony.java index b16741c7d..2adf4e070 100644 --- a/src/net/java/sip/communicator/service/protocol/OperationSetBasicTelephony.java +++ b/src/net/java/sip/communicator/service/protocol/OperationSetBasicTelephony.java @@ -79,7 +79,7 @@ public Call createCall(Contact callee) * @throws OperationFailedException with the corresponding code if we * encounter an error while performing this operation. */ - public void answerCallParticipant(CallPeer participant) + public void answerCallPeer(CallPeer participant) throws OperationFailedException; /** @@ -112,7 +112,7 @@ public void putOffHold(CallPeer participant) * @throws OperationFailedException with the corresponding code if we * encounter an error while performing this operation. */ - public void hangupCallParticipant(CallPeer participant) + public void hangupCallPeer(CallPeer participant) throws OperationFailedException; /** diff --git a/test/net/java/sip/communicator/slick/callhistory/TestCallHistoryService.java b/test/net/java/sip/communicator/slick/callhistory/TestCallHistoryService.java index 873bfecc5..2cca917cb 100644 --- a/test/net/java/sip/communicator/slick/callhistory/TestCallHistoryService.java +++ b/test/net/java/sip/communicator/slick/callhistory/TestCallHistoryService.java @@ -153,7 +153,7 @@ private void generateCall(String participant) Vector v = new Vector(); - Iterator iter = newCall.getCallParticipants(); + Iterator iter = newCall.getCallPeers(); while (iter.hasNext()) { CallPeer item = (CallPeer) iter.next(); @@ -166,7 +166,7 @@ private void generateCall(String participant) while (iter.hasNext()) { CallPeer item = (CallPeer) iter.next(); - mockBTelphonyOpSet.hangupCallParticipant(item); + mockBTelphonyOpSet.hangupCallPeer(item); } } catch (Exception ex1) @@ -284,7 +284,7 @@ public void checkRecordCompleteness() Vector v = new Vector(); - Iterator iter = newCall.getCallParticipants(); + Iterator iter = newCall.getCallPeers(); while (iter.hasNext()) { CallPeer item = (CallPeer) iter.next(); @@ -297,7 +297,7 @@ public void checkRecordCompleteness() mockBTelphonyOpSet.addNewCallParticipant(newCall, partAddresses[1]); - mockBTelphonyOpSet.hangupCallParticipant(newParticipant); + mockBTelphonyOpSet.hangupCallPeer(newParticipant); waitSeconds(2000); @@ -305,7 +305,7 @@ public void checkRecordCompleteness() while (iter.hasNext()) { CallPeer item = (CallPeer) iter.next(); - mockBTelphonyOpSet.hangupCallParticipant(item); + mockBTelphonyOpSet.hangupCallPeer(item); } } catch (Exception ex1) diff --git a/test/net/java/sip/communicator/slick/metahistory/TestMetaHistoryService.java b/test/net/java/sip/communicator/slick/metahistory/TestMetaHistoryService.java index a3656471d..991823a19 100644 --- a/test/net/java/sip/communicator/slick/metahistory/TestMetaHistoryService.java +++ b/test/net/java/sip/communicator/slick/metahistory/TestMetaHistoryService.java @@ -288,7 +288,7 @@ private void generateCall(String participant) Vector v = new Vector(); - Iterator iter = newCall.getCallParticipants(); + Iterator iter = newCall.getCallPeers(); while (iter.hasNext()) { CallPeer item = (CallPeer) iter.next(); @@ -301,7 +301,7 @@ private void generateCall(String participant) while (iter.hasNext()) { CallPeer item = (CallPeer) iter.next(); - mockBTelphonyOpSet.hangupCallParticipant(item); + mockBTelphonyOpSet.hangupCallPeer(item); } } catch (Exception ex1) diff --git a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetBasicTelephonyJabberImpl.java b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetBasicTelephonyJabberImpl.java index 5707a9ec1..9deae2bf4 100644 --- a/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetBasicTelephonyJabberImpl.java +++ b/test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetBasicTelephonyJabberImpl.java @@ -116,55 +116,55 @@ public void testCreateCancelCall() ,CallEvent.CALL_RECEIVED, callReceivedEvent.getEventID()); assertNotNull("CallEvent.getSource()", callAtP2); - //verify that call participants are properly created - assertEquals("callAtP1.getCallParticipantsCount()" - , 1, callAtP1.getCallParticipantsCount()); - assertEquals("callAtP2.getCallParticipantsCount()" - , 1, callAtP2.getCallParticipantsCount()); - - CallPeer participantAtP1 - = (CallPeer)callAtP1.getCallParticipants().next(); - CallPeer participantAtP2 - = (CallPeer)callAtP2.getCallParticipants().next(); - - //now add listeners to the participants and make sure they have entered + //verify that call peers are properly created + assertEquals("callAtP1.getCallPeerCount()" + , 1, callAtP1.getCallPeerCount()); + assertEquals("callAtP2.getCallPeerCount()" + , 1, callAtP2.getCallPeerCount()); + + CallPeer peerAtP1 + = (CallPeer)callAtP1.getCallPeers().next(); + CallPeer peerAtP2 + = (CallPeer)callAtP2.getCallPeers().next(); + + //now add listeners to the peers and make sure they have entered //the states they were expected to. - //check states for call participants at both parties - CallParticipantStateEventCollector stateCollectorForPp1 - = new CallParticipantStateEventCollector( - participantAtP1, CallPeerState.ALERTING_REMOTE_SIDE); - CallParticipantStateEventCollector stateCollectorForPp2 - = new CallParticipantStateEventCollector( - participantAtP2, CallPeerState.INCOMING_CALL); + //check states for call peers at both parties + CallPeerStateEventCollector stateCollectorForPp1 + = new CallPeerStateEventCollector( + peerAtP1, CallPeerState.ALERTING_REMOTE_SIDE); + CallPeerStateEventCollector stateCollectorForPp2 + = new CallPeerStateEventCollector( + peerAtP2, CallPeerState.INCOMING_CALL); stateCollectorForPp1.waitForEvent(10000, true); stateCollectorForPp2.waitForEvent(10000, true); - assertSame("participantAtP1.getCall" - , participantAtP1.getCall(), callAtP1); - assertSame("participantAtP2.getCall" - , participantAtP2.getCall(), callAtP2); + assertSame("peerAtP1.getCall" + , peerAtP1.getCall(), callAtP1); + assertSame("peerAtP2.getCall" + , peerAtP2.getCall(), callAtP2); - //make sure that the participants are in the proper state - assertEquals("The participant at provider one was not in the " + //make sure that the peers are in the proper state + assertEquals("The peer at provider one was not in the " +"right state." , CallPeerState.ALERTING_REMOTE_SIDE - , participantAtP1.getState()); - assertEquals("The participant at provider two was not in the " + , peerAtP1.getState()); + assertEquals("The peer at provider two was not in the " +"right state." , CallPeerState.INCOMING_CALL - , participantAtP2.getState()); + , peerAtP2.getState()); //test whether caller/callee info is properly distributed in case //the server is said to support it. - if(Boolean.getBoolean("accounts.jabber.PRESERVE_PARTICIPANT_INFO")) + if(Boolean.getBoolean("accounts.jabber.PRESERVE_PEER_INFO")) { - //check properties on the remote call participant for the party that + //check properties on the remote call peer for the party that //initiated the call. - String expectedParticipant1Address + String expectedPeer1Address = fixture.provider2.getAccountID().getAccountAddress(); - String expectedParticipant1DisplayName + String expectedPeer1DisplayName = System.getProperty( JabberProtocolProviderServiceLick.ACCOUNT_2_PREFIX + ProtocolProviderFactory.DISPLAY_NAME); @@ -173,20 +173,20 @@ public void testCreateCancelCall() //display name or something of the kind assertTrue("Provider 2 did not advertise their " + "accountID.getAccoutAddress() address." - , expectedParticipant1Address.indexOf( - participantAtP1.getAddress()) != -1 - || participantAtP1.getAddress().indexOf( - expectedParticipant1Address) != -1); + , expectedPeer1Address.indexOf( + peerAtP1.getAddress()) != -1 + || peerAtP1.getAddress().indexOf( + expectedPeer1Address) != -1); assertEquals("Provider 2 did not properly advertise their " + "display name." - , expectedParticipant1DisplayName - , participantAtP1.getDisplayName()); + , expectedPeer1DisplayName + , peerAtP1.getDisplayName()); - //check properties on the remote call participant for the party that + //check properties on the remote call peer for the party that //receives the call. - String expectedParticipant2Address + String expectedPeer2Address = fixture.provider1.getAccountID().getAccountAddress(); - String expectedParticipant2DisplayName + String expectedPeer2DisplayName = System.getProperty( JabberProtocolProviderServiceLick.ACCOUNT_1_PREFIX + ProtocolProviderFactory.DISPLAY_NAME); @@ -195,23 +195,23 @@ public void testCreateCancelCall() //display name or something of the kind assertTrue("Provider 1 did not advertise their " + "accountID.getAccoutAddress() address." - , expectedParticipant2Address.indexOf( - participantAtP2.getAddress()) != -1 - || participantAtP2.getAddress().indexOf( - expectedParticipant2Address) != -1); + , expectedPeer2Address.indexOf( + peerAtP2.getAddress()) != -1 + || peerAtP2.getAddress().indexOf( + expectedPeer2Address) != -1); assertEquals("Provider 1 did not properly advertise their " + "display name." - , expectedParticipant2DisplayName - , participantAtP2.getDisplayName()); + , expectedPeer2DisplayName + , peerAtP2.getDisplayName()); } //we'll now try to cancel the call - //listeners monitoring state change of the participant - stateCollectorForPp1 = new CallParticipantStateEventCollector( - participantAtP1, CallPeerState.DISCONNECTED); - stateCollectorForPp2 = new CallParticipantStateEventCollector( - participantAtP2, CallPeerState.DISCONNECTED); + //listeners monitoring state change of the peer + stateCollectorForPp1 = new CallPeerStateEventCollector( + peerAtP1, CallPeerState.DISCONNECTED); + stateCollectorForPp2 = new CallPeerStateEventCollector( + peerAtP2, CallPeerState.DISCONNECTED); //listeners waiting for the op set to announce the end of the call call1Listener = new CallEventCollector(basicTelephonyP1); @@ -224,7 +224,7 @@ public void testCreateCancelCall() = new CallStateEventCollector(callAtP2, CallState.CALL_ENDED); //Now make the caller CANCEL the call. - basicTelephonyP1.hangupCallParticipant(participantAtP1); + basicTelephonyP1.hangupCallPeer(peerAtP1); //wait for everything to happen call1Listener.waitForEvent(10000); @@ -235,11 +235,11 @@ public void testCreateCancelCall() call2StateCollector.waitForEvent(10000); - //make sure that the participant is disconnected - assertEquals("The participant at provider one was not in the " + //make sure that the peer is disconnected + assertEquals("The peer at provider one was not in the " +"right state." , CallPeerState.DISCONNECTED - , participantAtP1.getState()); + , peerAtP1.getState()); //make sure the telephony operation set distributed an event for the end //of the call @@ -258,11 +258,11 @@ public void testCreateCancelCall() //same for provider 2 - //make sure that the participant is disconnected - assertEquals("The participant at provider one was not in the " + //make sure that the peer is disconnected + assertEquals("The peer at provider one was not in the " +"right state." , CallPeerState.DISCONNECTED - , participantAtP2.getState()); + , peerAtP2.getState()); //make sure the telephony operation set distributed an event for the end //of the call @@ -346,55 +346,55 @@ public void testCreateRejectCall() ,CallEvent.CALL_RECEIVED, callReceivedEvent.getEventID()); assertNotNull("CallEvent.getSource()", callAtP2); - //verify that call participants are properly created - assertEquals("callAtP1.getCallParticipantsCount()" - , 1, callAtP1.getCallParticipantsCount()); - assertEquals("callAtP2.getCallParticipantsCount()" - , 1, callAtP2.getCallParticipantsCount()); + //verify that call peers are properly created + assertEquals("callAtP1.getCallPeerCount()" + , 1, callAtP1.getCallPeerCount()); + assertEquals("callAtP2.getCallPeerCount()" + , 1, callAtP2.getCallPeerCount()); - CallPeer participantAtP1 - = (CallPeer)callAtP1.getCallParticipants().next(); - CallPeer participantAtP2 - = (CallPeer)callAtP2.getCallParticipants().next(); + CallPeer peerAtP1 + = (CallPeer)callAtP1.getCallPeers().next(); + CallPeer peerAtP2 + = (CallPeer)callAtP2.getCallPeers().next(); - //now add listeners to the participants and make sure they have entered + //now add listeners to the peers and make sure they have entered //the states they were expected to. - //check states for call participants at both parties - CallParticipantStateEventCollector stateCollectorForPp1 - = new CallParticipantStateEventCollector( - participantAtP1, CallPeerState.ALERTING_REMOTE_SIDE); - CallParticipantStateEventCollector stateCollectorForPp2 - = new CallParticipantStateEventCollector( - participantAtP2, CallPeerState.INCOMING_CALL); + //check states for call peers at both parties + CallPeerStateEventCollector stateCollectorForPp1 + = new CallPeerStateEventCollector( + peerAtP1, CallPeerState.ALERTING_REMOTE_SIDE); + CallPeerStateEventCollector stateCollectorForPp2 + = new CallPeerStateEventCollector( + peerAtP2, CallPeerState.INCOMING_CALL); stateCollectorForPp1.waitForEvent(10000, true); stateCollectorForPp2.waitForEvent(10000, true); - assertSame("participantAtP1.getCall" - , participantAtP1.getCall(), callAtP1); - assertSame("participantAtP2.getCall" - , participantAtP2.getCall(), callAtP2); + assertSame("peerAtP1.getCall" + , peerAtP1.getCall(), callAtP1); + assertSame("peerAtP2.getCall" + , peerAtP2.getCall(), callAtP2); - //make sure that the participants are in the proper state - assertEquals("The participant at provider one was not in the " + //make sure that the peers are in the proper state + assertEquals("The peer at provider one was not in the " +"right state." , CallPeerState.ALERTING_REMOTE_SIDE - , participantAtP1.getState()); - assertEquals("The participant at provider two was not in the " + , peerAtP1.getState()); + assertEquals("The peer at provider two was not in the " +"right state." , CallPeerState.INCOMING_CALL - , participantAtP2.getState()); + , peerAtP2.getState()); //test whether caller/callee info is properly distributed in case //the server is said to support it. - if(Boolean.getBoolean("accounts.jabber.PRESERVE_PARTICIPANT_INFO")) + if(Boolean.getBoolean("accounts.jabber.PRESERVE_PEER_INFO")) { - //check properties on the remote call participant for the party that + //check properties on the remote call peer for the party that //initiated the call. - String expectedParticipant1Address + String expectedPeer1Address = fixture.provider2.getAccountID().getAccountAddress(); - String expectedParticipant1DisplayName + String expectedPeer1DisplayName = System.getProperty( JabberProtocolProviderServiceLick.ACCOUNT_2_PREFIX + ProtocolProviderFactory.DISPLAY_NAME); @@ -403,20 +403,20 @@ public void testCreateRejectCall() //display name or something of the kind assertTrue("Provider 2 did not advertise their " + "accountID.getAccoutAddress() address." - , expectedParticipant1Address.indexOf( - participantAtP1.getAddress()) != -1 - || participantAtP1.getAddress().indexOf( - expectedParticipant1Address) != -1); + , expectedPeer1Address.indexOf( + peerAtP1.getAddress()) != -1 + || peerAtP1.getAddress().indexOf( + expectedPeer1Address) != -1); assertEquals("Provider 2 did not properly advertise their " + "display name." - , expectedParticipant1DisplayName - , participantAtP1.getDisplayName()); + , expectedPeer1DisplayName + , peerAtP1.getDisplayName()); - //check properties on the remote call participant for the party that + //check properties on the remote call peer for the party that //receives the call. - String expectedParticipant2Address + String expectedPeer2Address = fixture.provider1.getAccountID().getAccountAddress(); - String expectedParticipant2DisplayName + String expectedPeer2DisplayName = System.getProperty( JabberProtocolProviderServiceLick.ACCOUNT_1_PREFIX + ProtocolProviderFactory.DISPLAY_NAME); @@ -425,26 +425,26 @@ public void testCreateRejectCall() //display name or something of the kind assertTrue("Provider 1 did not advertise their " + "accountID.getAccoutAddress() address." - , expectedParticipant2Address.indexOf( - participantAtP2.getAddress()) != -1 - || participantAtP2.getAddress().indexOf( - expectedParticipant2Address) != -1); + , expectedPeer2Address.indexOf( + peerAtP2.getAddress()) != -1 + || peerAtP2.getAddress().indexOf( + expectedPeer2Address) != -1); assertEquals("Provider 1 did not properly advertise their " + "display name." - , expectedParticipant2DisplayName - , participantAtP2.getDisplayName()); + , expectedPeer2DisplayName + , peerAtP2.getDisplayName()); } //we'll now try to send busy tone. - //listeners monitoring state change of the participant - CallParticipantStateEventCollector busyStateCollectorForPp1 - = new CallParticipantStateEventCollector( - participantAtP1, CallPeerState.BUSY); - stateCollectorForPp1 = new CallParticipantStateEventCollector( - participantAtP1, CallPeerState.DISCONNECTED); - stateCollectorForPp2 = new CallParticipantStateEventCollector( - participantAtP2, CallPeerState.DISCONNECTED); + //listeners monitoring state change of the peer + CallPeerStateEventCollector busyStateCollectorForPp1 + = new CallPeerStateEventCollector( + peerAtP1, CallPeerState.BUSY); + stateCollectorForPp1 = new CallPeerStateEventCollector( + peerAtP1, CallPeerState.DISCONNECTED); + stateCollectorForPp2 = new CallPeerStateEventCollector( + peerAtP2, CallPeerState.DISCONNECTED); //listeners waiting for the op set to announce the end of the call call1Listener = new CallEventCollector(basicTelephonyP1); @@ -457,9 +457,9 @@ public void testCreateRejectCall() = new CallStateEventCollector(callAtP2, CallState.CALL_ENDED); //Now make the caller CANCEL the call. - basicTelephonyP2.hangupCallParticipant(participantAtP2); + basicTelephonyP2.hangupCallPeer(peerAtP2); busyStateCollectorForPp1.waitForEvent(10000); - basicTelephonyP1.hangupCallParticipant(participantAtP1); + basicTelephonyP1.hangupCallPeer(peerAtP1); //wait for everything to happen call1Listener.waitForEvent(10000); @@ -470,11 +470,11 @@ public void testCreateRejectCall() call2StateCollector.waitForEvent(10000); - //make sure that the participant is disconnected - assertEquals("The participant at provider one was not in the " + //make sure that the peer is disconnected + assertEquals("The peer at provider one was not in the " +"right state." , CallPeerState.DISCONNECTED - , participantAtP1.getState()); + , peerAtP1.getState()); @@ -495,11 +495,11 @@ public void testCreateRejectCall() //same for provider 2 - //make sure that the participant is disconnected - assertEquals("The participant at provider one was not in the " + //make sure that the peer is disconnected + assertEquals("The peer at provider one was not in the " +"right state." , CallPeerState.DISCONNECTED - , participantAtP2.getState()); + , peerAtP2.getState()); //make sure the telephony operation set distributed an event for the end //of the call @@ -583,77 +583,77 @@ public void aTestCreateAnswerHangupCall() ,CallEvent.CALL_RECEIVED, callReceivedEvent.getEventID()); assertNotNull("CallEvent.getSource()", callAtP2); - //verify that call participants are properly created - assertEquals("callAtP1.getCallParticipantsCount()" - , 1, callAtP1.getCallParticipantsCount()); - assertEquals("callAtP2.getCallParticipantsCount()" - , 1, callAtP2.getCallParticipantsCount()); + //verify that call peers are properly created + assertEquals("callAtP1.getCallPeerCount()" + , 1, callAtP1.getCallPeerCount()); + assertEquals("callAtP2.getCallPeerCount()" + , 1, callAtP2.getCallPeerCount()); - CallPeer participantAtP1 - = (CallPeer)callAtP1.getCallParticipants().next(); - CallPeer participantAtP2 - = (CallPeer)callAtP2.getCallParticipants().next(); + CallPeer peerAtP1 + = (CallPeer)callAtP1.getCallPeers().next(); + CallPeer peerAtP2 + = (CallPeer)callAtP2.getCallPeers().next(); - //now add listeners to the participants and make sure they have entered + //now add listeners to the peers and make sure they have entered //the states they were expected to. - //check states for call participants at both parties - CallParticipantStateEventCollector stateCollectorForPp1 - = new CallParticipantStateEventCollector( - participantAtP1, CallPeerState.ALERTING_REMOTE_SIDE); - CallParticipantStateEventCollector stateCollectorForPp2 - = new CallParticipantStateEventCollector( - participantAtP2, CallPeerState.INCOMING_CALL); + //check states for call peers at both parties + CallPeerStateEventCollector stateCollectorForPp1 + = new CallPeerStateEventCollector( + peerAtP1, CallPeerState.ALERTING_REMOTE_SIDE); + CallPeerStateEventCollector stateCollectorForPp2 + = new CallPeerStateEventCollector( + peerAtP2, CallPeerState.INCOMING_CALL); stateCollectorForPp1.waitForEvent(10000, true); stateCollectorForPp2.waitForEvent(10000, true); - assertSame("participantAtP1.getCall" - , participantAtP1.getCall(), callAtP1); - assertSame("participantAtP2.getCall" - , participantAtP2.getCall(), callAtP2); + assertSame("peerAtP1.getCall" + , peerAtP1.getCall(), callAtP1); + assertSame("peerAtP2.getCall" + , peerAtP2.getCall(), callAtP2); - //make sure that the participants are in the proper state - assertEquals("The participant at provider one was not in the " + //make sure that the peers are in the proper state + assertEquals("The peer at provider one was not in the " +"right state." , CallPeerState.ALERTING_REMOTE_SIDE - , participantAtP1.getState()); - assertEquals("The participant at provider two was not in the " + , peerAtP1.getState()); + assertEquals("The peer at provider two was not in the " +"right state." , CallPeerState.INCOMING_CALL - , participantAtP2.getState()); + , peerAtP2.getState()); //test whether caller/callee info is properly distributed in case //the server is said to support it. - if(Boolean.getBoolean("accounts.jabber.PRESERVE_PARTICIPANT_INFO")) + if(Boolean.getBoolean("accounts.jabber.PRESERVE_PEER_INFO")) { - //check properties on the remote call participant for the party that + //check properties on the remote call peer for the party that //initiated the call. - String expectedParticipant1Address + String expectedPeer1Address = fixture.provider2.getAccountID().getAccountAddress(); - String expectedParticipant1DisplayName + String expectedPeer1DisplayName = System.getProperty( JabberProtocolProviderServiceLick.ACCOUNT_2_PREFIX + ProtocolProviderFactory.DISPLAY_NAME); - //do not asser equals here since one of the addresses may contain a + //do not assert equals here since one of the addresses may contain a //display name or something of the kind assertTrue("Provider 2 did not advertise their " + "accountID.getAccoutAddress() address." - , expectedParticipant1Address.indexOf( - participantAtP1.getAddress()) != -1 - || participantAtP1.getAddress().indexOf( - expectedParticipant1Address) != -1); + , expectedPeer1Address.indexOf( + peerAtP1.getAddress()) != -1 + || peerAtP1.getAddress().indexOf( + expectedPeer1Address) != -1); assertEquals("Provider 2 did not properly advertise their " + "display name." - , expectedParticipant1DisplayName - , participantAtP1.getDisplayName()); + , expectedPeer1DisplayName + , peerAtP1.getDisplayName()); - //check properties on the remote call participant for the party that + //check properties on the remote call peer for the party that //receives the call. - String expectedParticipant2Address + String expectedPeer2Address = fixture.provider1.getAccountID().getAccountAddress(); - String expectedParticipant2DisplayName + String expectedPeer2DisplayName = System.getProperty( JabberProtocolProviderServiceLick.ACCOUNT_1_PREFIX + ProtocolProviderFactory.DISPLAY_NAME); @@ -662,85 +662,85 @@ public void aTestCreateAnswerHangupCall() //display name or something of the kind assertTrue("Provider 1 did not advertise their " + "accountID.getAccoutAddress() address." - , expectedParticipant2Address.indexOf( - participantAtP2.getAddress()) != -1 - || participantAtP2.getAddress().indexOf( - expectedParticipant2Address) != -1); + , expectedPeer2Address.indexOf( + peerAtP2.getAddress()) != -1 + || peerAtP2.getAddress().indexOf( + expectedPeer2Address) != -1); assertEquals("Provider 1 did not properly advertise their " + "display name." - , expectedParticipant2DisplayName - , participantAtP2.getDisplayName()); + , expectedPeer2DisplayName + , peerAtP2.getDisplayName()); } - //add listeners to the participants and make sure enter + //add listeners to the peers and make sure enter //a connected state after we answer stateCollectorForPp1 - = new CallParticipantStateEventCollector( - participantAtP1, CallPeerState.CONNECTED); + = new CallPeerStateEventCollector( + peerAtP1, CallPeerState.CONNECTED); stateCollectorForPp2 - = new CallParticipantStateEventCollector( - participantAtP2, CallPeerState.CONNECTED); + = new CallPeerStateEventCollector( + peerAtP2, CallPeerState.CONNECTED); //we will now anser the call and verify that both parties change states //accordingly. - basicTelephonyP2.answerCallParticipant(participantAtP2); + basicTelephonyP2.answerCallPeer(peerAtP2); stateCollectorForPp1.waitForEvent(10000); stateCollectorForPp2.waitForEvent(10000); - //make sure that the participants are in the proper state - assertEquals("The participant at provider one was not in the " + //make sure that the peers are in the proper state + assertEquals("The peer at provider one was not in the " +"right state." , CallPeerState.CONNECTED - , participantAtP1.getState()); - assertEquals("The participant at provider two was not in the " + , peerAtP1.getState()); + assertEquals("The peer at provider two was not in the " +"right state." , CallPeerState.CONNECTED - , participantAtP2.getState()); + , peerAtP2.getState()); //make sure that events have been distributed when states were changed. - assertEquals("No event was dispatched when a call participant changed " + assertEquals("No event was dispatched when a call peer changed " +"its state." , 1 , stateCollectorForPp1.collectedEvents.size()); - assertEquals("No event was dispatched when a call participant changed " + assertEquals("No event was dispatched when a call peer changed " +"its state." , 1 , stateCollectorForPp2.collectedEvents.size()); - //add listeners to the participants and make sure they have entered + //add listeners to the peers and make sure they have entered //the states they are expected to. stateCollectorForPp1 - = new CallParticipantStateEventCollector( - participantAtP1, CallPeerState.DISCONNECTED); + = new CallPeerStateEventCollector( + peerAtP1, CallPeerState.DISCONNECTED); stateCollectorForPp2 - = new CallParticipantStateEventCollector( - participantAtP2, CallPeerState.DISCONNECTED); + = new CallPeerStateEventCollector( + peerAtP2, CallPeerState.DISCONNECTED); //we will now end the call and verify that both parties change states //accordingly. - basicTelephonyP2.hangupCallParticipant(participantAtP2); + basicTelephonyP2.hangupCallPeer(peerAtP2); stateCollectorForPp1.waitForEvent(10000); stateCollectorForPp2.waitForEvent(10000); - //make sure that the participants are in the proper state - assertEquals("The participant at provider one was not in the " + //make sure that the peers are in the proper state + assertEquals("The peer at provider one was not in the " +"right state." , CallPeerState.DISCONNECTED - , participantAtP1.getState()); - assertEquals("The participant at provider two was not in the " + , peerAtP1.getState()); + assertEquals("The peer at provider two was not in the " +"right state." , CallPeerState.DISCONNECTED - , participantAtP2.getState()); + , peerAtP2.getState()); //make sure that the corresponding events were delivered. assertEquals("a provider did not distribute an event when a call " - +"participant changed states." + +"peer changed states." , 1 , stateCollectorForPp1.collectedEvents.size()); assertEquals("a provider did not distribute an event when a call " - +"participant changed states." + +"peer changed states." , 1 , stateCollectorForPp2.collectedEvents.size()); @@ -854,30 +854,30 @@ public void callEnded(CallEvent event) } /** - * Allows tests to wait for and collect events issued upon call participant + * Allows tests to wait for and collect events issued upon call peer * status changes. */ - public class CallParticipantStateEventCollector + public class CallPeerStateEventCollector extends CallPeerAdapter { public ArrayList collectedEvents = new ArrayList(); - private CallPeer listenedCallParticipant = null; + private CallPeer listenedCallPeer = null; public CallPeerState awaitedState = null; /** * Creates an instance of this collector and adds it as a listener - * to callParticipant. - * @param callParticipant the CallParticipant that we will be listening + * to callPeer. + * @param callPeer the CallPeer that we will be listening * to. * @param awaitedState the state that we will be waiting for inside * this collector. */ - public CallParticipantStateEventCollector( - CallPeer callParticipant, + public CallPeerStateEventCollector( + CallPeer callPeer, CallPeerState awaitedState) { - this.listenedCallParticipant = callParticipant; - this.listenedCallParticipant.addCallParticipantListener(this); + this.listenedCallPeer = callPeer; + this.listenedCallPeer.addCallPeerListener(this); this.awaitedState = awaitedState; } @@ -886,7 +886,7 @@ public CallParticipantStateEventCollector( * * @param event the event containing the source call. */ - public void participantStateChanged(CallPeerChangeEvent event) + public void peerStateChanged(CallPeerChangeEvent event) { synchronized(this) { @@ -921,23 +921,23 @@ public void waitForEvent(long waitFor) * @param waitFor the number of miliseconds that we should be waiting * for an event before simply bailing out. * @param exitIfAlreadyInState specifies whether the method is to return - * if the call participant is already in such a state even if no event + * if the call peer is already in such a state even if no event * has been received for the sate change. */ public void waitForEvent(long waitFor, boolean exitIfAlreadyInState) { - logger.trace("Waiting for a CallParticipantEvent with newState=" - + awaitedState + " for participant " - + this.listenedCallParticipant); + logger.trace("Waiting for a CallPeerEvent with newState=" + + awaitedState + " for peer " + + this.listenedCallPeer); synchronized (this) { if(exitIfAlreadyInState - && listenedCallParticipant.getState().equals(awaitedState)) + && listenedCallPeer.getState().equals(awaitedState)) { - logger.trace("Src participant is already in the awaited " + logger.trace("Src peer is already in the awaited " + "state." + collectedEvents); - listenedCallParticipant.removeCallParticipantListener(this); + listenedCallPeer.removeCallPeerListener(this); return; } if(collectedEvents.size() > 0) @@ -950,8 +950,8 @@ public void waitForEvent(long waitFor, boolean exitIfAlreadyInState) { logger.trace("Event already received. " + collectedEvents); - listenedCallParticipant - .removeCallParticipantListener(this); + listenedCallPeer + .removeCallPeerListener(this); return; } } @@ -965,8 +965,8 @@ public void waitForEvent(long waitFor, boolean exitIfAlreadyInState) logger.trace("No CallParticpantStateEvent received for " + waitFor + "ms."); - listenedCallParticipant - .removeCallParticipantListener(this); + listenedCallPeer + .removeCallPeerListener(this); } catch (InterruptedException ex) { diff --git a/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetBasicTelephonySipImpl.java b/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetBasicTelephonySipImpl.java index c9da168fc..71991bbad 100644 --- a/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetBasicTelephonySipImpl.java +++ b/test/net/java/sip/communicator/slick/protocol/sip/TestOperationSetBasicTelephonySipImpl.java @@ -117,14 +117,14 @@ public void testCreateCancelCall() //verify that call participants are properly created assertEquals("callAtP1.getCallParticipantsCount()" - , 1, callAtP1.getCallParticipantsCount()); + , 1, callAtP1.getCallPeerCount()); assertEquals("callAtP2.getCallParticipantsCount()" - , 1, callAtP2.getCallParticipantsCount()); + , 1, callAtP2.getCallPeerCount()); CallPeer participantAtP1 - = (CallPeer)callAtP1.getCallParticipants().next(); + = (CallPeer)callAtP1.getCallPeers().next(); CallPeer participantAtP2 - = (CallPeer)callAtP2.getCallParticipants().next(); + = (CallPeer)callAtP2.getCallPeers().next(); //now add listeners to the participants and make sure they have entered //the states they were expected to. @@ -223,7 +223,7 @@ public void testCreateCancelCall() = new CallStateEventCollector(callAtP2, CallState.CALL_ENDED); //Now make the caller CANCEL the call. - basicTelephonyP1.hangupCallParticipant(participantAtP1); + basicTelephonyP1.hangupCallPeer(participantAtP1); //wait for everything to happen call1Listener.waitForEvent(10000); @@ -347,14 +347,14 @@ public void testCreateRejectCall() //verify that call participants are properly created assertEquals("callAtP1.getCallParticipantsCount()" - , 1, callAtP1.getCallParticipantsCount()); + , 1, callAtP1.getCallPeerCount()); assertEquals("callAtP2.getCallParticipantsCount()" - , 1, callAtP2.getCallParticipantsCount()); + , 1, callAtP2.getCallPeerCount()); CallPeer participantAtP1 - = (CallPeer)callAtP1.getCallParticipants().next(); + = (CallPeer)callAtP1.getCallPeers().next(); CallPeer participantAtP2 - = (CallPeer)callAtP2.getCallParticipants().next(); + = (CallPeer)callAtP2.getCallPeers().next(); //now add listeners to the participants and make sure they have entered //the states they were expected to. @@ -456,9 +456,9 @@ public void testCreateRejectCall() = new CallStateEventCollector(callAtP2, CallState.CALL_ENDED); //Now make the caller CANCEL the call. - basicTelephonyP2.hangupCallParticipant(participantAtP2); + basicTelephonyP2.hangupCallPeer(participantAtP2); busyStateCollectorForPp1.waitForEvent(10000); - basicTelephonyP1.hangupCallParticipant(participantAtP1); + basicTelephonyP1.hangupCallPeer(participantAtP1); //wait for everything to happen call1Listener.waitForEvent(10000); @@ -584,14 +584,14 @@ public void aTestCreateAnswerHangupCall() //verify that call participants are properly created assertEquals("callAtP1.getCallParticipantsCount()" - , 1, callAtP1.getCallParticipantsCount()); + , 1, callAtP1.getCallPeerCount()); assertEquals("callAtP2.getCallParticipantsCount()" - , 1, callAtP2.getCallParticipantsCount()); + , 1, callAtP2.getCallPeerCount()); CallPeer participantAtP1 - = (CallPeer)callAtP1.getCallParticipants().next(); + = (CallPeer)callAtP1.getCallPeers().next(); CallPeer participantAtP2 - = (CallPeer)callAtP2.getCallParticipants().next(); + = (CallPeer)callAtP2.getCallPeers().next(); //now add listeners to the participants and make sure they have entered //the states they were expected to. @@ -682,7 +682,7 @@ public void aTestCreateAnswerHangupCall() //we will now anser the call and verify that both parties change states //accordingly. - basicTelephonyP2.answerCallParticipant(participantAtP2); + basicTelephonyP2.answerCallPeer(participantAtP2); stateCollectorForPp1.waitForEvent(10000); stateCollectorForPp2.waitForEvent(10000); @@ -718,7 +718,7 @@ public void aTestCreateAnswerHangupCall() //we will now end the call and verify that both parties change states //accordingly. - basicTelephonyP2.hangupCallParticipant(participantAtP2); + basicTelephonyP2.hangupCallPeer(participantAtP2); stateCollectorForPp1.waitForEvent(10000); stateCollectorForPp2.waitForEvent(10000); @@ -876,7 +876,7 @@ public CallParticipantStateEventCollector( CallPeerState awaitedState) { this.listenedCallParticipant = callParticipant; - this.listenedCallParticipant.addCallParticipantListener(this); + this.listenedCallParticipant.addCallPeerListener(this); this.awaitedState = awaitedState; } @@ -885,7 +885,7 @@ public CallParticipantStateEventCollector( * * @param event the event containing the source call. */ - public void participantStateChanged(CallPeerChangeEvent event) + public void peerStateChanged(CallPeerChangeEvent event) { synchronized(this) { @@ -936,7 +936,7 @@ public void waitForEvent(long waitFor, boolean exitIfAlreadyInState) logger.trace("Src participant is already in the awaited " + "state." + collectedEvents); - listenedCallParticipant.removeCallParticipantListener(this); + listenedCallParticipant.removeCallPeerListener(this); return; } if(collectedEvents.size() > 0) @@ -950,7 +950,7 @@ public void waitForEvent(long waitFor, boolean exitIfAlreadyInState) logger.trace("Event already received. " + collectedEvents); listenedCallParticipant - .removeCallParticipantListener(this); + .removeCallPeerListener(this); return; } } @@ -965,7 +965,7 @@ public void waitForEvent(long waitFor, boolean exitIfAlreadyInState) + waitFor + "ms."); listenedCallParticipant - .removeCallParticipantListener(this); + .removeCallPeerListener(this); } catch (InterruptedException ex) {