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;
}
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());
}
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());
}
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());
}
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);
}
Aggregations