Comment #9 on issue 152 by [email protected]: Implement insertSubscriberData MAP message
http://code.google.com/p/jss7/issues/detail?id=152


0. That is not may be a bug and we not not now update it totally but:
let's in future the code like (for enums !!!)
assertEquals(one.getData(),SupplementaryCodeValue.allFacsimileTransmissionServices.getCode());
replase with
assertEquals(one.getSupplementaryCodeValue(),SupplementaryCodeValue.allFacsimileTransmissionServices);
This test is far more correct.

1. AdditionalSubscriptions - needs unittest and toString()
2. CauseValue - may be we can expose Cause values (look at Q.850) + unittest and toString() (but I am not sure)
3. DestinationNumberCriteria: look at it's definition:
        -- one or both of destinationNumberList and destinationNumberLengthList
        -- shall be present
may be we add some checks for this?
4. GroupId and Long-GroupId:
-- When Group-Id is less than six characters in length, the TBCD filler (1111)
        -- is used to fill unused half octets.
        -- Refers to the Group Identification as specified in 3GPP TS 23.003
        -- and 3GPP TS 43.068/ 43.069
Let's implement unittests for case when "Group-Id is less than six characters in length". There may be some extra code needed to work with this case (may be adding chars in a constructor and removing fillers in a getter).
and: "super(1, 3, "GroupId");" - can GroupId have a length!=3/4 ?
5. OBcsmCamelTdpCriteria, TBcsmCamelTdpCriteria: when we decoding a choice (basicServiceCriteria in this case) we need not check tag/tagClass/isPrimitive, here: if (!(tag2 == ExtBasicServiceCodeImpl._ID_ext_BearerService || tag2 == ExtBasicServiceCodeImpl._ID_ext_Teleservice) || ais2.getTagClass() != Tag.CLASS_CONTEXT_SPECIFIC | | !ais2.isTagPrimitive()) throw new MAPParsingComponentException("Error while decoding " + _PrimitiveName + ".: extBasicServiceCode bad tag or tagClass or is not primitive ", MAPParsingComponentExceptionReason.MistypedParameter);
There are two reasons:
- this should be checked in a choice itself
- imagine yourself that in next specification version a qhuantity of choices will increase so we will have to search for all places in code when the choise are decoded and update a code.
This is not a bug.
6. ODBGeneralData - we need a couple of unittests here - the primitive is too complicated
I also guess that we need
super(15, 32, 28, "ODBGeneralData"); -> super(15, 32, 29, "ODBGeneralData");
because the last index is 28 and if we calculate with 0 we will have 29 bits (not 28)
7. ODBHPLMNData - may be a unittest too?
8. SMSCAMELTDPData - here and may be somethere else. serviceKey parameter is mandatory but it can not be null. The question is - how to check if it is present in a primitive when decoding. Some flag can be used. But the sompliest way is: serviceKey can not be negative, so before decoding we can set "serviceKey=-1;" and after decoding w can check "if(serviceKey==-1) { Exception(...) }". Please fix it.
And: in "toString()" let's add "sb.append("serviceKey==");"

to be continued ...



Reply via email to