Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ITS - Intelligent Transport Systems
ITS
Commits
c4df8f4c
Commit
c4df8f4c
authored
Aug 17, 2016
by
garciay
Browse files
Validate SREM/SSEM test suite
parent
5f578575
Changes
3
Show whitespace changes
Inline
Side-by-side
javasrc/tool/org/etsi/its/tool/elvior/LibItsMapemSpatem_asn1.java
View file @
c4df8f4c
...
...
@@ -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
javasrc/tool/org/etsi/its/tool/elvior/LibItsSremSsem_asn1.java
View file @
c4df8f4c
...
...
@@ -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.
MAP
EM"
);
if
(
decodingHypothesis
.
getName
().
endsWith
(
"
SREM
"
))
{
Type
type
=
getTypeForName
(
"SREM_PDU_Descriptions.
SR
EM"
);
return
super
.
decode
(
message
,
type
);
}
else
if
(
decodingHypothesis
.
getName
().
endsWith
(
"ssemPacket"
))
{
Type
type
=
getTypeForName
(
"SSEM_PDU_Descriptions.S
PAT
EM"
);
}
else
{
Type
type
=
getTypeForName
(
"SSEM_PDU_Descriptions.S
S
EM"
);
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
javasrc/tool/org/etsi/its/tool/elvior/LibIts_asn1.java
View file @
c4df8f4c
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment