Search in sources :

Example 11 with RegistrationTerminationRequest

use of net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationRequest 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());
}
Also used : RegistrationTerminationAnswer(net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationAnswer) RegistrationTerminationRequest(net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Aggregations

RegistrationTerminationRequest (net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationRequest)11 Test (org.junit.Test)8 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)8 RegistrationTerminationAnswer (net.java.slee.resource.diameter.cxdx.events.RegistrationTerminationAnswer)4 ApplicationId (org.jdiameter.api.ApplicationId)3 CxDxMessageFactoryImpl (org.mobicents.slee.resource.diameter.cxdx.CxDxMessageFactoryImpl)3 DiameterAvp (net.java.slee.resource.diameter.base.events.avp.DiameterAvp)1 InternalException (org.jdiameter.api.InternalException)1