Search in sources :

Example 1 with SessionTerminationAnswer

use of net.java.slee.resource.diameter.base.events.SessionTerminationAnswer 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 2 with SessionTerminationAnswer

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

the class BaseFactoriesTest method hasDestinationHostSTA.

@Test
public void hasDestinationHostSTA() throws Exception {
    SessionTerminationAnswer sta = messageFactory.createSessionTerminationAnswer(messageFactory.createSessionTerminationRequest());
    assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", sta.getDestinationHost());
}
Also used : SessionTerminationAnswer(net.java.slee.resource.diameter.base.events.SessionTerminationAnswer) Test(org.junit.Test)

Example 3 with SessionTerminationAnswer

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

the class BaseFactoriesTest method hasDestinationRealmSTA.

@Test
public void hasDestinationRealmSTA() throws Exception {
    SessionTerminationAnswer sta = messageFactory.createSessionTerminationAnswer(messageFactory.createSessionTerminationRequest());
    assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", sta.getDestinationRealm());
}
Also used : SessionTerminationAnswer(net.java.slee.resource.diameter.base.events.SessionTerminationAnswer) Test(org.junit.Test)

Example 4 with SessionTerminationAnswer

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

the class BaseFactoriesTest method hasTFlagSetSTA.

@Test
public void hasTFlagSetSTA() throws Exception {
    SessionTerminationRequest str = messageFactory.createSessionTerminationRequest();
    ((DiameterMessageImpl) str).getGenericData().setReTransmitted(true);
    assertTrue("The 'T' flag should be set in Session-Termination-Request", str.getHeader().isPotentiallyRetransmitted());
    SessionTerminationAnswer sta = messageFactory.createSessionTerminationAnswer(str);
    assertFalse("The 'T' flag should not be set in Session-Termination-Answer", sta.getHeader().isPotentiallyRetransmitted());
}
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 5 with SessionTerminationAnswer

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

the class BaseFactoriesTest method isAnswerSTA.

@Test
public void isAnswerSTA() throws Exception {
    SessionTerminationAnswer sta = messageFactory.createSessionTerminationAnswer(messageFactory.createSessionTerminationRequest());
    assertFalse("Request Flag in Disconnect-Peer-Answer is set.", sta.getHeader().isRequest());
}
Also used : SessionTerminationAnswer(net.java.slee.resource.diameter.base.events.SessionTerminationAnswer) Test(org.junit.Test)

Aggregations

SessionTerminationAnswer (net.java.slee.resource.diameter.base.events.SessionTerminationAnswer)8 Test (org.junit.Test)6 SessionTerminationRequest (net.java.slee.resource.diameter.base.events.SessionTerminationRequest)2 IOException (java.io.IOException)1 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)1 Answer (org.jdiameter.api.Answer)1 SessionTermAnswerImpl (org.jdiameter.common.impl.app.auth.SessionTermAnswerImpl)1 DiameterMessageImpl (org.mobicents.slee.resource.diameter.base.events.DiameterMessageImpl)1