Search in sources :

Example 6 with GxCreditControlAnswer

use of net.java.slee.resource.diameter.gx.events.GxCreditControlAnswer in project jain-slee.diameter by RestComm.

the class GxFactoriesTest method hasDestinationRealmCCA.

@Test
public void hasDestinationRealmCCA() throws Exception {
    GxCreditControlAnswer cca = gxServerSession.createGxCreditControlAnswer();
    assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", cca.getDestinationRealm());
}
Also used : GxCreditControlAnswer(net.java.slee.resource.diameter.gx.events.GxCreditControlAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 7 with GxCreditControlAnswer

use of net.java.slee.resource.diameter.gx.events.GxCreditControlAnswer 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 8 with GxCreditControlAnswer

use of net.java.slee.resource.diameter.gx.events.GxCreditControlAnswer in project jain-slee.diameter by RestComm.

the class GxFactoriesTest method hasGxApplicationIdCCA.

@Test
public void hasGxApplicationIdCCA() throws Exception {
    GxCreditControlAnswer cca = gxServerSession.createGxCreditControlAnswer();
    assertTrue("Auth-Application-Id AVP in Gx CCA must be 16777224, it is " + cca.getAuthApplicationId(), cca.getAuthApplicationId() == 16777224);
}
Also used : GxCreditControlAnswer(net.java.slee.resource.diameter.gx.events.GxCreditControlAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 9 with GxCreditControlAnswer

use of net.java.slee.resource.diameter.gx.events.GxCreditControlAnswer 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)

Example 10 with GxCreditControlAnswer

use of net.java.slee.resource.diameter.gx.events.GxCreditControlAnswer in project jain-slee.diameter by RestComm.

the class GxFactoriesTest method isAnswerCCA.

@Test
public void isAnswerCCA() throws Exception {
    GxCreditControlAnswer cca = gxServerSession.createGxCreditControlAnswer();
    assertFalse("Request Flag in Credit-Control-Answer is set.", cca.getHeader().isRequest());
}
Also used : 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)10 Test (org.junit.Test)9 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)8 GxCreditControlRequest (net.java.slee.resource.diameter.gx.events.GxCreditControlRequest)3 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)2 GxServerSessionActivityImpl (org.mobicents.slee.resource.diameter.gx.GxServerSessionActivityImpl)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)1 DiameterAvp (net.java.slee.resource.diameter.base.events.avp.DiameterAvp)1 Answer (org.jdiameter.api.Answer)1 ApplicationId (org.jdiameter.api.ApplicationId)1 Message (org.jdiameter.api.Message)1 GxCreditControlAnswerImpl (org.jdiameter.common.impl.app.gx.GxCreditControlAnswerImpl)1 GxMessageFactoryImpl (org.mobicents.slee.resource.diameter.gx.GxMessageFactoryImpl)1