Search in sources :

Example 1 with RfAccountingAnswer

use of net.java.slee.resource.diameter.rf.events.RfAccountingAnswer in project jain-slee.diameter by RestComm.

the class RfServerSessionActivityImpl method createRfAccountingAnswer.

public RfAccountingAnswer createRfAccountingAnswer(RfAccountingRequest request, int resultCode) {
    RfAccountingAnswer answer = this.createRfAccountingAnswer(request);
    answer.setResultCode(resultCode);
    return answer;
}
Also used : RfAccountingAnswer(net.java.slee.resource.diameter.rf.events.RfAccountingAnswer)

Example 2 with RfAccountingAnswer

use of net.java.slee.resource.diameter.rf.events.RfAccountingAnswer in project jain-slee.diameter by RestComm.

the class RfFactoriesTest method hasDestinationRealmACA.

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

Example 3 with RfAccountingAnswer

use of net.java.slee.resource.diameter.rf.events.RfAccountingAnswer in project jain-slee.diameter by RestComm.

the class RfFactoriesTest method isProxiableCopiedACA.

@Test
public void isProxiableCopiedACA() throws Exception {
    RfAccountingRequest acr = rfMessageFactory.createRfAccountingRequest(AccountingRecordType.EVENT_RECORD);
    // needed ...
    acr.setAccountingRecordNumber(5L);
    RfAccountingAnswer aca = rfServerSession.createRfAccountingAnswer(acr);
    assertEquals("The 'P' bit is not copied from request in Accounting-Answer, it should. [RFC3588/6.2]", acr.getHeader().isProxiable(), aca.getHeader().isProxiable());
    // Reverse 'P' bit ...
    ((DiameterMessageImpl) acr).getGenericData().setProxiable(!acr.getHeader().isProxiable());
    assertTrue("The 'P' bit was not modified in Accounting-Request, it should.", acr.getHeader().isProxiable() != aca.getHeader().isProxiable());
    aca = rfServerSession.createRfAccountingAnswer(acr);
    assertEquals("The 'P' bit is not copied from request in Accounting-Answer, it should. [RFC3588/6.2]", acr.getHeader().isProxiable(), aca.getHeader().isProxiable());
}
Also used : RfAccountingAnswer(net.java.slee.resource.diameter.rf.events.RfAccountingAnswer) RfAccountingRequest(net.java.slee.resource.diameter.rf.events.RfAccountingRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 4 with RfAccountingAnswer

use of net.java.slee.resource.diameter.rf.events.RfAccountingAnswer in project jain-slee.diameter by RestComm.

the class RfFactoriesTest method hasTFlagSetACA.

@Test
public void hasTFlagSetACA() throws Exception {
    RfAccountingRequest acr = rfMessageFactory.createRfAccountingRequest(AccountingRecordType.EVENT_RECORD);
    // needed ...
    acr.setAccountingRecordNumber(5L);
    ((DiameterMessageImpl) acr).getGenericData().setReTransmitted(true);
    assertTrue("The 'T' flag should be set in Accounting-Request", acr.getHeader().isPotentiallyRetransmitted());
    RfAccountingAnswer aca = rfServerSession.createRfAccountingAnswer(acr);
    assertFalse("The 'T' flag should not be set in Accounting-Answer", aca.getHeader().isPotentiallyRetransmitted());
}
Also used : RfAccountingAnswer(net.java.slee.resource.diameter.rf.events.RfAccountingAnswer) RfAccountingRequest(net.java.slee.resource.diameter.rf.events.RfAccountingRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 5 with RfAccountingAnswer

use of net.java.slee.resource.diameter.rf.events.RfAccountingAnswer in project jain-slee.diameter by RestComm.

the class RfFactoriesTest method testGettersAndSettersACA.

@Test
public void testGettersAndSettersACA() throws Exception {
    RfAccountingAnswer aca = rfServerSession.createRfAccountingAnswer();
    int nFailures = RfAvpAssistant.INSTANCE.testMethods(aca, RfAccountingAnswer.class);
    assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
Also used : RfAccountingAnswer(net.java.slee.resource.diameter.rf.events.RfAccountingAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Aggregations

RfAccountingAnswer (net.java.slee.resource.diameter.rf.events.RfAccountingAnswer)11 Test (org.junit.Test)8 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)8 RfAccountingRequest (net.java.slee.resource.diameter.rf.events.RfAccountingRequest)4 IOException (java.io.IOException)1 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)1 Answer (org.jdiameter.api.Answer)1 ApplicationId (org.jdiameter.api.ApplicationId)1 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)1 RfMessageFactoryImpl (org.mobicents.slee.resource.diameter.rf.RfMessageFactoryImpl)1 RfServerSessionActivityImpl (org.mobicents.slee.resource.diameter.rf.RfServerSessionActivityImpl)1 RfAccountingAnswerImpl (org.mobicents.slee.resource.diameter.rf.events.RfAccountingAnswerImpl)1