Fixed Offline Message Tests

cusax-fix
Damian Minkov 20 years ago
parent 7cde8eefac
commit 2739742023

@ -441,7 +441,7 @@ String getNameCopy()
*/
public boolean isPersistent()
{
return joustSimSourceGroup instanceof VolatileGroup;
return !(joustSimSourceGroup instanceof VolatileGroup);
}
/**

@ -84,14 +84,14 @@ public void start(BundleContext bundleContext) throws Exception
//As Tested account is not registered here we send him a message.
//Message will be delivered offline
//receive test is in TestOperationSetBasicInstantMessaging.testReceiveOfflineMessages()
// String offlineMsgBody = "This is a Test Message. Supposed to be delivered as offline message!";
// IcqSlickFixture.offlineMsgCollector =
// new IcqSlickFixture.OfflineMsgCollector();
// IcqSlickFixture.offlineMsgCollector.setMessageText(offlineMsgBody);
// IcqSlickFixture.testerAgent.sendOfflineMessage(
// System.getProperty(TESTED_IMPL_ACCOUNT_ID_PROP_NAME, null),
// offlineMsgBody
// );
String offlineMsgBody = "This is a Test Message. Supposed to be delivered as offline message!";
IcqSlickFixture.offlineMsgCollector =
new IcqSlickFixture.OfflineMsgCollector();
IcqSlickFixture.offlineMsgCollector.setMessageText(offlineMsgBody);
IcqSlickFixture.testerAgent.sendOfflineMessage(
System.getProperty(TESTED_IMPL_ACCOUNT_ID_PROP_NAME, null),
offlineMsgBody
);
//First test account installation so that the service that has been
//installed by it gets tested by the rest of the tests.

@ -478,7 +478,7 @@ public void testSendFunMessages()
/**
* Tests whether there is a offline message received
* and whether is the one we have send
*/
public void testReceiveOfflineMessages()
{
String messageText =
@ -489,5 +489,5 @@ public void testReceiveOfflineMessages()
assertNotNull("No Offline messages have been received", receiveMessage);
assertEquals("message body", messageText, receiveMessage.getContent());
}
*/
}

@ -438,8 +438,9 @@ public void postTestSubscribe()
// logger.trace("is contact there 1 = " +
// operationSetPresence.findContactByID(fixture.testerAgent.getIcqUIN()));
//
operationSetPresence.subscribe(fixture.testerAgent.getIcqUIN());
//
// logger.debug("Waiting for authorization error and authorization response...");
// authorizationLock.wait(5000);
//
@ -548,18 +549,41 @@ public void postTestSubscribe()
assertEquals("Subscription event dispatching failed."
, 1, subEvtCollector.collectedEvents.size());
SubscriptionEvent subEvt =
(SubscriptionEvent)subEvtCollector.collectedEvents.get(0);
EventObject evt =
(EventObject)subEvtCollector.collectedEvents.get(0);
Object source = null;
Contact srcContact = null;
ProtocolProviderService srcProvider = null;
if(evt instanceof SubscriptionEvent)
{
SubscriptionEvent subEvt = (SubscriptionEvent)evt;
source = subEvt.getSource();
srcContact = subEvt.getSourceContact();
srcProvider = subEvt.getSourceProvider();
}
else
if(evt instanceof SubscriptionMovedEvent)
{
SubscriptionMovedEvent mvEvt = (SubscriptionMovedEvent)evt;
source = mvEvt.getSource();
srcContact = mvEvt.getSourceContact();
srcProvider = mvEvt.getSourceProvider();
}
assertEquals("SubscriptionEvent Source:",
fixture.testerAgent.getIcqUIN(),
((Contact)subEvt.getSource()).getAddress());
((Contact)source).getAddress());
assertEquals("SubscriptionEvent Source Contact:",
fixture.testerAgent.getIcqUIN(),
subEvt.getSourceContact().getAddress());
srcContact.getAddress());
assertSame("SubscriptionEvent Source Provider:",
fixture.provider,
subEvt.getSourceProvider());
srcProvider);
subEvtCollector.collectedEvents.clear();

@ -127,12 +127,12 @@ public void testRegister()
// Here is registered the listener which will receive the first message
// This message is supposed to be offline message and as one is tested
// in TestOperationSetBasicInstantMessaging.testReceiveOfflineMessages()
// Map supportedOperationSets =
// fixture.provider.getSupportedOperationSets();
// OperationSetBasicInstantMessaging opSetBasicIM =
// (OperationSetBasicInstantMessaging)supportedOperationSets.get(
// OperationSetBasicInstantMessaging.class.getName());
// fixture.offlineMsgCollector.register(opSetBasicIM);
Map supportedOperationSets =
fixture.provider.getSupportedOperationSets();
OperationSetBasicInstantMessaging opSetBasicIM =
(OperationSetBasicInstantMessaging)supportedOperationSets.get(
OperationSetBasicInstantMessaging.class.getName());
fixture.offlineMsgCollector.register(opSetBasicIM);
//give time for the AIM server to notify everyone of our arrival
//simply waitinf is really not a reliable way of doing things but I

Loading…
Cancel
Save