use of net.java.slee.resource.diameter.s6a.events.ResetRequest in project jain-slee.diameter by RestComm.
the class S6aMessageFactoryImpl method createResetRequest.
public ResetRequest createResetRequest(String sessionId) throws IllegalArgumentException {
ResetRequest rsr = createResetRequest();
rsr.setSessionId(sessionId);
return rsr;
}
use of net.java.slee.resource.diameter.s6a.events.ResetRequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method testClientSessionApplicationIdChangeRSA.
@Test
public void testClientSessionApplicationIdChangeRSA() throws Exception {
long vendor = 10415L;
ApplicationId originalAppId = ((S6aMessageFactoryImpl) s6aMessageFactory).getApplicationId();
boolean isAuth = originalAppId.getAuthAppId() != org.jdiameter.api.ApplicationId.UNDEFINED_VALUE;
boolean isAcct = originalAppId.getAcctAppId() != org.jdiameter.api.ApplicationId.UNDEFINED_VALUE;
boolean isVendor = originalAppId.getVendorId() != 0L;
assertTrue("Invalid Application-Id (" + originalAppId + "). Should only, and at least, contain either Auth or Acct value.", (isAuth && !isAcct) || (!isAuth && isAcct));
System.out.println("Default VENDOR-ID for S6a is " + originalAppId.getVendorId());
// let's create a message and see how it comes...
ResetRequest rsr = s6aMessageFactory.createResetRequest();
clientSession.fetchSessionData(rsr);
ResetAnswer originalRSA = clientSession.createResetAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalRSA);
// now we switch..
originalRSA = null;
isVendor = !isVendor;
((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
ResetAnswer changedRSA = clientSession.createResetAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedRSA);
// revert back to default
((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
use of net.java.slee.resource.diameter.s6a.events.ResetRequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method isAnswerRSA.
@Test
public void isAnswerRSA() throws Exception {
ResetRequest rsr = s6aMessageFactory.createResetRequest();
clientSession.fetchSessionData(rsr);
ResetAnswer rsa = clientSession.createResetAnswer();
assertFalse("Request Flag in Reset-Answer is set.", rsa.getHeader().isRequest());
}
use of net.java.slee.resource.diameter.s6a.events.ResetRequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method hasDestinationRealmRSA.
@Test
public void hasDestinationRealmRSA() throws Exception {
ResetRequest rsr = s6aMessageFactory.createResetRequest();
clientSession.fetchSessionData(rsr);
ResetAnswer rsa = clientSession.createResetAnswer();
assertNull("The Destination-Host and Destination-Realm AVPs MUST NOT be present in the answer message. [RFC3588/6.2]", rsa.getDestinationRealm());
}
use of net.java.slee.resource.diameter.s6a.events.ResetRequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method hasTFlagSetRSA.
@Test
public void hasTFlagSetRSA() throws Exception {
ResetRequest rsr = s6aMessageFactory.createResetRequest();
((DiameterMessageImpl) rsr).getGenericData().setReTransmitted(true);
assertTrue("The 'T' flag should be set in Reset-Request", rsr.getHeader().isPotentiallyRetransmitted());
clientSession.fetchSessionData(rsr);
ResetAnswer rsa = clientSession.createResetAnswer();
assertFalse("The 'T' flag should not be set in Reset-Answer", rsa.getHeader().isPotentiallyRetransmitted());
}
Aggregations