Search in sources :

Example 1 with CancelLocationRequest

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

the class S6aMessageFactoryImpl method createCancelLocationRequest.

public CancelLocationRequest createCancelLocationRequest(String sessionId) throws IllegalArgumentException {
    CancelLocationRequest clr = createCancelLocationRequest();
    clr.setSessionId(sessionId);
    return clr;
}
Also used : CancelLocationRequest(net.java.slee.resource.diameter.s6a.events.CancelLocationRequest)

Example 2 with CancelLocationRequest

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

the class S6aFactoriesTest method isAnswerCLA.

@Test
public void isAnswerCLA() throws Exception {
    CancelLocationRequest clr = s6aMessageFactory.createCancelLocationRequest();
    clientSession.fetchSessionData(clr);
    CancelLocationAnswer cla = clientSession.createCancelLocationAnswer();
    assertFalse("Request Flag in Cancel-Location-Answer is set.", cla.getHeader().isRequest());
}
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 3 with CancelLocationRequest

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

the class S6aFactoriesTest method testGettersAndSettersCLA.

@Test
public void testGettersAndSettersCLA() throws Exception {
    CancelLocationRequest clr = s6aMessageFactory.createCancelLocationRequest();
    clientSession.fetchSessionData(clr);
    CancelLocationAnswer cla = clientSession.createCancelLocationAnswer();
    int nFailures = S6aAvpAssistant.INSTANCE.testMethods(cla, CancelLocationAnswer.class);
    assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
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 4 with CancelLocationRequest

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

the class S6aFactoriesTest method hasDestinationRealmCLA.

@Test
public void hasDestinationRealmCLA() throws Exception {
    CancelLocationRequest clr = s6aMessageFactory.createCancelLocationRequest();
    clientSession.fetchSessionData(clr);
    CancelLocationAnswer cla = clientSession.createCancelLocationAnswer();
    assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", cla.getDestinationRealm());
}
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 5 with CancelLocationRequest

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

the class S6aFactoriesTest method testMessageFactoryApplicationIdChangeCLR.

@Test
public void testMessageFactoryApplicationIdChangeCLR() throws Exception {
    long vendor = 10415L;
    ApplicationId originalAppId = ((S6aMessageFactoryImpl) s6aMessageFactory).getApplicationId();
    boolean isAuth = originalAppId.getAuthAppId() != org.jdiameter.api.ApplicationId.UNDEFINED_VALUE;
    boolean isAcct = originalAppId.getAcctAppId() != org.jdiameter.api.ApplicationId.UNDEFINED_VALUE;
    boolean isVendor = originalAppId.getVendorId() != 0L;
    assertTrue("Invalid Application-Id (" + originalAppId + "). Should only, and at least, contain either Auth or Acct value.", (isAuth && !isAcct) || (!isAuth && isAcct));
    System.out.println("Default VENDOR-ID for S6a is " + originalAppId.getVendorId());
    // let's create a message and see how it comes...
    CancelLocationRequest originalCLR = s6aMessageFactory.createCancelLocationRequest();
    BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalCLR);
    // now we switch..
    originalCLR = null;
    isVendor = !isVendor;
    ((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
    // create a new message and see how it comes...
    CancelLocationRequest changedCLR = s6aMessageFactory.createCancelLocationRequest();
    BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedCLR);
    // revert back to default
    ((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
Also used : S6aMessageFactoryImpl(org.mobicents.slee.resource.diameter.s6a.S6aMessageFactoryImpl) CancelLocationRequest(net.java.slee.resource.diameter.s6a.events.CancelLocationRequest) ApplicationId(org.jdiameter.api.ApplicationId) 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