use of net.java.slee.resource.diameter.cxdx.events.LocationInfoRequest in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method isProxiableLIR.
@Test
public void isProxiableLIR() throws Exception {
LocationInfoRequest lir = cxdxMessageFactory.createLocationInfoRequest();
assertTrue("The 'P' bit is not set by default in Location-Info-Request, it should.", lir.getHeader().isProxiable());
}
use of net.java.slee.resource.diameter.cxdx.events.LocationInfoRequest in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method hasTFlagSetLIA.
@Test
public void hasTFlagSetLIA() throws Exception {
LocationInfoRequest lir = cxdxMessageFactory.createLocationInfoRequest();
((DiameterMessageImpl) lir).getGenericData().setReTransmitted(true);
assertTrue("The 'T' flag should be set in Location-Info-Request", lir.getHeader().isPotentiallyRetransmitted());
serverSession.fetchSessionData(lir);
LocationInfoAnswer lia = serverSession.createLocationInfoAnswer();
assertFalse("The 'T' flag should not be set in Location-Info-Answer", lia.getHeader().isPotentiallyRetransmitted());
}
use of net.java.slee.resource.diameter.cxdx.events.LocationInfoRequest in project jain-slee.diameter by RestComm.
the class CxDxFactoriesTest method testGettersAndSettersLIR.
@Test
public void testGettersAndSettersLIR() throws Exception {
LocationInfoRequest lir = cxdxMessageFactory.createLocationInfoRequest();
int nFailures = CxDxAvpAssistant.INSTANCE.testMethods(lir, LocationInfoRequest.class);
assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
use of net.java.slee.resource.diameter.cxdx.events.LocationInfoRequest 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());
}
use of net.java.slee.resource.diameter.cxdx.events.LocationInfoRequest in project jain-slee.diameter by RestComm.
the class CxDxMessageFactoryImpl method createLocationInfoRequest.
/* (non-Javadoc)
* @see net.java.slee.resource.diameter.cxdx.CxDxMessageFactory#createLocationInfoRequest(java.lang.String)
*/
public LocationInfoRequest createLocationInfoRequest(String sessionId) throws IllegalArgumentException {
LocationInfoRequest lir = createLocationInfoRequest();
lir.setSessionId(sessionId);
return lir;
}
Aggregations