Search in sources :

Example 1 with GqSessionTerminationRequest

use of net.java.slee.resource.diameter.gq.events.GqSessionTerminationRequest in project jain-slee.diameter by RestComm.

the class GqFactoriesTest method isRequestSTR.

// Session-Termination-Request
@Test
public void isRequestSTR() throws Exception {
    GqSessionTerminationRequest str = gqMessageFactory.createGqSessionTerminationRequest();
    assertTrue("Request Flag in Session-Termination-Request is not set.", str.getHeader().isRequest());
}
Also used : GqSessionTerminationRequest(net.java.slee.resource.diameter.gq.events.GqSessionTerminationRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 2 with GqSessionTerminationRequest

use of net.java.slee.resource.diameter.gq.events.GqSessionTerminationRequest in project jain-slee.diameter by RestComm.

the class GqFactoriesTest method isProxiableCopiedSTA.

@Test
public void isProxiableCopiedSTA() throws Exception {
    GqSessionTerminationRequest str = gqMessageFactory.createGqSessionTerminationRequest();
    GqSessionTerminationAnswer sta = gqMessageFactory.createGqSessionTerminationAnswer(str);
    assertEquals("The 'P' bit is not copied from request in Session-Termination-Answer, it should. [RFC3588/6.2]", str.getHeader().isProxiable(), sta.getHeader().isProxiable());
    // Reverse 'P' bit ...
    ((DiameterMessageImpl) str).getGenericData().setProxiable(!str.getHeader().isProxiable());
    assertTrue("The 'P' bit was not modified in Session-Termination-Request, it should.", str.getHeader().isProxiable() != sta.getHeader().isProxiable());
    sta = gqMessageFactory.createGqSessionTerminationAnswer(str);
    assertEquals("The 'P' bit is not copied from request in Session-Termination-Answer, it should. [RFC3588/6.2]", str.getHeader().isProxiable(), sta.getHeader().isProxiable());
}
Also used : GqSessionTerminationRequest(net.java.slee.resource.diameter.gq.events.GqSessionTerminationRequest) GqSessionTerminationAnswer(net.java.slee.resource.diameter.gq.events.GqSessionTerminationAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 3 with GqSessionTerminationRequest

use of net.java.slee.resource.diameter.gq.events.GqSessionTerminationRequest in project jain-slee.diameter by RestComm.

the class GqFactoriesTest method hasGqApplicationIdSTR.

@Test
public void hasGqApplicationIdSTR() throws Exception {
    GqSessionTerminationRequest str = gqMessageFactory.createGqSessionTerminationRequest();
    assertTrue("Auth-Application-Id AVP in Gq STR must be " + GqMessageFactory._GQ_AUTH_APP_ID + ", it is " + str.getAuthApplicationId(), str.getAuthApplicationId() == GqMessageFactory._GQ_AUTH_APP_ID);
}
Also used : GqSessionTerminationRequest(net.java.slee.resource.diameter.gq.events.GqSessionTerminationRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 4 with GqSessionTerminationRequest

use of net.java.slee.resource.diameter.gq.events.GqSessionTerminationRequest in project jain-slee.diameter by RestComm.

the class GqFactoriesTest method hasTFlagSetSTA.

@Test
public void hasTFlagSetSTA() throws Exception {
    GqSessionTerminationRequest str = gqMessageFactory.createGqSessionTerminationRequest();
    ((DiameterMessageImpl) str).getGenericData().setReTransmitted(true);
    assertTrue("The 'T' flag should be set in Session-Termination-Request", str.getHeader().isPotentiallyRetransmitted());
    GqSessionTerminationAnswer sta = gqMessageFactory.createGqSessionTerminationAnswer(str);
    assertFalse("The 'T' flag should not be set in Session-Termination-Answer", sta.getHeader().isPotentiallyRetransmitted());
}
Also used : GqSessionTerminationRequest(net.java.slee.resource.diameter.gq.events.GqSessionTerminationRequest) GqSessionTerminationAnswer(net.java.slee.resource.diameter.gq.events.GqSessionTerminationAnswer) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 5 with GqSessionTerminationRequest

use of net.java.slee.resource.diameter.gq.events.GqSessionTerminationRequest in project jain-slee.diameter by RestComm.

the class GqFactoriesTest method isProxiableSTR.

@Test
public void isProxiableSTR() throws Exception {
    GqSessionTerminationRequest str = gqMessageFactory.createGqSessionTerminationRequest();
    assertTrue("The 'P' bit is not set by default in Session-Termination-Request, it should.", str.getHeader().isProxiable());
}
Also used : GqSessionTerminationRequest(net.java.slee.resource.diameter.gq.events.GqSessionTerminationRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Aggregations

GqSessionTerminationRequest (net.java.slee.resource.diameter.gq.events.GqSessionTerminationRequest)9 Test (org.junit.Test)7 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)7 DiameterMessage (net.java.slee.resource.diameter.base.events.DiameterMessage)2 GqSessionTerminationAnswer (net.java.slee.resource.diameter.gq.events.GqSessionTerminationAnswer)2 Message (org.jdiameter.api.Message)2 GqSessionTerminationRequestImpl (org.mobicents.slee.resource.diameter.gq.events.GqSessionTerminationRequestImpl)2 ApplicationId (org.jdiameter.api.ApplicationId)1 GqMessageFactoryImpl (org.mobicents.slee.resource.diameter.gq.GqMessageFactoryImpl)1