use of org.mobicents.slee.resource.diameter.cxdx.CxDxMessageFactoryImpl in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method testServerSessionApplicationIdChangeSAA.
@Test
public void testServerSessionApplicationIdChangeSAA() throws Exception {
long vendor = 10415L;
ApplicationId originalAppId = ((CxDxMessageFactoryImpl) cxdxMessageFactory).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 CxDx is " + originalAppId.getVendorId());
// let's create a message and see how it comes...
ServerAssignmentRequest sar = cxdxMessageFactory.createServerAssignmentRequest();
serverSession.fetchSessionData(sar);
ServerAssignmentAnswer originalSAA = serverSession.createServerAssignmentAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalSAA);
// now we switch..
originalSAA = null;
isVendor = !isVendor;
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
ServerAssignmentAnswer changedSAA = serverSession.createServerAssignmentAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedSAA);
// revert back to default
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
use of org.mobicents.slee.resource.diameter.cxdx.CxDxMessageFactoryImpl in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method testClientSessionApplicationIdChangePPA.
@Test
public void testClientSessionApplicationIdChangePPA() throws Exception {
long vendor = 10415L;
ApplicationId originalAppId = ((CxDxMessageFactoryImpl) cxdxMessageFactory).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 CxDx is " + originalAppId.getVendorId());
// let's create a message and see how it comes...
PushProfileRequest ppr = cxdxMessageFactory.createPushProfileRequest();
clientSession.fetchSessionData(ppr);
PushProfileAnswer originalPPA = clientSession.createPushProfileAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalPPA);
// now we switch..
originalPPA = null;
isVendor = !isVendor;
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
PushProfileAnswer changedPPA = clientSession.createPushProfileAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedPPA);
// revert back to default
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
use of org.mobicents.slee.resource.diameter.cxdx.CxDxMessageFactoryImpl in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method testClientSessionApplicationIdChangeMAR.
@Test
public void testClientSessionApplicationIdChangeMAR() throws Exception {
long vendor = 10415L;
ApplicationId originalAppId = ((CxDxMessageFactoryImpl) cxdxMessageFactory).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 CxDx is " + originalAppId.getVendorId());
// let's create a message and see how it comes...
MultimediaAuthenticationRequest originalMAR = clientSession.createMultimediaAuthenticationRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalMAR);
// now we switch..
originalMAR = null;
isVendor = !isVendor;
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
MultimediaAuthenticationRequest changedMAR = clientSession.createMultimediaAuthenticationRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedMAR);
// revert back to default
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
use of org.mobicents.slee.resource.diameter.cxdx.CxDxMessageFactoryImpl in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method testServerSessionApplicationIdChangeMAA.
@Test
public void testServerSessionApplicationIdChangeMAA() throws Exception {
long vendor = 10415L;
ApplicationId originalAppId = ((CxDxMessageFactoryImpl) cxdxMessageFactory).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 CxDx is " + originalAppId.getVendorId());
// let's create a message and see how it comes...
MultimediaAuthenticationRequest mar = cxdxMessageFactory.createMultimediaAuthenticationRequest();
serverSession.fetchSessionData(mar);
MultimediaAuthenticationAnswer originalMAA = serverSession.createMultimediaAuthenticationAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalMAA);
// now we switch..
originalMAA = null;
isVendor = !isVendor;
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
MultimediaAuthenticationAnswer changedMAA = serverSession.createMultimediaAuthenticationAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedMAA);
// revert back to default
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
use of org.mobicents.slee.resource.diameter.cxdx.CxDxMessageFactoryImpl in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method testServerSessionApplicationIdChangeLIA.
@Test
public void testServerSessionApplicationIdChangeLIA() throws Exception {
long vendor = 10415L;
ApplicationId originalAppId = ((CxDxMessageFactoryImpl) cxdxMessageFactory).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 CxDx is " + originalAppId.getVendorId());
// let's create a message and see how it comes...
LocationInfoRequest lir = cxdxMessageFactory.createLocationInfoRequest();
serverSession.fetchSessionData(lir);
LocationInfoAnswer originalLIA = serverSession.createLocationInfoAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalLIA);
// now we switch..
originalLIA = null;
isVendor = !isVendor;
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
LocationInfoAnswer changedLIA = serverSession.createLocationInfoAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedLIA);
// revert back to default
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
Aggregations