use of net.java.slee.resource.diameter.rx.events.SessionTerminationRequest in project jain-slee.diameter by RestComm.
the class RxFactoriesTest method hasRxApplicationIdSTR.
@Test
public void hasRxApplicationIdSTR() throws Exception {
SessionTerminationRequest str = rxMessageFactory.createSessionTerminationRequest();
assertTrue("Auth-Application-Id AVP in Rx STR must be " + RxMessageFactory._Rx_AUTH_APP_ID + ", it is " + str.getAuthApplicationId(), str.getAuthApplicationId() == RxMessageFactory._Rx_AUTH_APP_ID);
}
use of net.java.slee.resource.diameter.rx.events.SessionTerminationRequest in project jain-slee.diameter by RestComm.
the class RxFactoriesTest method testGettersAndSettersSTR.
@Test
public void testGettersAndSettersSTR() throws Exception {
SessionTerminationRequest str = rxMessageFactory.createSessionTerminationRequest();
int nFailures = RxAvpAssistant.INSTANCE.testMethods(str, SessionTerminationRequest.class);
assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
use of net.java.slee.resource.diameter.rx.events.SessionTerminationRequest in project jain-slee.diameter by RestComm.
the class RxFactoriesTest method isRequestSTR.
// Session-Termination-Request
@Test
public void isRequestSTR() throws Exception {
SessionTerminationRequest str = rxMessageFactory.createSessionTerminationRequest();
assertTrue("Request Flag in Session-Termination-Request is not set.", str.getHeader().isRequest());
}
use of net.java.slee.resource.diameter.rx.events.SessionTerminationRequest in project jain-slee.diameter by RestComm.
the class RxFactoriesTest method testClientSessionApplicationIdChangeSTR.
@Test
public void testClientSessionApplicationIdChangeSTR() throws Exception {
long vendor = 10415L;
ApplicationId originalAppId = ((RxMessageFactoryImpl) rxMessageFactory).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 Rx is " + originalAppId.getVendorId());
// let's create a message and see how it comes...
SessionTerminationRequest originalSTR = rxClientSession.createSessionTermRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalSTR);
// now we switch..
originalSTR = null;
isVendor = !isVendor;
((RxMessageFactoryImpl) rxMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
SessionTerminationRequest changedSTR = rxClientSession.createSessionTermRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedSTR);
// revert back to default
((RxMessageFactoryImpl) rxMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
Aggregations