use of net.java.slee.resource.diameter.rx.events.AAAnswer in project jain-slee.diameter by RestComm.
the class RxServerSessionActivityImpl method sendAAAnswer.
/**
* {@inheritDoc}
*/
@Override
public void sendAAAnswer(final AAAnswer aaa) throws IOException {
fetchCurrentState(aaa);
final DiameterMessageImpl msg = (DiameterMessageImpl) aaa;
try {
session.sendAAAnswer(new RxAAAnswerImpl((Answer) msg.getGenericData()));
} catch (org.jdiameter.api.validation.AvpNotAllowedException e) {
final AvpNotAllowedException anae = new AvpNotAllowedException("Message validation failed.", e, e.getAvpCode(), e.getVendorId());
throw anae;
} catch (Exception e) {
throw new IOException("Failed to send message.", e);
}
}
use of net.java.slee.resource.diameter.rx.events.AAAnswer in project jain-slee.diameter by RestComm.
the class RxFactoriesTest method hasRxApplicationIdAAA.
@Test
public void hasRxApplicationIdAAA() throws Exception {
rxServerSession.fetchCurrentState(rxMessageFactory.createAARequest());
AAAnswer aaa = rxServerSession.createAAAnswer();
assertTrue("Auth-Application-Id AVP in Rx AAA must be " + RxMessageFactory._Rx_AUTH_APP_ID + ", it is " + aaa.getAuthApplicationId(), aaa.getAuthApplicationId() == RxMessageFactory._Rx_AUTH_APP_ID);
}
use of net.java.slee.resource.diameter.rx.events.AAAnswer in project jain-slee.diameter by RestComm.
the class RxFactoriesTest method testGettersAndSettersAAA.
@Test
public void testGettersAndSettersAAA() throws Exception {
rxServerSession.fetchCurrentState(rxMessageFactory.createAARequest());
AAAnswer aaa = rxServerSession.createAAAnswer();
int nFailures = RxAvpAssistant.INSTANCE.testMethods(aaa, AAAnswer.class);
assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
use of net.java.slee.resource.diameter.rx.events.AAAnswer in project jain-slee.diameter by RestComm.
the class RxFactoriesTest method isProxiableCopiedAAA.
@Test
public void isProxiableCopiedAAA() throws Exception {
AARequest rar = rxMessageFactory.createAARequest();
AAAnswer raa = rxMessageFactory.createAAAnswer(rar);
assertEquals("The 'P' bit is not copied from request in Rx' AA-Answer, it should. [RFC3588/6.2]", rar.getHeader().isProxiable(), raa.getHeader().isProxiable());
// Reverse 'P' bit ...
((DiameterMessageImpl) rar).getGenericData().setProxiable(!rar.getHeader().isProxiable());
assertTrue("The 'P' bit was not modified in Rx' AA-Request, it should.", rar.getHeader().isProxiable() != raa.getHeader().isProxiable());
raa = rxMessageFactory.createAAAnswer(rar);
assertEquals("The 'P' bit is not copied from request in Rx' AA-Answer, it should. [RFC3588/6.2]", rar.getHeader().isProxiable(), raa.getHeader().isProxiable());
}
use of net.java.slee.resource.diameter.rx.events.AAAnswer in project jain-slee.diameter by RestComm.
the class RxFactoriesTest method isAnswerAAA.
// AA-Answer
@Test
public void isAnswerAAA() throws Exception {
rxServerSession.fetchCurrentState(rxMessageFactory.createAARequest());
AAAnswer aaa = rxServerSession.createAAAnswer();
assertFalse("Request Flag in AA-Answer is set.", aaa.getHeader().isRequest());
}
Aggregations