Search in sources :

Example 1 with GxServerSessionActivityImpl

use of org.mobicents.slee.resource.diameter.gx.GxServerSessionActivityImpl in project jain-slee.diameter by RestComm.

the class GxFactoriesTest method hasTFlagSetCCA.

@Test
public void hasTFlagSetCCA() throws Exception {
    GxCreditControlRequest ccr = gxMessageFactory.createGxCreditControlRequest();
    ((DiameterMessageImpl) ccr).getGenericData().setReTransmitted(true);
    assertTrue("The 'T' flag should be set in Credit-Control-Request", ccr.getHeader().isPotentiallyRetransmitted());
    ((GxServerSessionActivityImpl) gxServerSession).fetchCurrentState(ccr);
    GxCreditControlAnswer cca = gxServerSession.createGxCreditControlAnswer();
    assertFalse("The 'T' flag should not be set in Credit-Control-Answer", cca.getHeader().isPotentiallyRetransmitted());
}
Also used : GxServerSessionActivityImpl(org.mobicents.slee.resource.diameter.gx.GxServerSessionActivityImpl) GxCreditControlRequest(net.java.slee.resource.diameter.gx.events.GxCreditControlRequest) GxCreditControlAnswer(net.java.slee.resource.diameter.gx.events.GxCreditControlAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 2 with GxServerSessionActivityImpl

use of org.mobicents.slee.resource.diameter.gx.GxServerSessionActivityImpl in project jain-slee.diameter by RestComm.

the class GxFactoriesTest method isProxiableCopiedCCA.

@Test
public void isProxiableCopiedCCA() throws Exception {
    GxCreditControlRequest ccr = gxMessageFactory.createGxCreditControlRequest();
    ((GxServerSessionActivityImpl) gxServerSession).fetchCurrentState(ccr);
    GxCreditControlAnswer cca = gxServerSession.createGxCreditControlAnswer();
    assertEquals("The 'P' bit is not copied from request in Credit-Control-Answer, it should. [RFC3588/6.2]", ccr.getHeader().isProxiable(), cca.getHeader().isProxiable());
    // Reverse 'P' bit ...
    ((DiameterMessageImpl) ccr).getGenericData().setProxiable(!ccr.getHeader().isProxiable());
    assertTrue("The 'P' bit was not modified in Credit-Control-Request, it should.", ccr.getHeader().isProxiable() != cca.getHeader().isProxiable());
    ((GxServerSessionActivityImpl) gxServerSession).fetchCurrentState(ccr);
    cca = gxServerSession.createGxCreditControlAnswer();
    assertEquals("The 'P' bit is not copied from request in Credit-Control-Answer, it should. [RFC3588/6.2]", ccr.getHeader().isProxiable(), cca.getHeader().isProxiable());
}
Also used : GxServerSessionActivityImpl(org.mobicents.slee.resource.diameter.gx.GxServerSessionActivityImpl) GxCreditControlRequest(net.java.slee.resource.diameter.gx.events.GxCreditControlRequest) GxCreditControlAnswer(net.java.slee.resource.diameter.gx.events.GxCreditControlAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Aggregations

GxCreditControlAnswer (net.java.slee.resource.diameter.gx.events.GxCreditControlAnswer)2 GxCreditControlRequest (net.java.slee.resource.diameter.gx.events.GxCreditControlRequest)2 Test (org.junit.Test)2 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)2 GxServerSessionActivityImpl (org.mobicents.slee.resource.diameter.gx.GxServerSessionActivityImpl)2