use of net.java.slee.resource.diameter.sh.events.PushNotificationAnswer in project jain-slee.diameter by RestComm.
the class ShClientFactoriesTest method isProxiableCopiedPNA.
@Test
public void isProxiableCopiedPNA() throws Exception {
PushNotificationRequest pnr = createPushNotificationRequest();
PushNotificationAnswer pna = shClientFactory.createPushNotificationAnswer(pnr);
assertEquals("The 'P' bit is not copied from request in Push-Notification-Answer, it should. [RFC3588/6.2]", pnr.getHeader().isProxiable(), pna.getHeader().isProxiable());
// Reverse 'P' bit ...
((DiameterMessageImpl) pnr).getGenericData().setProxiable(!pnr.getHeader().isProxiable());
assertTrue("The 'P' bit was not modified in Push-Notification-Request, it should.", pnr.getHeader().isProxiable() != pna.getHeader().isProxiable());
pna = shClientFactory.createPushNotificationAnswer(pnr);
assertEquals("The 'P' bit is not copied from request in Push-Notification-Answer, it should. [RFC3588/6.2]", pnr.getHeader().isProxiable(), pna.getHeader().isProxiable());
}
use of net.java.slee.resource.diameter.sh.events.PushNotificationAnswer in project jain-slee.diameter by RestComm.
the class ShClientFactoriesTest method testGettersAndSettersPNA.
@Test
public void testGettersAndSettersPNA() throws Exception {
PushNotificationAnswer pna = shClientFactory.createPushNotificationAnswer(createPushNotificationRequest());
int nFailures = ShClientAvpAssistant.INSTANCE.testMethods(pna, PushNotificationAnswer.class);
assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
use of net.java.slee.resource.diameter.sh.events.PushNotificationAnswer in project jain-slee.diameter by RestComm.
the class ShClientFactoriesTest method hasTFlagSetPNA.
@Test
public void hasTFlagSetPNA() throws Exception {
PushNotificationRequest pnr = createPushNotificationRequest();
((DiameterMessageImpl) pnr).getGenericData().setReTransmitted(true);
assertTrue("The 'T' flag should be set in Push-Notification-Request", pnr.getHeader().isPotentiallyRetransmitted());
PushNotificationAnswer pna = shClientFactory.createPushNotificationAnswer(pnr);
assertFalse("The 'T' flag should not be set in Push-Notification-Answer", pna.getHeader().isPotentiallyRetransmitted());
}
use of net.java.slee.resource.diameter.sh.events.PushNotificationAnswer in project jain-slee.diameter by RestComm.
the class ShClientFactoriesTest method hasDestinationRealmPNA.
@Test
public void hasDestinationRealmPNA() throws Exception {
PushNotificationAnswer pna = shClientFactory.createPushNotificationAnswer(createPushNotificationRequest());
assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", pna.getDestinationRealm());
}
use of net.java.slee.resource.diameter.sh.events.PushNotificationAnswer in project jain-slee.diameter by RestComm.
the class ShClientFactoriesTest method isExperimentalResultCorrectlySetPNA.
/**
* Test for Issue #665 (Diameter Experimental Result AVP is Nested)
* http://code.google.com/p/mobicents/issues/detail?id=655
*
* @throws Exception
*/
@Test
public void isExperimentalResultCorrectlySetPNA() throws Exception {
long originalValue = 5001;
PushNotificationAnswer pna = shClientFactory.createPushNotificationAnswer(createPushNotificationRequest(), originalValue, true);
long obtainedValue = pna.getExperimentalResult().getExperimentalResultCode();
assertTrue("Experimental-Result-Code in PNA should be " + originalValue + " and is " + obtainedValue + ".", originalValue == obtainedValue);
}
Aggregations