use of net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationAnswer in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method isAnswerRTA.
@Test
public void isAnswerRTA() throws Exception {
clientSession.fetchSessionData(cxdxMessageFactory.createRegistrationTerminationRequest());
RegistrationTerminationAnswer rta = clientSession.createRegistrationTerminationAnswer();
assertFalse("Request Flag in Registration-Termination-Answer is set.", rta.getHeader().isRequest());
}
use of net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationAnswer in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method testGettersAndSettersRTA.
@Test
public void testGettersAndSettersRTA() throws Exception {
clientSession.fetchSessionData(cxdxMessageFactory.createRegistrationTerminationRequest());
RegistrationTerminationAnswer rta = clientSession.createRegistrationTerminationAnswer();
int nFailures = CxDxAvpAssistant.INSTANCE.testMethods(rta, RegistrationTerminationAnswer.class);
assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
use of net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationAnswer in project jain-slee.diameter by RestComm.
the class CxDxClientSessionImpl method createRegistrationTerminationAnswer.
/* (non-Javadoc)
* @see net.java.slee.resource.diameter.cxdx.CxDxClientSession#createRegistrationTerminationRequest()
*/
public RegistrationTerminationAnswer createRegistrationTerminationAnswer() {
// Make sure we have the correct type of Request
if (!(lastRequest instanceof RegistrationTerminationRequest)) {
logger.warn("Invalid type of answer for this activity.");
return null;
}
try {
// Create the answer
RegistrationTerminationAnswer rta = (RegistrationTerminationAnswer) this.cxdxMessageFactory.createCxDxMessage(lastRequest.getHeader(), new DiameterAvp[] {}, RegistrationTerminationAnswer.COMMAND_CODE, cxdxMessageFactory.getApplicationId());
// Fill session related AVPs, if present
fillSessionAVPs(rta);
return rta;
} catch (InternalException e) {
logger.error("Failed to create Registration-Termination-Answer.", e);
}
return null;
}
use of net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationAnswer in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method isProxiableCopiedRTA.
@Test
public void isProxiableCopiedRTA() throws Exception {
RegistrationTerminationRequest rtr = cxdxMessageFactory.createRegistrationTerminationRequest();
clientSession.fetchSessionData(rtr);
RegistrationTerminationAnswer rta = clientSession.createRegistrationTerminationAnswer();
assertEquals("The 'P' bit is not copied from request in Registration-Termination-Answer, it should. [RFC3588/6.2]", rtr.getHeader().isProxiable(), rta.getHeader().isProxiable());
// Reverse 'P' bit ...
((DiameterMessageImpl) rtr).getGenericData().setProxiable(!rtr.getHeader().isProxiable());
assertTrue("The 'P' bit was not modified in Registration-Termination-Request, it should.", rtr.getHeader().isProxiable() != rta.getHeader().isProxiable());
clientSession.fetchSessionData(rtr);
rta = clientSession.createRegistrationTerminationAnswer();
assertEquals("The 'P' bit is not copied from request in Registration-Termination-Answer, it should. [RFC3588/6.2]", rtr.getHeader().isProxiable(), rta.getHeader().isProxiable());
}
Aggregations