Search in sources :

Example 1 with ServerAssignmentRequest

use of net.java.slee.resource.diameter.cxdx.events.ServerAssignmentRequest in project jain-slee.diameter by RestComm.

the class CxDxClientSessionImpl method createServerAssignmentRequest.

/* (non-Javadoc)
   * @see net.java.slee.resource.diameter.cxdx.CxDxClientSession#createServerAssignmentRequest()
   */
public ServerAssignmentRequest createServerAssignmentRequest() {
    // Create the request
    ServerAssignmentRequest sar = cxdxMessageFactory.createServerAssignmentRequest(super.getSessionId());
    // Fill session related AVPs, if present
    fillSessionAVPs(sar);
    return sar;
}
Also used : ServerAssignmentRequest(net.java.slee.resource.diameter.cxdx.events.ServerAssignmentRequest)

Example 2 with ServerAssignmentRequest

use of net.java.slee.resource.diameter.cxdx.events.ServerAssignmentRequest in project jain-slee.diameter by RestComm.

the class CxDxFactoriesTest method testGettersAndSettersSAR.

@Test
public void testGettersAndSettersSAR() throws Exception {
    ServerAssignmentRequest sar = cxdxMessageFactory.createServerAssignmentRequest();
    int nFailures = CxDxAvpAssistant.INSTANCE.testMethods(sar, ServerAssignmentRequest.class);
    assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
Also used : ServerAssignmentRequest(net.java.slee.resource.diameter.cxdx.events.ServerAssignmentRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 3 with ServerAssignmentRequest

use of net.java.slee.resource.diameter.cxdx.events.ServerAssignmentRequest in project jain-slee.diameter by RestComm.

the class CxDxFactoriesTest method isProxiableCopiedSAA.

@Test
public void isProxiableCopiedSAA() throws Exception {
    ServerAssignmentRequest sar = cxdxMessageFactory.createServerAssignmentRequest();
    serverSession.fetchSessionData(sar);
    ServerAssignmentAnswer saa = serverSession.createServerAssignmentAnswer();
    assertEquals("The 'P' bit is not copied from request in Server-Assignment-Answer, it should. [RFC3588/6.2]", sar.getHeader().isProxiable(), saa.getHeader().isProxiable());
    // Reverse 'P' bit ...
    ((DiameterMessageImpl) sar).getGenericData().setProxiable(!sar.getHeader().isProxiable());
    assertTrue("The 'P' bit was not modified in Server-Assignment-Request, it should.", sar.getHeader().isProxiable() != saa.getHeader().isProxiable());
    serverSession.fetchSessionData(sar);
    saa = serverSession.createServerAssignmentAnswer();
    assertEquals("The 'P' bit is not copied from request in Server-Assignment-Answer, it should. [RFC3588/6.2]", sar.getHeader().isProxiable(), saa.getHeader().isProxiable());
}
Also used : ServerAssignmentRequest(net.java.slee.resource.diameter.cxdx.events.ServerAssignmentRequest) ServerAssignmentAnswer(net.java.slee.resource.diameter.cxdx.events.ServerAssignmentAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 4 with ServerAssignmentRequest

use of net.java.slee.resource.diameter.cxdx.events.ServerAssignmentRequest in project jain-slee.diameter by RestComm.

the class CxDxFactoriesTest method hasTFlagSetSAA.

@Test
public void hasTFlagSetSAA() throws Exception {
    ServerAssignmentRequest sar = cxdxMessageFactory.createServerAssignmentRequest();
    ((DiameterMessageImpl) sar).getGenericData().setReTransmitted(true);
    assertTrue("The 'T' flag should be set in Server-Assignment-Request", sar.getHeader().isPotentiallyRetransmitted());
    serverSession.fetchSessionData(sar);
    ServerAssignmentAnswer saa = serverSession.createServerAssignmentAnswer();
    assertFalse("The 'T' flag should not be set in Server-Assignment-Answer", saa.getHeader().isPotentiallyRetransmitted());
}
Also used : ServerAssignmentRequest(net.java.slee.resource.diameter.cxdx.events.ServerAssignmentRequest) ServerAssignmentAnswer(net.java.slee.resource.diameter.cxdx.events.ServerAssignmentAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 5 with ServerAssignmentRequest

use of net.java.slee.resource.diameter.cxdx.events.ServerAssignmentRequest in project jain-slee.diameter by RestComm.

the class CxDxFactoriesTest method isProxiableSAR.

@Test
public void isProxiableSAR() throws Exception {
    ServerAssignmentRequest sar = cxdxMessageFactory.createServerAssignmentRequest();
    assertTrue("The 'P' bit is not set by default in Server-Assignment-Request, it should.", sar.getHeader().isProxiable());
}
Also used : ServerAssignmentRequest(net.java.slee.resource.diameter.cxdx.events.ServerAssignmentRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Aggregations

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