use of org.jdiameter.api.ApplicationId in project jain-slee.diameter by RestComm.
the class GqFactoriesTest method testMessageFactoryApplicationIdChangeRAR.
@Test
public void testMessageFactoryApplicationIdChangeRAR() 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...
GqReAuthRequest originalRAR = gqMessageFactory.createGqReAuthRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalRAR);
// now we switch..
originalRAR = null;
isVendor = !isVendor;
((GqMessageFactoryImpl) gqMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
GqReAuthRequest changedRAR = gqMessageFactory.createGqReAuthRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedRAR);
// revert back to default
((GqMessageFactoryImpl) gqMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
use of org.jdiameter.api.ApplicationId in project jain-slee.diameter by RestComm.
the class GxFactoriesTest method testMessageFactoryApplicationIdChangeRAR.
@Test
public void testMessageFactoryApplicationIdChangeRAR() throws Exception {
long vendor = 10415L;
ApplicationId originalAppId = ((GxMessageFactoryImpl) gxMessageFactory).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 Gx is " + originalAppId.getVendorId());
// let's create a message and see how it comes...
GxReAuthRequest originalRAR = gxMessageFactory.createGxReAuthRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalRAR);
// now we switch..
originalRAR = null;
isVendor = !isVendor;
((GxMessageFactoryImpl) gxMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
GxCreditControlRequest changedRAR = gxMessageFactory.createGxCreditControlRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedRAR);
// revert back to default
((GxMessageFactoryImpl) gxMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
use of org.jdiameter.api.ApplicationId in project jain-slee.diameter by RestComm.
the class GxFactoriesTest method testMessageFactoryApplicationIdChangeCCR.
@Test
public void testMessageFactoryApplicationIdChangeCCR() throws Exception {
long vendor = 10415L;
ApplicationId originalAppId = ((GxMessageFactoryImpl) gxMessageFactory).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 Gx is " + originalAppId.getVendorId());
// let's create a message and see how it comes...
GxCreditControlRequest originalCCR = gxMessageFactory.createGxCreditControlRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalCCR);
// now we switch..
originalCCR = null;
isVendor = !isVendor;
((GxMessageFactoryImpl) gxMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
GxCreditControlRequest changedCCR = gxMessageFactory.createGxCreditControlRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedCCR);
// revert back to default
((GxMessageFactoryImpl) gxMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
use of org.jdiameter.api.ApplicationId in project jain-slee.diameter by RestComm.
the class GxFactoriesTest method testMessageFactoryApplicationIdChangeInServerSessionCCA.
@Test
public void testMessageFactoryApplicationIdChangeInServerSessionCCA() throws Exception {
long vendor = 10415L;
ApplicationId originalAppId = ((GxMessageFactoryImpl) gxMessageFactory).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 Gx is " + originalAppId.getVendorId());
// let's create a message and see how it comes...
GxCreditControlAnswer originalCCA = gxServerSession.createGxCreditControlAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalCCA);
// now we switch..
originalCCA = null;
isVendor = !isVendor;
((GxMessageFactoryImpl) gxMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
GxCreditControlAnswer changedCCA = gxServerSession.createGxCreditControlAnswer();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedCCA);
// revert back to default
((GxMessageFactoryImpl) gxMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
use of org.jdiameter.api.ApplicationId in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method testMessageFactoryApplicationIdChangeLIR.
@Test
public void testMessageFactoryApplicationIdChangeLIR() 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 originalLIR = cxdxMessageFactory.createLocationInfoRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, originalLIR);
// now we switch..
originalLIR = null;
isVendor = !isVendor;
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(isVendor ? vendor : 0L, isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
// create a new message and see how it comes...
LocationInfoRequest changedLIR = cxdxMessageFactory.createLocationInfoRequest();
BaseFactoriesTest.checkCorrectApplicationIdAVPs(isVendor, isAuth, isAcct, changedLIR);
// revert back to default
((CxDxMessageFactoryImpl) cxdxMessageFactory).setApplicationId(originalAppId.getVendorId(), isAuth ? originalAppId.getAuthAppId() : originalAppId.getAcctAppId());
}
Aggregations