use of net.java.slee.resource.diameter.gq.events.GqAbortSessionRequest in project jain-slee.diameter by RestComm.
the class GqFactoriesTest method isProxiableASR.
@Test
public void isProxiableASR() throws Exception {
GqAbortSessionRequest rar = gqMessageFactory.createGqAbortSessionRequest();
assertTrue("The 'P' bit is not set by default in Gq' Abort-Session-Request, it should.", rar.getHeader().isProxiable());
}
use of net.java.slee.resource.diameter.gq.events.GqAbortSessionRequest in project jain-slee.diameter by RestComm.
the class GqFactoriesTest method hasGqApplicationIdASR.
@Test
public void hasGqApplicationIdASR() throws Exception {
GqAbortSessionRequest asr = gqMessageFactory.createGqAbortSessionRequest();
assertTrue("Auth-Application-Id AVP in Gq ASR must be " + GqMessageFactory._GQ_AUTH_APP_ID + ", it is " + asr.getAuthApplicationId(), asr.getAuthApplicationId() == GqMessageFactory._GQ_AUTH_APP_ID);
}
use of net.java.slee.resource.diameter.gq.events.GqAbortSessionRequest in project jain-slee.diameter by RestComm.
the class GqFactoriesTest method hasTFlagSetASA.
@Test
public void hasTFlagSetASA() throws Exception {
GqAbortSessionRequest asr = gqMessageFactory.createGqAbortSessionRequest();
((DiameterMessageImpl) asr).getGenericData().setReTransmitted(true);
assertTrue("The 'T' flag should be set in Abort-Session-Request", asr.getHeader().isPotentiallyRetransmitted());
GqAbortSessionAnswer asa = gqMessageFactory.createGqAbortSessionAnswer(asr);
assertFalse("The 'T' flag should not be set in Abort-Session-Answer", asa.getHeader().isPotentiallyRetransmitted());
}
use of net.java.slee.resource.diameter.gq.events.GqAbortSessionRequest in project jain-slee.diameter by RestComm.
the class GqFactoriesTest method isRequestASR.
// Abort-Session-Request
@Test
public void isRequestASR() throws Exception {
GqAbortSessionRequest asr = gqMessageFactory.createGqAbortSessionRequest();
assertTrue("Request Flag in Abort-Session-Request is not set.", asr.getHeader().isRequest());
}
use of net.java.slee.resource.diameter.gq.events.GqAbortSessionRequest in project jain-slee.diameter by RestComm.
the class GqFactoriesTest method testMessageFactoryApplicationIdChangeASR.
@Test
public void testMessageFactoryApplicationIdChangeASR() throws Exception {
long vendor = 10415L;
ApplicationId originalAppId = ((GqMessageFactoryImpl) gqMessageFactory).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 Gq is " + originalAppId.getVendorId());
// let's create a message and see how it comes...
GqAbortSessionRequest originalASR = gqMessageFactory.createGqAbortSessionRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalASR);
// now we switch..
originalASR = null;
isVendor = !isVendor;
((GqMessageFactoryImpl) gqMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
GqAbortSessionRequest changedASR = gqMessageFactory.createGqAbortSessionRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedASR);
// revert back to default
((GqMessageFactoryImpl) gqMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
Aggregations