Search in sources :

Example 6 with GqAbortSessionRequest

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

the class GqFactoriesTest method isProxiableCopiedASA.

@Test
public void isProxiableCopiedASA() throws Exception {
    GqAbortSessionRequest asr = gqMessageFactory.createGqAbortSessionRequest();
    GqAbortSessionAnswer asa = gqMessageFactory.createGqAbortSessionAnswer(asr);
    assertEquals("The 'P' bit is not copied from request in Gq' Abort-Session-Answer, it should. [RFC3588/6.2]", asr.getHeader().isProxiable(), asa.getHeader().isProxiable());
    // Reverse 'P' bit ...
    ((DiameterMessageImpl) asr).getGenericData().setProxiable(!asr.getHeader().isProxiable());
    assertTrue("The 'P' bit was not modified in Gq' Abort-Session-Request, it should.", asr.getHeader().isProxiable() != asa.getHeader().isProxiable());
    asa = gqMessageFactory.createGqAbortSessionAnswer(asr);
    assertEquals("The 'P' bit is not copied from request in Gq' Abort-Session-Answer, it should. [RFC3588/6.2]", asr.getHeader().isProxiable(), asa.getHeader().isProxiable());
}
Also used : GqAbortSessionAnswer(net.java.slee.resource.diameter.gq.events.GqAbortSessionAnswer) GqAbortSessionRequest(net.java.slee.resource.diameter.gq.events.GqAbortSessionRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 7 with GqAbortSessionRequest

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

the class GqFactoriesTest method testGettersAndSettersASR.

@Test
public void testGettersAndSettersASR() throws Exception {
    GqAbortSessionRequest asr = gqMessageFactory.createGqAbortSessionRequest();
    int nFailures = GqAvpAssistant.INSTANCE.testMethods(asr, GqAbortSessionRequest.class);
    assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
Also used : GqAbortSessionRequest(net.java.slee.resource.diameter.gq.events.GqAbortSessionRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 8 with GqAbortSessionRequest

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

the class GqMessageFactoryImpl method createGqAbortSessionRequest.

@Override
public GqAbortSessionRequest createGqAbortSessionRequest(String sessionId) {
    Message raw = createRequest(GqAbortSessionRequest.COMMAND_CODE, new DiameterAvp[] {});
    GqAbortSessionRequest asr = new GqAbortSessionRequestImpl(raw);
    asr.setSessionId(sessionId);
    addOrigin(asr);
    return asr;
}
Also used : GqAbortSessionRequestImpl(org.mobicents.slee.resource.diameter.gq.events.GqAbortSessionRequestImpl) Message(org.jdiameter.api.Message) DiameterMessage(net.java.slee.resource.diameter.base.events.DiameterMessage) GqAbortSessionRequest(net.java.slee.resource.diameter.gq.events.GqAbortSessionRequest)

Example 9 with GqAbortSessionRequest

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

the class GqMessageFactoryImpl method createGqAbortSessionRequest.

@Override
public GqAbortSessionRequest createGqAbortSessionRequest() {
    Message raw = createRequest(GqAbortSessionRequest.COMMAND_CODE, new DiameterAvp[] {});
    GqAbortSessionRequest asr = new GqAbortSessionRequestImpl(raw);
    if (sessionId != null) {
        asr.setSessionId(sessionId);
    }
    addOrigin(asr);
    return asr;
}
Also used : GqAbortSessionRequestImpl(org.mobicents.slee.resource.diameter.gq.events.GqAbortSessionRequestImpl) Message(org.jdiameter.api.Message) DiameterMessage(net.java.slee.resource.diameter.base.events.DiameterMessage) GqAbortSessionRequest(net.java.slee.resource.diameter.gq.events.GqAbortSessionRequest)

Aggregations

GqAbortSessionRequest (net.java.slee.resource.diameter.gq.events.GqAbortSessionRequest)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 GqAbortSessionAnswer (net.java.slee.resource.diameter.gq.events.GqAbortSessionAnswer)2 Message (org.jdiameter.api.Message)2 GqAbortSessionRequestImpl (org.mobicents.slee.resource.diameter.gq.events.GqAbortSessionRequestImpl)2 ApplicationId (org.jdiameter.api.ApplicationId)1 GqMessageFactoryImpl (org.mobicents.slee.resource.diameter.gq.GqMessageFactoryImpl)1