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());
}
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());
}
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());
}
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());
}
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());
}
Aggregations