Search in sources :

Example 6 with LocationInfoAnswer

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());
}
Also used : LocationInfoAnswer(net.java.slee.resource.diameter.cxdx.events.LocationInfoAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 7 with LocationInfoAnswer

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;
}
Also used : LocationInfoRequest(net.java.slee.resource.diameter.cxdx.events.LocationInfoRequest) DiameterAvp(net.java.slee.resource.diameter.base.events.avp.DiameterAvp) LocationInfoAnswer(net.java.slee.resource.diameter.cxdx.events.LocationInfoAnswer) InternalException(org.jdiameter.api.InternalException)

Example 8 with LocationInfoAnswer

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);
}
Also used : LocationInfoAnswer(net.java.slee.resource.diameter.cxdx.events.LocationInfoAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Aggregations

LocationInfoAnswer (net.java.slee.resource.diameter.cxdx.events.LocationInfoAnswer)8 Test (org.junit.Test)7 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)7 LocationInfoRequest (net.java.slee.resource.diameter.cxdx.events.LocationInfoRequest)4 DiameterAvp (net.java.slee.resource.diameter.base.events.avp.DiameterAvp)1 ApplicationId (org.jdiameter.api.ApplicationId)1 InternalException (org.jdiameter.api.InternalException)1 CxDxMessageFactoryImpl (org.mobicents.slee.resource.diameter.cxdx.CxDxMessageFactoryImpl)1