use of net.java.slee.resource.diameter.s6a.events.PurgeUERequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method testGettersAndSettersPUA.
@Test
public void testGettersAndSettersPUA() throws Exception {
PurgeUERequest pur = s6aMessageFactory.createPurgeUERequest();
serverSession.fetchSessionData(pur);
PurgeUEAnswer pua = serverSession.createPurgeUEAnswer();
int nFailures = S6aAvpAssistant.INSTANCE.testMethods(pua, PurgeUEAnswer.class);
assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
use of net.java.slee.resource.diameter.s6a.events.PurgeUERequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method testMessageFactoryApplicationIdChangePUR.
@Test
public void testMessageFactoryApplicationIdChangePUR() 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...
PurgeUERequest originalPUR = s6aMessageFactory.createPurgeUERequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalPUR);
// now we switch..
originalPUR = null;
isVendor = !isVendor;
((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
PurgeUERequest changedPUR = s6aMessageFactory.createPurgeUERequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedPUR);
// revert back to default
((S6aMessageFactoryImpl) s6aMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
use of net.java.slee.resource.diameter.s6a.events.PurgeUERequest in project jain-slee.diameter by RestComm.
the class S6aFactoriesTest method isProxiablePUR.
@Test
public void isProxiablePUR() throws Exception {
PurgeUERequest pur = s6aMessageFactory.createPurgeUERequest();
assertTrue("The 'P' bit is not set by default in Purge-UE-Request it should.", pur.getHeader().isProxiable());
}
Aggregations