Search in sources :

Example 6 with UpdateLocationRequest

use of net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest in project jain-slee.diameter by RestComm.

the class S6aFactoriesTest method testGroupedChildAVPsULA.

@Test
public // Test for http://code.google.com/p/mobicents/issues/detail?id=3096
void testGroupedChildAVPsULA() throws Exception {
    UpdateLocationRequest ulr = s6aMessageFactory.createUpdateLocationRequest();
    serverSession.fetchSessionData(ulr);
    UpdateLocationAnswer ula = serverSession.createUpdateLocationAnswer();
    SubscriptionDataAvp sd = s6aAvpFactory.createSubscriptionData();
    // AMBR
    AMBRAvp ambr = s6aAvpFactory.createAMBR();
    ambr.setMaxRequestedBandwidthDL(12L);
    ambr.setMaxRequestedBandwidthUL(6L);
    sd.setAMBR(ambr);
    // APNConfigurationProfile
    APNConfigurationProfileAvp apnCP = s6aAvpFactory.createAPNConfigurationProfile();
    apnCP.setAllAPNConfigurationsIncludedIndicator(AllAPNConfigurationsIncludedIndicator.ALL_APN_CONFIGURATIONS_INCLUDED);
    APNConfigurationAvp apnC = s6aAvpFactory.createAPNConfiguration();
    apnC.setContextIdentifier(123L);
    apnC.setPDNType(PDNType.IPv4_OR_IPv6);
    apnC.setServiceSelection("...");
    apnCP.setAPNConfiguration(apnC);
    sd.setAPNConfigurationProfile(apnCP);
    ula.setSubscriptionData(sd);
}
Also used : UpdateLocationAnswer(net.java.slee.resource.diameter.s6a.events.UpdateLocationAnswer) UpdateLocationRequest(net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 7 with UpdateLocationRequest

use of net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest in project jain-slee.diameter by RestComm.

the class S6aServerSessionImpl method createUpdateLocationAnswer.

public UpdateLocationAnswer createUpdateLocationAnswer() {
    // Make sure we have the correct type of Request
    if (!(lastRequest instanceof UpdateLocationRequest)) {
        logger.warn("Invalid type of answer for this activity.");
        return null;
    }
    try {
        // Create the answer
        UpdateLocationAnswer aia = (UpdateLocationAnswer) this.s6aMessageFactory.createS6aMessage(lastRequest.getHeader(), new DiameterAvp[] {}, UpdateLocationAnswer.COMMAND_CODE, s6aMessageFactory.getApplicationId());
        // Fill session related AVPs, if present
        fillSessionAVPs(aia);
        return aia;
    } catch (InternalException e) {
        logger.error("Failed to create Update-Location-Answer.", e);
    }
    return null;
}
Also used : DiameterAvp(net.java.slee.resource.diameter.base.events.avp.DiameterAvp) UpdateLocationAnswer(net.java.slee.resource.diameter.s6a.events.UpdateLocationAnswer) UpdateLocationRequest(net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest) InternalException(org.jdiameter.api.InternalException)

Example 8 with UpdateLocationRequest

use of net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest in project jain-slee.diameter by RestComm.

the class S6aFactoriesTest method testGettersAndSettersULR.

@Test
public void testGettersAndSettersULR() throws Exception {
    UpdateLocationRequest ulr = s6aMessageFactory.createUpdateLocationRequest();
    int nFailures = S6aAvpAssistant.INSTANCE.testMethods(ulr, UpdateLocationRequest.class);
    assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
Also used : UpdateLocationRequest(net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 9 with UpdateLocationRequest

use of net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest in project jain-slee.diameter by RestComm.

the class S6aFactoriesTest method hasTFlagSetULA.

@Test
public void hasTFlagSetULA() throws Exception {
    UpdateLocationRequest ulr = s6aMessageFactory.createUpdateLocationRequest();
    ((DiameterMessageImpl) ulr).getGenericData().setReTransmitted(true);
    assertTrue("The 'T' flag should be set in Update-Location-Request", ulr.getHeader().isPotentiallyRetransmitted());
    serverSession.fetchSessionData(ulr);
    UpdateLocationAnswer ula = serverSession.createUpdateLocationAnswer();
    assertFalse("The 'T' flag should not be set in Update-Location-Answer", ula.getHeader().isPotentiallyRetransmitted());
}
Also used : UpdateLocationAnswer(net.java.slee.resource.diameter.s6a.events.UpdateLocationAnswer) UpdateLocationRequest(net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Example 10 with UpdateLocationRequest

use of net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest in project jain-slee.diameter by RestComm.

the class S6aFactoriesTest method testGettersAndSettersULA.

@Test
public void testGettersAndSettersULA() throws Exception {
    UpdateLocationRequest ulr = s6aMessageFactory.createUpdateLocationRequest();
    serverSession.fetchSessionData(ulr);
    UpdateLocationAnswer ula = serverSession.createUpdateLocationAnswer();
    int nFailures = S6aAvpAssistant.INSTANCE.testMethods(ula, UpdateLocationAnswer.class);
    assertEquals("Some methods have failed. See logs for more details.", 0, nFailures);
}
Also used : UpdateLocationAnswer(net.java.slee.resource.diameter.s6a.events.UpdateLocationAnswer) UpdateLocationRequest(net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest) Test(org.junit.Test) BaseFactoriesTest(org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)

Aggregations

UpdateLocationRequest (net.java.slee.resource.diameter.s6a.events.UpdateLocationRequest)14 Test (org.junit.Test)12 BaseFactoriesTest (org.mobicents.slee.resource.diameter.base.tests.factories.BaseFactoriesTest)12 UpdateLocationAnswer (net.java.slee.resource.diameter.s6a.events.UpdateLocationAnswer)9 ApplicationId (org.jdiameter.api.ApplicationId)2 S6aMessageFactoryImpl (org.mobicents.slee.resource.diameter.s6a.S6aMessageFactoryImpl)2 DiameterAvp (net.java.slee.resource.diameter.base.events.avp.DiameterAvp)1 InternalException (org.jdiameter.api.InternalException)1