Search in sources :

Example 6 with PurgeUERequest

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

the class S6aFactoriesTest method hasDestinationRealmPUA.

@Test
public void hasDestinationRealmPUA() throws Exception {
    PurgeUERequest pur = s6aMessageFactory.createPurgeUERequest();
    serverSession.fetchSessionData(pur);
    PurgeUEAnswer pua = serverSession.createPurgeUEAnswer();
    assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", pua.getDestinationRealm());
}
Also used : PurgeUEAnswer(net.java.slee.resource.diameter.s6a.events.PurgeUEAnswer) PurgeUERequest(net.java.slee.resource.diameter.s6a.events.PurgeUERequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 7 with PurgeUERequest

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

the class S6aMessageFactoryImpl method createPurgeUERequest.

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

Example 8 with PurgeUERequest

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

the class S6aFactoriesTest method isProxiableCopiedPUA.

@Test
public void isProxiableCopiedPUA() throws Exception {
    PurgeUERequest pur = s6aMessageFactory.createPurgeUERequest();
    serverSession.fetchSessionData(pur);
    PurgeUEAnswer pua = serverSession.createPurgeUEAnswer();
    assertEquals("The 'P' bit is not copied from request in Location-Info-Answer, it should. [RFC3588/6.2]", pur.getHeader().isProxiable(), pua.getHeader().isProxiable());
    // Reverse 'P' bit ...
    ((DiameterMessageImpl) pur).getGenericData().setProxiable(!pur.getHeader().isProxiable());
    assertTrue("The 'P' bit was not modified in Purge-UE-Request, it should.", pur.getHeader().isProxiable() != pua.getHeader().isProxiable());
    serverSession.fetchSessionData(pur);
    pua = serverSession.createPurgeUEAnswer();
    assertEquals("The 'P' bit is not copied from request in Purge-UE-Answer, it should. [RFC3588/6.2]", pur.getHeader().isProxiable(), pua.getHeader().isProxiable());
}
Also used : PurgeUEAnswer(net.java.slee.resource.diameter.s6a.events.PurgeUEAnswer) PurgeUERequest(net.java.slee.resource.diameter.s6a.events.PurgeUERequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 9 with PurgeUERequest

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

the class S6aFactoriesTest method testServerSessionApplicationIdChangePUA.

@Test
public void testServerSessionApplicationIdChangePUA() 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...
    PurgeUERequest pur = s6aMessageFactory.createPurgeUERequest();
    serverSession.fetchSessionData(pur);
    PurgeUEAnswer originalPUA = serverSession.createPurgeUEAnswer();
    BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalPUA);
    // now we switch..
    originalPUA = null;
    isVendor = !isVendor;
    ((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
    // create a new message and see how it comes...
    PurgeUEAnswer changedPUA = serverSession.createPurgeUEAnswer();
    BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedPUA);
    // revert back to default
    ((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
Also used : S6aMessageFactoryImpl(org.mobicents.slee.resource.diameter.s6a.S6aMessageFactoryImpl) ApplicationId(org.jdiameter.api.ApplicationId) PurgeUEAnswer(net.java.slee.resource.diameter.s6a.events.PurgeUEAnswer) PurgeUERequest(net.java.slee.resource.diameter.s6a.events.PurgeUERequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 10 with PurgeUERequest

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

the class S6aFactoriesTest method isAnswerPUA.

@Test
public void isAnswerPUA() throws Exception {
    PurgeUERequest pur = s6aMessageFactory.createPurgeUERequest();
    serverSession.fetchSessionData(pur);
    PurgeUEAnswer pua = serverSession.createPurgeUEAnswer();
    assertFalse("Request Flag in Purge-UE-Answer is set.", pua.getHeader().isRequest());
}
Also used : PurgeUEAnswer(net.java.slee.resource.diameter.s6a.events.PurgeUEAnswer) PurgeUERequest(net.java.slee.resource.diameter.s6a.events.PurgeUERequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Aggregations

PurgeUERequest (net.java.slee.resource.diameter.s6a.events.PurgeUERequest)13 Test (org.junit.Test)11 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)11 PurgeUEAnswer (net.java.slee.resource.diameter.s6a.events.PurgeUEAnswer)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