use of net.java.slee.resource.diameter.cxdx.events.LocationInfoAnswer in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method hasDestinationHostLIA.
@Test
public void hasDestinationHostLIA() throws Exception {
serverSession.fetchSessionData(cxdxMessageFactory.createLocationInfoRequest());
LocationInfoAnswer lia = serverSession.createLocationInfoAnswer();
assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", lia.getDestinationHost());
}
use of net.java.slee.resource.diameter.cxdx.events.LocationInfoAnswer in project jain-slee.diameter by RestComm.
the class CxDxServerSessionImpl method createLocationInfoAnswer.
/*
* (non-Javadoc)
* @see net.java.slee.resource.diameter.cxdx.CxDxServerSession#createLocationInfoAnswer()
*/
public LocationInfoAnswer createLocationInfoAnswer() {
// Make sure we have the correct type of Request
if (!(lastRequest instanceof LocationInfoRequest)) {
logger.warn("Invalid type of answer for this activity.");
return null;
}
try {
// Create the answer
LocationInfoAnswer lia = (LocationInfoAnswer) this.cxdxMessageFactory.createCxDxMessage(lastRequest.getHeader(), new DiameterAvp[] {}, LocationInfoAnswer.COMMAND_CODE, cxdxMessageFactory.getApplicationId());
// Fill session related AVPs, if present
fillSessionAVPs(lia);
return lia;
} catch (InternalException e) {
logger.error("Failed to create Location-Info-Answer.", e);
}
return null;
}
use of net.java.slee.resource.diameter.cxdx.events.LocationInfoAnswer in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method testGettersAndSettersLIA.
@Test
public void testGettersAndSettersLIA() throws Exception {
serverSession.fetchSessionData(cxdxMessageFactory.createLocationInfoRequest());
LocationInfoAnswer lia = serverSession.createLocationInfoAnswer();
int nFailures = CxDxAvpAssistant.INSTANCE.testMethods(lia, LocationInfoAnswer.class);
assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
Aggregations