Commit c4df8f4c authored by garciay's avatar garciay
Browse files

Validate SREM/SSEM test suite

parent 5f578575
Loading
Loading
Loading
Loading
+26 −4
Original line number Diff line number Diff line
@@ -20,19 +20,41 @@ public class LibItsMapemSpatem_asn1 extends LibIts_asn1 {
        _encodingName = "MAPEM_SPATEM_ETSI";
    }
    
    @Override
    public TriMessage encode(final Value template) {
        _logger.entering("LibItsMapemSpatem_asn1", "encode", template.getType().getName());
        
        TriMessage result;
        String type = String.format("%s.%s", _encodingName, template.getType().getName());
        if (template.getType().getName().endsWith("SREM")) {
            _encodingName = "MAPEM_PDU_Descriptions";
            result = super.encode(template);
        } else {
            _encodingName = "SPATEM_PDU_Descriptions";
            result = super.encode(template);
        }
        _encodingName = "MAPEM_SPATEM_ETSI";
        
        return result;
    }
    
    @Override
    public Value decode(final TriMessage message, final Type decodingHypothesis) {
        _logger.entering("LibItsMapemSpatem_asn1", "decode", decodingHypothesis.getName());
        
        Value result;
        if (decodingHypothesis.getName().endsWith("MAPEM")) {
            Type type = getTypeForName("MAPEM_PDU_Descriptions.MAPEM");
            return super.decode(message, type);
        } else if (decodingHypothesis.getName().endsWith("SPATEM")) {
            _encodingName = "MAPEM_PDU_Descriptions";
            result = super.decode(message, type);
        } else {
            Type type = getTypeForName("SPATEM_PDU_Descriptions.SPATEM");
            return super.decode(message, type);
            _encodingName = "SPATEM_PDU_Descriptions";
            result = super.decode(message, type);
        }
        _encodingName = "MAPEM_SPATEM_ETSI";
        
        return super.decode(message, decodingHypothesis);
        return result;
    }
    
} // End of class LibItsMapemSpatem_asn1 
+21 −5
Original line number Diff line number Diff line
@@ -24,15 +24,31 @@ public class LibItsSremSsem_asn1 extends LibIts_asn1 {
    public Value decode(final TriMessage message, final Type decodingHypothesis) {
        _logger.entering("LibItsSremSsem_asn1", "decode", decodingHypothesis.getName());
        
        if (decodingHypothesis.getName().endsWith("sremPacket")) {
            Type type = getTypeForName("SREM_PDU_Descriptions.MAPEM");
        if (decodingHypothesis.getName().endsWith("SREM")) {
            Type type = getTypeForName("SREM_PDU_Descriptions.SREM");
            return super.decode(message, type);
        } else if (decodingHypothesis.getName().endsWith("ssemPacket")) {
            Type type = getTypeForName("SSEM_PDU_Descriptions.SPATEM");
        } else {
            Type type = getTypeForName("SSEM_PDU_Descriptions.SSEM");
            return super.decode(message, type);
        }
    }
    
    @Override
    public TriMessage encode(final Value template) {
        _logger.entering("LibItsSremSsem_asn1", "encode", template.getType().getName());
        
        TriMessage result;
        String type = String.format("%s.%s", _encodingName, template.getType().getName());
        if (template.getType().getName().endsWith("SREM")) {
        	_encodingName = "SREM_PDU_Descriptions";
        	result = super.encode(template);
        } else {
        	_encodingName = "SREM_PDU_Descriptions";
        	result = super.encode(template);
        }
        _encodingName = "SREM_SSEM_ETSI";
        
        return super.decode(message, decodingHypothesis);
        return result;
    }
    
} // End of class LibItsSremSsem_asn1 
+12 −21
Original line number Diff line number Diff line
@@ -59,16 +59,7 @@ public class LibIts_asn1 implements TciCDProvided {
        msg.setEncodedMessage(message.getEncodedMessage());
        if (_logger.isLoggable(Level.ALL)) ByteHelper.dump("LibIts_asn1.decode: ", msg.getEncodedMessage());
        
        String type = null;
        if (_encodingName.equals("MAPEM_SPATEM_ETSI")) {
            if (decodingHypothesis.getName().endsWith("MAPEM")) {
                type = String.format("%s.%s", "MAPEM_PDU_Descriptions", decodingHypothesis.getName());
            } else {
                type = String.format("%s.%s", "SPATEM_PDU_Descriptions", decodingHypothesis.getName());
            }
        } else {
            type = String.format("%s.%s", _encodingName, decodingHypothesis.getName());
        }
        String type = String.format("%s.%s", _encodingName, decodingHypothesis.getName());
        _logger.info("Type: " + type);
        Type asnOriginalType = getTypeForName(type);
        // Check which type class the decoding hypothesis is of