Search in sources :

Example 1 with SessionTerminationRequest

use of net.java.slee.resource.diameter.base.events.SessionTerminationRequest in project jain-slee.diameter by RestComm.

the class BaseFactoriesTest method isProxiableSTR.

@Test
public void isProxiableSTR() throws Exception {
    SessionTerminationRequest acr = messageFactory.createSessionTerminationRequest();
    assertTrue("The 'P' bit is not set by default in Session-Termination-Request, it should.", acr.getHeader().isProxiable());
}
Also used : SessionTerminationRequest(net.java.slee.resource.diameter.base.events.SessionTerminationRequest) Test(org.junit.Test)

Example 2 with SessionTerminationRequest

use of net.java.slee.resource.diameter.base.events.SessionTerminationRequest in project jain-slee.diameter by RestComm.

the class BaseFactoriesTest method isRequestSTR.

@Test
public void isRequestSTR() throws Exception {
    SessionTerminationRequest str = messageFactory.createSessionTerminationRequest();
    assertTrue("Request Flag in Disconnect-Peer-Request is not set.", str.getHeader().isRequest());
}
Also used : SessionTerminationRequest(net.java.slee.resource.diameter.base.events.SessionTerminationRequest) Test(org.junit.Test)

Example 3 with SessionTerminationRequest

use of net.java.slee.resource.diameter.base.events.SessionTerminationRequest in project jain-slee.diameter by RestComm.

the class BaseFactoriesTest method isProxiableCopiedSTA.

@Test
public void isProxiableCopiedSTA() throws Exception {
    SessionTerminationRequest asr = messageFactory.createSessionTerminationRequest();
    SessionTerminationAnswer asa = messageFactory.createSessionTerminationAnswer(asr);
    assertEquals("The 'P' bit is not copied from request in Session-Termination-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 Session-Termination-Request, it should.", asr.getHeader().isProxiable() != asa.getHeader().isProxiable());
    asa = messageFactory.createSessionTerminationAnswer(asr);
    assertEquals("The 'P' bit is not copied from request in Session-Termination-Answer, it should. [RFC3588/6.2]", asr.getHeader().isProxiable(), asa.getHeader().isProxiable());
}
Also used : SessionTerminationAnswer(net.java.slee.resource.diameter.base.events.SessionTerminationAnswer) SessionTerminationRequest(net.java.slee.resource.diameter.base.events.SessionTerminationRequest) Test(org.junit.Test)

Example 4 with SessionTerminationRequest

use of net.java.slee.resource.diameter.base.events.SessionTerminationRequest in project jain-slee.diameter by RestComm.

the class BaseFactoriesTest method testGettersAndSettersSTR.

@Test
public void testGettersAndSettersSTR() throws Exception {
    SessionTerminationRequest str = messageFactory.createSessionTerminationRequest();
    int nFailures = AvpAssistant.INSTANCE.testMethods(str, SessionTerminationRequest.class);
    assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
Also used : SessionTerminationRequest(net.java.slee.resource.diameter.base.events.SessionTerminationRequest) Test(org.junit.Test)

Example 5 with SessionTerminationRequest

use of net.java.slee.resource.diameter.base.events.SessionTerminationRequest in project jain-slee.diameter by RestComm.

the class DiameterMessageFactoryImpl method createSessionTerminationRequest.

public SessionTerminationRequest createSessionTerminationRequest(DiameterAvp[] avps) throws AvpNotAllowedException {
    SessionTerminationRequest msg = (SessionTerminationRequest) this.createDiameterMessage(null, avps, Message.SESSION_TERMINATION_REQUEST, BASE_AUTH_APP_ID);
    // Add Session-Id AVP if not present
    addSessionIdAvp(msg);
    return msg;
}
Also used : SessionTerminationRequest(net.java.slee.resource.diameter.base.events.SessionTerminationRequest)

Aggregations

SessionTerminationRequest (net.java.slee.resource.diameter.base.events.SessionTerminationRequest)8 Test (org.junit.Test)5 SessionTerminationAnswer (net.java.slee.resource.diameter.base.events.SessionTerminationAnswer)2