Search in sources :

Example 6 with CancelLocationRequest

use of net.java.slee.resource.diameter.s6a.events.CancelLocationRequest in project jain-slee.diameter by RestComm.

the class S6aFactoriesTest method isProxiableCLR.

@Test
public void isProxiableCLR() throws Exception {
    CancelLocationRequest clr = s6aMessageFactory.createCancelLocationRequest();
    assertTrue("The 'P' bit is not set by default in Cancel-Location-Request it should.", clr.getHeader().isProxiable());
}
Also used : CancelLocationRequest(net.java.slee.resource.diameter.s6a.events.CancelLocationRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 7 with CancelLocationRequest

use of net.java.slee.resource.diameter.s6a.events.CancelLocationRequest in project jain-slee.diameter by RestComm.

the class S6aFactoriesTest method hasTFlagSetCLA.

@Test
public void hasTFlagSetCLA() throws Exception {
    CancelLocationRequest clr = s6aMessageFactory.createCancelLocationRequest();
    ((DiameterMessageImpl) clr).getGenericData().setReTransmitted(true);
    assertTrue("The 'T' flag should be set in Cancel-Location-Request", clr.getHeader().isPotentiallyRetransmitted());
    clientSession.fetchSessionData(clr);
    CancelLocationAnswer cla = clientSession.createCancelLocationAnswer();
    assertFalse("The 'T' flag should not be set in Cancel-Location-Answer", cla.getHeader().isPotentiallyRetransmitted());
}
Also used : CancelLocationRequest(net.java.slee.resource.diameter.s6a.events.CancelLocationRequest) CancelLocationAnswer(net.java.slee.resource.diameter.s6a.events.CancelLocationAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 8 with CancelLocationRequest

use of net.java.slee.resource.diameter.s6a.events.CancelLocationRequest in project jain-slee.diameter by RestComm.

the class S6aFactoriesTest method isRequestCLR.

@Test
public void isRequestCLR() throws Exception {
    CancelLocationRequest clr = s6aMessageFactory.createCancelLocationRequest();
    assertTrue("Request Flag in Cancel-Location-Request is not set.", clr.getHeader().isRequest());
}
Also used : CancelLocationRequest(net.java.slee.resource.diameter.s6a.events.CancelLocationRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 9 with CancelLocationRequest

use of net.java.slee.resource.diameter.s6a.events.CancelLocationRequest in project jain-slee.diameter by RestComm.

the class S6aClientSessionImpl method createCancelLocationAnswer.

public CancelLocationAnswer createCancelLocationAnswer() {
    // Make sure we have the correct type of Request
    if (!(lastRequest instanceof CancelLocationRequest)) {
        logger.warn("Invalid type of answer for this activity.");
        return null;
    }
    try {
        // Create the answer
        CancelLocationAnswer cla = (CancelLocationAnswer) this.s6aMessageFactory.createS6aMessage(lastRequest.getHeader(), new DiameterAvp[] {}, CancelLocationAnswer.COMMAND_CODE, s6aMessageFactory.getApplicationId());
        // Fill session related AVPs, if present
        fillSessionAVPs(cla);
        return cla;
    } catch (InternalException e) {
        logger.error("Failed to create Cancel-Location-Answer.", e);
    }
    return null;
}
Also used : DiameterAvp(net.java.slee.resource.diameter.base.events.avp.DiameterAvp) CancelLocationRequest(net.java.slee.resource.diameter.s6a.events.CancelLocationRequest) CancelLocationAnswer(net.java.slee.resource.diameter.s6a.events.CancelLocationAnswer) InternalException(org.jdiameter.api.InternalException)

Example 10 with CancelLocationRequest

use of net.java.slee.resource.diameter.s6a.events.CancelLocationRequest in project jain-slee.diameter by RestComm.

the class S6aFactoriesTest method testGettersAndSettersCLR.

@Test
public void testGettersAndSettersCLR() throws Exception {
    CancelLocationRequest clr = s6aMessageFactory.createCancelLocationRequest();
    int nFailures = S6aAvpAssistant.INSTANCE.testMethods(clr, CancelLocationRequest.class);
    assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
Also used : CancelLocationRequest(net.java.slee.resource.diameter.s6a.events.CancelLocationRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Aggregations

CancelLocationRequest (net.java.slee.resource.diameter.s6a.events.CancelLocationRequest)13 Test (org.junit.Test)11 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)11 CancelLocationAnswer (net.java.slee.resource.diameter.s6a.events.CancelLocationAnswer)8 ApplicationId (org.jdiameter.api.ApplicationId)2 S6aMessageFactoryImpl (org.mobicents.slee.resource.diameter.s6a.S6aMessageFactoryImpl)2 DiameterAvp (net.java.slee.resource.diameter.base.events.avp.DiameterAvp)1 InternalException (org.jdiameter.api.InternalException)1